osg MatrixManipulator CameraManipulator
<osgGA/MatrixManipulator>:No such file or directory
修改为
#include <osgGA/CameraManipulator>
osgGA::GUIEventHandler
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/ #ifndef OSGGA_GUIEVENTHANDLER
#define OSGGA_GUIEVENTHANDLER 1 #include <vector> #include <osg/Drawable>
#include <osg/ApplicationUsage> #include <osgGA/EventHandler>
#include <osgGA/GUIEventAdapter>
#include <osgGA/GUIActionAdapter> // #define COMPILE_COMPOSITE_EVENTHANDLER namespace osgGA{ /** GUIEventHandler provides a basic interface for any class which wants to handle
a GUI Events. The GUIEvent is supplied by a GUIEventAdapter. Feedback resulting from the
handle method is supplied by a GUIActionAdapter, which allows the GUIEventHandler
to ask the GUI to take some action in response to an incoming event. For example, consider a Trackball Viewer class which takes mouse events and
manipulates a scene camera in response. The Trackball Viewer is a GUIEventHandler,
and receives the events via the handle method. If the user 'throws' the model,
the Trackball Viewer class can detect this via the incoming events, and
request that the GUI set up a timer callback to continually redraw the view.
This request is made via the GUIActionAdapter class. */ class OSGGA_EXPORT GUIEventHandler : public EventHandler
{
public: GUIEventHandler() {}
GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(eh, copyop),
osg::Callback(eh, copyop),
EventHandler(eh, copyop) {} META_Object(osgGA,GUIEventHandler); /** Handle event. Override the handle(..) method in your event handlers to respond to events. */
virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv); /** Handle events, return true if handled, false otherwise. */
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor*) { return handle(ea,aa); } /** Deprecated, Handle events, return true if handled, false otherwise. */
virtual bool handle(const GUIEventAdapter&,GUIActionAdapter&) { return false; } protected:
virtual ~GUIEventHandler(); }; } #endif
osgGA::CameraManipulator
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/ #ifndef OSGGA_CameraManipulator
#define OSGGA_CameraManipulator 1 #include <osg/Node>
#include <osg/Matrixd>
#include <osg/CoordinateSystemNode> #include <osgUtil/SceneView> #include <osgGA/Export>
#include <osgGA/GUIEventHandler>
#include <osgGA/GUIEventAdapter>
#include <osgGA/GUIActionAdapter> namespace osgGA{ #define NEW_HOME_POSITION /** CameraManipulator is an abstract base class defining the interface, and a certain
amount of default functionality, for classes which wish to control OSG cameras
in response to GUI events. */
class OSGGA_EXPORT CameraManipulator : public GUIEventHandler
{
typedef GUIEventHandler inherited; public: // We are not using META_Object as this is abstract class.
// Use META_Object(osgGA,YourManipulator); in your descendant non-abstract classes.
virtual const char* className() const { return "CameraManipulator"; } /** callback class to use to allow matrix manipulators to query the application for the local coordinate frame.*/
class CoordinateFrameCallback : public osg::Referenced
{
public:
virtual osg::CoordinateFrame getCoordinateFrame(const osg::Vec3d& position) const = ;
protected:
virtual ~CoordinateFrameCallback() {}
}; /** set the coordinate frame which callback tells the manipulator which way is up, east and north.*/
virtual void setCoordinateFrameCallback(CoordinateFrameCallback* cb) { _coordinateFrameCallback = cb; } /** get the coordinate frame callback which tells the manipulator which way is up, east and north.*/
CoordinateFrameCallback* getCoordinateFrameCallback() { return _coordinateFrameCallback.get(); } /** get the coordinate frame callback which tells the manipulator which way is up, east and north.*/
const CoordinateFrameCallback* getCoordinateFrameCallback() const { return _coordinateFrameCallback.get(); } /** get the coordinate frame.*/
osg::CoordinateFrame getCoordinateFrame(const osg::Vec3d& position) const
{
if (_coordinateFrameCallback.valid()) return _coordinateFrameCallback->getCoordinateFrame(position);
return osg::CoordinateFrame();
} osg::Vec3d getSideVector(const osg::CoordinateFrame& cf) const { return osg::Vec3d(cf(,),cf(,),cf(,)); }
osg::Vec3d getFrontVector(const osg::CoordinateFrame& cf) const { return osg::Vec3d(cf(,),cf(,),cf(,)); }
osg::Vec3d getUpVector(const osg::CoordinateFrame& cf) const { return osg::Vec3d(cf(,),cf(,),cf(,)); } /** set the position of the matrix manipulator using a 4x4 Matrix.*/
virtual void setByMatrix(const osg::Matrixd& matrix) = ; /** set the position of the matrix manipulator using a 4x4 Matrix.*/
virtual void setByInverseMatrix(const osg::Matrixd& matrix) = ; /** get the position of the manipulator as 4x4 Matrix.*/
virtual osg::Matrixd getMatrix() const = ; /** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
virtual osg::Matrixd getInverseMatrix() const = ; /** update the camera for the current frame, typically called by the viewer classes.
Default implementation simply set the camera view matrix. */
virtual void updateCamera(osg::Camera& camera) { camera.setViewMatrix(getInverseMatrix()); } /** Get the FusionDistanceMode. Used by SceneView for setting up stereo convergence.*/
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE; } /** Get the FusionDistanceValue. Used by SceneView for setting up stereo convergence.*/
virtual float getFusionDistanceValue() const { return 1.0f; } /** Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.
* The intersection traversal mask is useful for controlling what parts of the scene graph should be used for intersection purposes.*/
void setIntersectTraversalMask(unsigned int mask) { _intersectTraversalMask = mask; } /** Get the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.*/
unsigned int getIntersectTraversalMask() const { return _intersectTraversalMask; } /**
Attach a node to the manipulator, automatically detaching any previously attached node.
setNode(NULL) detaches previous nodes.
May be ignored by manipulators which do not require a reference model.
*/
virtual void setNode(osg::Node*) {} /** Return const node if attached.*/
virtual const osg::Node* getNode() const { return NULL; } /** Return node if attached.*/
virtual osg::Node* getNode() { return NULL; } /** Manually set the home position, and set the automatic compute of home position. */
virtual void setHomePosition(const osg::Vec3d& eye, const osg::Vec3d& center, const osg::Vec3d& up, bool autoComputeHomePosition=false)
{
setAutoComputeHomePosition(autoComputeHomePosition);
_homeEye = eye;
_homeCenter = center;
_homeUp = up;
} /** Get the manually set home position. */
virtual void getHomePosition(osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up) const
{
eye = _homeEye;
center = _homeCenter;
up = _homeUp;
} /** Set whether the automatic compute of the home position is enabled.*/
virtual void setAutoComputeHomePosition(bool flag) { _autoComputeHomePosition = flag; } /** Get whether the automatic compute of the home position is enabled.*/
bool getAutoComputeHomePosition() const { return _autoComputeHomePosition; } /** Compute the home position.*/
virtual void computeHomePosition(const osg::Camera *camera = NULL, bool useBoundingBox = false); /** finish any active manipulator animations.*/
virtual void finishAnimation() {} /**
Move the camera to the default position.
May be ignored by manipulators if home functionality is not appropriate.
*/
virtual void home(const GUIEventAdapter& ,GUIActionAdapter&) {} /**
Move the camera to the default position.
This version does not require GUIEventAdapter and GUIActionAdapter so may be
called from somewhere other than a handle() method in GUIEventHandler. Application
must be aware of implications.
*/
virtual void home(double /*currentTime*/) {} /**
Start/restart the manipulator.
*/
virtual void init(const GUIEventAdapter& ,GUIActionAdapter&) {} /** Handle event. Override the handle(..) method in your event handlers to respond to events. */
virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv) { return GUIEventHandler::handle(event, object, nv); } /** Handle events, return true if handled, false otherwise. */
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us); protected: CameraManipulator();
CameraManipulator(const CameraManipulator& mm, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY); virtual ~CameraManipulator(); std::string getManipulatorName() const; unsigned int _intersectTraversalMask; bool _autoComputeHomePosition; osg::Vec3d _homeEye;
osg::Vec3d _homeCenter;
osg::Vec3d _homeUp; osg::ref_ptr<CoordinateFrameCallback> _coordinateFrameCallback; }; } #endif
osgGA::StandardManipulator
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* StandardManipulator code Copyright (C) 2010 PCJohn (Jan Peciva)
* while some pieces of code were taken from OSG.
* Thanks to company Cadwork (www.cadwork.ch) and
* Brno University of Technology (www.fit.vutbr.cz) for open-sourcing this work.
*/ #ifndef OSGGA_CAMERA_MANIPULATOR
#define OSGGA_CAMERA_MANIPULATOR 1 #include <osgGA/CameraManipulator> namespace osgGA { /** StandardManipulator class provides basic functionality
for user controlled manipulation.*/
class OSGGA_EXPORT StandardManipulator : public CameraManipulator
{
typedef CameraManipulator inherited; public: // flags
enum UserInteractionFlags
{
UPDATE_MODEL_SIZE = 0x01,
COMPUTE_HOME_USING_BBOX = 0x02,
PROCESS_MOUSE_WHEEL = 0x04,
SET_CENTER_ON_WHEEL_FORWARD_MOVEMENT = 0x08,
DEFAULT_SETTINGS = UPDATE_MODEL_SIZE /*| COMPUTE_HOME_USING_BBOX*/ | PROCESS_MOUSE_WHEEL
}; StandardManipulator( int flags = DEFAULT_SETTINGS );
StandardManipulator( const StandardManipulator& m,
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); // We are not using META_Object as this is abstract class.
// Use META_Object(osgGA,YourManipulator); in your descendant non-abstract classes.
virtual const char* className() const { return "StandardManipulator"; } /** Sets manipulator by eye position and eye orientation.*/
virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation ) = ; /** Sets manipulator by eye position, center of rotation, and up vector.*/
virtual void setTransformation( const osg::Vec3d& eye, const osg::Vec3d& center, const osg::Vec3d& up ) = ; /** Gets manipulator's eye position and eye orientation.*/
virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const = ; /** Gets manipulator's focal center, eye position, and up vector.*/
virtual void getTransformation( osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up ) const = ; virtual void setNode( osg::Node* );
virtual const osg::Node* getNode() const;
virtual osg::Node* getNode(); virtual void setVerticalAxisFixed( bool value );
inline bool getVerticalAxisFixed() const;
inline bool getAllowThrow() const;
virtual void setAllowThrow( bool allowThrow ); virtual void setAnimationTime( const double t );
double getAnimationTime() const;
bool isAnimating() const;
virtual void finishAnimation(); virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual void home( double ); virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual void getUsage( osg::ApplicationUsage& usage ) const; protected: virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleResize( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseMove( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseDrag( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleKeyUp( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseDeltaMovement( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool performMovement();
virtual bool performMovementLeftMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementRightMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMouseDeltaMovement( const float dx, const float dy );
virtual bool performAnimationMovement( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); void addMouseEvent( const osgGA::GUIEventAdapter& ea );
void flushMouseEventStack();
virtual bool isMouseMoving() const;
float getThrowScale( const double eventTimeDelta ) const;
virtual void centerMousePointer( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); static void rotateYawPitch( osg::Quat& rotation, const double yaw, const double pitch,
const osg::Vec3d& localUp = osg::Vec3d( .,.,.) );
static void fixVerticalAxis( osg::Quat& rotation, const osg::Vec3d& localUp, bool disallowFlipOver );
void fixVerticalAxis( osg::Vec3d& eye, osg::Quat& rotation, bool disallowFlipOver );
static void fixVerticalAxis( const osg::Vec3d& forward, const osg::Vec3d& up, osg::Vec3d& newUp,
const osg::Vec3d& localUp, bool disallowFlipOver );
virtual bool setCenterByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); // mouse state
bool _thrown;
bool _allowThrow;
float _mouseCenterX, _mouseCenterY; // internal event stack comprising last two mouse events.
osg::ref_ptr< const osgGA::GUIEventAdapter > _ga_t1;
osg::ref_ptr< const osgGA::GUIEventAdapter > _ga_t0; /** The approximate amount of time it is currently taking to draw a frame.
* This is used to compute the delta in translation/rotation during a thrown display update.
* It allows us to match an delta in position/rotation independent of the rendering frame rate.
*/
double _delta_frame_time; /** The time the last frame started.
* Used when _rate_sensitive is true so that we can match display update rate to rotation/translation rate.
*/
double _last_frame_time; // scene data
osg::ref_ptr< osg::Node > _node;
double _modelSize;
bool _verticalAxisFixed; // animation stuff
class OSGGA_EXPORT AnimationData : public osg::Referenced {
public:
double _animationTime;
bool _isAnimating;
double _startTime;
double _phase; AnimationData();
void start( const double startTime );
};
osg::ref_ptr< AnimationData > _animationData;
virtual void allocAnimationData() { _animationData = new AnimationData(); } // flags
int _flags; // flags indicating that a value is relative to model size
int _relativeFlags;
inline bool getRelativeFlag( int index ) const;
inline void setRelativeFlag( int index, bool value );
static int numRelativeFlagsAllocated;
static int allocateRelativeFlag();
}; //
// inline methods
// inline bool StandardManipulator::getRelativeFlag( int index ) const
{
return ( _relativeFlags & (0x01 << index) ) != ;
} inline void StandardManipulator::setRelativeFlag( int index, bool value )
{
if( value ) _relativeFlags |= (0x01 << index);
else _relativeFlags &= ~(0x01 << index);
} /// Returns whether manipulator preserves camera's "UP" vector.
inline bool StandardManipulator::getVerticalAxisFixed() const
{
return _verticalAxisFixed;
} /// Returns true if the camera can be thrown, false otherwise. It defaults to true.
inline bool StandardManipulator::getAllowThrow() const
{
return _allowThrow;
} } #endif /* OSGGA_CAMERA_MANIPULATOR */
osgGA::OrbitManipulator
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* OrbitManipulator code Copyright (C) 2010 PCJohn (Jan Peciva)
* while some pieces of code were taken from OSG.
* Thanks to company Cadwork (www.cadwork.ch) and
* Brno University of Technology (www.fit.vutbr.cz) for open-sourcing this work.
*/ #ifndef OSGGA_ORBIT_MANIPULATOR
#define OSGGA_ORBIT_MANIPULATOR 1 #include <osgGA/StandardManipulator> namespace osgGA { /** OrbitManipulator is base class for camera control based on focal center,
distance from the center, and orientation of distance vector to the eye.
This is the base class for trackball style manipulators.*/
class OSGGA_EXPORT OrbitManipulator : public StandardManipulator
{
typedef StandardManipulator inherited; public: OrbitManipulator( int flags = DEFAULT_SETTINGS );
OrbitManipulator( const OrbitManipulator& om,
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); META_Object( osgGA, OrbitManipulator ); virtual void setByMatrix( const osg::Matrixd& matrix );
virtual void setByInverseMatrix( const osg::Matrixd& matrix );
virtual osg::Matrixd getMatrix() const;
virtual osg::Matrixd getInverseMatrix() const; virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation );
virtual void setTransformation( const osg::Vec3d& eye, const osg::Vec3d& center, const osg::Vec3d& up );
virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const;
virtual void getTransformation( osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up ) const; void setHeading( double azimuth );
double getHeading() const;
void setElevation( double elevation );
double getElevation() const; virtual void setCenter( const osg::Vec3d& center );
const osg::Vec3d& getCenter() const;
virtual void setRotation( const osg::Quat& rotation );
const osg::Quat& getRotation() const;
virtual void setDistance( double distance );
double getDistance() const; virtual void setTrackballSize( const double& size );
inline double getTrackballSize() const;
virtual void setWheelZoomFactor( double wheelZoomFactor );
inline double getWheelZoomFactor() const; virtual void setMinimumDistance( const double& minimumDistance, bool relativeToModelSize = false );
double getMinimumDistance( bool *relativeToModelSize = NULL ) const; virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const;
virtual float getFusionDistanceValue() const; protected: virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool performMovementLeftMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementRightMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMouseDeltaMovement( const float dx, const float dy );
virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); virtual void rotateTrackball( const float px0, const float py0,
const float px1, const float py1, const float scale );
virtual void rotateWithFixedVertical( const float dx, const float dy );
virtual void rotateWithFixedVertical( const float dx, const float dy, const osg::Vec3f& up );
virtual void panModel( const float dx, const float dy, const float dz = .f );
virtual void zoomModel( const float dy, bool pushForwardIfNeeded = true );
void trackball( osg::Vec3d& axis, float& angle, float p1x, float p1y, float p2x, float p2y );
float tb_project_to_sphere( float r, float x, float y );
virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); osg::Vec3d _center;
osg::Quat _rotation;
double _distance; double _trackballSize;
double _wheelZoomFactor; double _minimumDistance;
static int _minimumDistanceFlagIndex; class OrbitAnimationData : public AnimationData {
public:
osg::Vec3d _movement;
void start( const osg::Vec3d& movement, const double startTime );
};
virtual void allocAnimationData() { _animationData = new OrbitAnimationData(); }
}; //
// inline functions
// /** Get the size of the trackball relative to the model size. */
inline double OrbitManipulator::getTrackballSize() const { return _trackballSize; }
/** Get the mouse wheel zoom factor.*/
inline double OrbitManipulator::getWheelZoomFactor() const { return _wheelZoomFactor; } } #endif /* OSGGA_ORBIT_MANIPULATOR */
osgGA::TrackballManipulator
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/ #ifndef OSGGA_TRACKBALL_MANIPULATOR
#define OSGGA_TRACKBALL_MANIPULATOR 1 #include <osgGA/OrbitManipulator> namespace osgGA { class OSGGA_EXPORT TrackballManipulator : public OrbitManipulator
{
typedef OrbitManipulator inherited; public: TrackballManipulator( int flags = DEFAULT_SETTINGS );
TrackballManipulator( const TrackballManipulator& tm,
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); META_Object( osgGA, TrackballManipulator ); }; } #endif /* OSGGA_TRACKBALL_MANIPULATOR */
osg MatrixManipulator CameraManipulator的更多相关文章
- [OSG]OpenSceneGraph FAQ 以及OSG资源
1.地球背面的一个点,计算它在屏幕上的坐标,能得到吗? 不是被挡住了吗? 答:计算一个空间点的屏幕坐标,使用osgAPEx::GetScreenPosition函数.当空间点处于相机视空间内(不管它是 ...
- osg设置相机参数,包括初始位置
严重注意!!!以下设置必须在viewer.realize();之后,否则不起作用!!!! 设置相机的位置,可以通过CameraManipulator(一般是osgGA::TrackballManipu ...
- osg中的视点控制
osg中的视点控制 osg的视点控制基类是CameraManipulator, 它是一个虚基类, 有用的方法都跟home有关. 在这个类里面有三个重要的成员变量: osg::Vec3d _homeEy ...
- osg实例介绍
osg实例介绍 转自:http://blog.csdn.net/yungis/article/list/1 [原]osgmotionblur例子 该例子演示了运动模糊的效果.一下内容是转自网上的:原理 ...
- OSG开发概览
1 OSG基础知识 Ø OSG是Open Scene Graphic 的缩写,OSG于1997年诞生于以为滑翔机爱好者之手,Don burns 为了对滑翔机的飞行进行模拟,对openGL的库进行了封 ...
- OSG 实现跟随节点的相机(转)
本章教程将继续使用回调和节点路径(NodePath)来检索节点的世界坐标. 本章目标: 在一个典型的仿真过程中,用户可能需要从场景中的各种车辆和人物里选择一个进行跟随.本章将介绍一种将摄像机“依附 ...
- OSG实现场景漫游(转载)
OSG实现场景漫游 下面的代码将可以实现场景模型的导入,然后在里面任意行走,于此同时还实现了碰撞检测. 源代码下载地址: /* * File : Travel.cpp * Description : ...
- OSG开发概览(转载)
OSG开发概览 1 OSG基础知识 Ø OSG是Open Scene Graphic 的缩写,OSG于1997年诞生于以为滑翔机爱好者之手,Don burns 为了对滑翔机的飞行进行模拟,对open ...
- OSG开源教程(转)
例:geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); 来指定要利用这些数据生成一个怎么样的形状. ...
随机推荐
- zookeeper学习(3)----基本结构和命令行操作命令
一. 数据结构 https://www.jianshu.com/p/8e322462bcca zookeeper存储结构:以树形结构的方式存储数据 ZooKeeper数据模型的结构整体上可以看作是一棵 ...
- C++11新特性之operator "" xxx(const char *, size_t n)
从C++11开始,我们可以使用以下形式通过常量字符串构造自定义类型, 比如: class Person { public: Person(const std::string& name): _ ...
- master-worker常驻型程序代码修改哪些需要重启master或者worker
之前在yii的项目里用redis作为消息队列,现在很多任务需要延迟需求,于是把之前redis的消息队列替换成了rabbitmq 于是使用yii的yii2-queue这个组件 但是由于提供的yii qu ...
- NodeJS开发博客(三) 数据的保存
什么是cookie 存储在浏览器的一段字符串(最大5k) 跨域不共享 格式如 k1=v1 k2=v2 因此可以存储结构化数据 每次发送http请求,会将请求域的cookie一起发送给server se ...
- XAMPP启动Apache服务时启动失败
9:48:49 [Apache] Apache Service detected with wrong path 9:48:49 [Apache] Change XAMPP Apache and Co ...
- linux 防火墙 firewall 设置
背景: 机房断电后导致机器关机重启,原先访问的地址访问不了,使用终端能访问到该服务器,服务启起来后,用curl + 地址能访问,但在外部浏览器访问不了该地址: 首先想到了端口限制----防火墙 参考博 ...
- Java7--try - with - resources
从 Java 7 build 105 版本开始,Java 7 的编译器和运行环境支持新的 try-with-resources 语句,称为 ARM 块(Automatic Resource Manag ...
- Django REST framework+Vue 打造生鲜电商项目(笔记四)
(PS:部分代码和图片来自博客:http://www.cnblogs.com/derek1184405959/p/8813641.html.有增删) 一.用户登录和手机注册 1.drf的token功能 ...
- TG2
1,什么滑动窗口? 2,这人讲的不行还是我的问题.. 3,搞得我都想睡觉了 4,1904,不停扫,输出最高的高度 一个差分的过程,先加上再减去,但是要维护一个最值 什么动态开点(只能用线段树并且内存很 ...
- vue 项目总结 知识点补充
1.页面加载后自动执行函数 2.向后端请求数据方法 2-1 :axios 的安装使用 2-2 在组件中使用 2-3 发送请求 2-4 接收数据后渲染 2-5 后端数据渲染 2-6 解决跨域问题 任务 ...