20 #include <osgText/Text> 21 #include <osg/Geometry> 22 #include <osgViewer/Viewer> 38 void setPosition(
const agx::Vec2& position );
47 virtual void uninitialize( osg::Group* sceneData ) = 0;
48 virtual bool isValid()
const = 0;
49 virtual void update() = 0;
50 virtual bool match(
const void* obj )
const = 0;
80 PickHandler( osgViewer::Viewer *viewer, osg::Group *scene=
nullptr);
87 void setActivateModKeyMask(
unsigned int modKey );
90 void setActivateMouseButton(
unsigned int mouse);
93 unsigned int getActivateModKeyMask()
const;
96 unsigned int getActivateMouseButton()
const;
106 const osg::Camera *getCamera()
const;
108 virtual bool keyboard(
int key,
unsigned int modKeyMask,
float x,
float y,
bool keydown);
116 virtual bool mouseDragged(
MouseButtonMask buttonMask,
float x,
float y);
117 virtual void update(
float x,
float y);
126 unsigned int m_modKeyMask;
128 osg::Matrix m_cameraMatrix;
129 osg::observer_ptr< osgViewer::Viewer > m_viewer;
130 osg::observer_ptr< osg::Group > m_scene;
131 osg::observer_ptr< osg::Camera > m_camera;
133 unsigned int m_activateModKeyMask;
134 unsigned int m_activateMouseKey;
141 void createMouseSpringRendering(
float scale);
143 void updateRenderState();
144 void setCamera(osg::Camera *camera);
150 void updateClickedGeometry(
MouseState state,
float x,
float y);
154 void startPick(
float x,
float y);
155 void updatePanels(
float x,
float y);
159 void traverseParticles();
163 bool mouseDownLeftButton(
float x,
float y);
164 bool mouseDownMiddleButton(
float x,
float y);
165 bool mouseDownRightButton(
float x,
float y);
175 bool m_moveUnphysically;
186 osg::PositionAttitudeTransform *m_mouseAttachTransform;
187 osg::PositionAttitudeTransform *m_mousePositionTransform;
188 osg::Geometry *m_mouseSpringLine;
189 osg::observer_ptr< osg::Switch > m_mouseMarkerSwitch;
190 PanelContainer m_panels;
192 osg::observer_ptr< osg::Switch > m_sphereSwitch;
194 float m_mousePickingGraphicsScale;
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
osg::ref_ptr< Panel > PanelRef
osg::ref_ptr< osg::DrawElementsUInt > m_indices
osg::ref_ptr< osg::Vec3Array > m_normals
A class holding 4 dimensional vectors and providing basic arithmetic.
#define AGX_DECLARE_POINTER_TYPES(type)
agxSDK::PickResult intersect(const agx::Vec3 &start, const agx::Vec3 &end, bool onlyDynamics)
Shoot a ray from start to end into the space and calculate the closest geometry.
void setSimulation(agxSDK::Simulation *simulation)
osg::ref_ptr< osg::Vec3Array > m_vertices
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
const agx::Vec2 & getSize() const
AGXOSG_EXPORT void getNearFarPoints(const osg::Camera *camera, float x, float y, agx::Vec3 &near, agx::Vec3 &far)
Get the near and far points of the current window, given a camera and x and y position.
const agx::Vec2 & getPosition() const
agx::Vector< PanelRef > PanelContainer
osg::ref_ptr< osg::Vec4Array > m_color
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
AGXBRICK_EXPORT bool isInitialized()
osg::ref_ptr< osg::Geometry > m_geometry
void setSimulation(Simulation *simulation)
Set the associated simulation for this EventListener.