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)); 来指定要利用这些数据生成一个怎么样的形状. ...
随机推荐
- Mongodb创建用户Error: couldn’t add user: Use of SCRAM-SHA-256 requires undigested passwords
解决方案:修改mechanisms加密方式为SCRAM-SHA-1 db.createUser({ user: "admin", pwd: "xxx", rol ...
- WebClient 与HttpClient 的区别
需要搜索下资料. -------------------------------------------------- 微软文档介绍,新的开发中推荐使用:HttpClient WebClient 文档 ...
- 13. 请看TED 的演讲, 谈谈你对压力的看法,以及怎么和别人合作, 帮助别人,把压力转化为动力,在互相帮助的环境中成长。------------答题者:徐潇瑞
看了ted的演讲,我觉得压力就像一根弹簧,有多大的压力,它就有多大的弹力:现实中只要你学会用一种永远不服输的顽强精神,去对待人生和社会中遇到的一切困难与挫折,宠辱不惊的看云卷云舒,悟潮起潮落.可是存在 ...
- JS与小程序页面生命周期
Page({ /** * 页面的初始数据 */ data: { }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周 ...
- 如何在linux系统下查看日志
在linux系统下, 首先在idea中使用clean---->install----->package将这个项目进行打包,打包的方式 , 根据你在项目中的pom文件,最上面,可以查看到 这 ...
- c语言数组越界的避免方法
1.尽量显式地指定数组的边界 #define MAX 10 - int a[MAX]={1,2,3,4,5,6,7,8,9,10}; 在 C99 标准中,还允许我们使用单个指示符为数组的两段" ...
- python func(*args, **kwargs)
func(*args, **kwargs) *args, **kwargs表示函数的可变参数 *args 表示任何多个无名参数,它是一个tuple **kwargs 表示关键字参数,它是一个dict ...
- C#经纬度加减运算(度°分′秒″格式)
经度是分和秒是按60进位,如果要做运算第一步就是转换成浮点数,之后就是计算和还原. using System.Text.RegularExpressions; public static double ...
- javascript权威指南第15章 使用Canvas绘图
HTML <!DOCTYPE html> <html> <head> <title>canvas</title> </head> ...
- 005_Python3 运算符
什么是运算符? 本章节主要说明Python的运算符.举个简单的例子 4 +5 = 9 . 例子中,4 和 5 被称为操作数,"+" 称为运算符. Python语言支持以下类型的运算 ...