4 #include "OsgGeometry.h"
14 AnimatBase *m_lpThisAB;
15 MovableItem *m_lpThisMI;
19 osg::Matrix m_osgWorldMatrix;
21 osg::ref_ptr<osg::Group> m_osgParent;
22 osg::ref_ptr<osgManipulator::Selection> m_osgMT;
23 osg::ref_ptr<osg::Geometry> m_osgGeometry;
24 osg::ref_ptr<osg::Group> m_osgRoot;
25 osg::ref_ptr<osg::Node> m_osgNode;
26 osg::ref_ptr<osg::Group> m_osgNodeGroup;
28 osg::ref_ptr<osg::CullFace> m_osgCull;
29 osg::ref_ptr<osg::Texture2D> m_osgTexture;
31 osg::ref_ptr<osg::StateSet> m_osgStateSet;
32 osg::ref_ptr<osg::Material> m_osgMaterial;
34 osg::ref_ptr<osg::Group> m_osgSelectedGroup;
35 osg::ref_ptr<VsDragger> m_osgDragger;
37 osg::Matrix m_osgLocalMatrix;
50 osg::Matrix m_osgFinalMatrix;
51 bool m_bCullBackfaces;
52 osg::StateAttribute::GLMode m_eTextureMode;
54 osg::ref_ptr<osg::MatrixTransform> m_osgSelVertexMT;
55 osg::ref_ptr<osg::Geode> m_osgSelVertexNode;
57 virtual void SetThisPointers();
58 virtual void LocalMatrix(osg::Matrix osgLocalMT);
59 virtual void GeometryRotationMatrix(osg::Matrix osgGeometryMT);
61 virtual void SetupGraphics();
62 virtual void SetupPhysics() = 0;
63 virtual void DeleteGraphics();
64 virtual void DeletePhysics() = 0;
65 virtual void CreateSelectedGraphics(std::string strName);
66 virtual void CreateDragger(std::string strName);
67 virtual void CreateSelectedVertex(std::string strName);
68 virtual void DeleteSelectedVertex();
69 virtual void AttachedPartMovedOrRotated(std::string strID);
70 virtual void UpdatePositionAndRotationFromMatrix();
71 virtual void UpdatePositionAndRotationFromMatrix(osg::Matrix osgMT);
73 virtual void CreateGraphicsGeometry();
74 virtual void CreatePhysicsGeometry();
75 virtual void CreateGeometry();
76 virtual void ResizePhysicsGeometry();
78 virtual void UpdateWorldMatrix();
80 virtual void ShowSelectedVertex();
81 virtual void HideSelectedVertex();
89 virtual osg::Group *ParentOSG() = 0;
90 virtual osg::Group *RootGroup() {
return m_osgRoot.get();};
91 virtual osg::Group *NodeGroup() {
return m_osgNodeGroup.get();};
92 virtual osg::Matrix LocalMatrix() {
return m_osgLocalMatrix;};
93 virtual osg::Matrix FinalMatrix() {
return m_osgFinalMatrix;};
95 virtual void Physics_SetParent(MovableItem *lpParent)
97 m_lpParentVsMI =
dynamic_cast<VsMovableItem *
>(lpParent);
99 virtual void Physics_SetChild(MovableItem *lpParent) {};
103 virtual CStdFPoint GetOSGWorldCoords();
104 virtual osg::Matrix GetOSGWorldMatrix(
bool bUpdate =
false);
107 virtual void EndGripDrag();
109 virtual std::string Physics_ID();
110 virtual void Physics_UpdateMatrix();
111 virtual void Physics_ResetGraphicsAndPhysics();
112 virtual void Physics_PositionChanged();
113 virtual void Physics_RotationChanged();
114 virtual void Physics_UpdateAbsolutePosition();
115 virtual void Physics_Selected(
bool bValue,
bool bSelectMultiple);
116 virtual float Physics_GetBoundingRadius();
117 virtual BoundingBox Physics_GetBoundingBox();
118 virtual void Physics_SetColor() {};
119 virtual void Physics_TextureChanged() {};
120 virtual void Physics_CollectData();
121 virtual void Physics_CollectExtraData() {};
122 virtual void Physics_ResetSimulation();
123 virtual void Physics_AfterResetSimulation() {};
124 virtual float *Physics_GetDataPointer(
const std::string &strDataType);
125 virtual void Physics_OrientNewPart(
float fltXPos,
float fltYPos,
float fltZPos,
float fltXNorm,
float fltYNorm,
float fltZNorm);
126 virtual void Physics_SelectedVertex(
float fltXPos,
float fltYPos,
float fltZPos) {};
127 virtual bool Physics_CalculateLocalPosForWorldPos(
float fltWorldX,
float fltWorldY,
float fltWorldZ, CStdFPoint &vLocalPos);
128 virtual void Physics_LoadLocalTransformMatrix(CStdXml &oXml);
129 virtual void Physics_SaveLocalTransformMatrix(CStdXml &oXml);
130 virtual std::string Physics_GetLocalTransformMatrixString();
131 virtual void Physics_ResizeDragHandler(
float fltRadius);
133 virtual void SetTexture(std::string strTexture);
134 virtual void SetCulling();
135 virtual void SetColor(CStdColor &vAmbient, CStdColor &vDiffuse, CStdColor &vSpecular,
float fltShininess);
136 virtual void SetAlpha();
137 virtual void SetMaterialAlpha(osg::Material *osgMat, osg::StateSet *ss,
float fltAlpha);
138 virtual void SetVisible(
bool bVisible);
139 virtual void SetVisible(osg::Node *osgNode,
bool bVisible);
143 virtual void CreateItem();
145 virtual osg::Matrix GetWorldMatrix();
146 virtual osg::Matrix GetParentWorldMatrix();
148 virtual osg::MatrixTransform* GetMatrixTransform();
149 virtual osg::MatrixTransform* GetCameraMatrixTransform();
151 virtual void BuildLocalMatrix();
152 virtual void BuildLocalMatrix(CStdFPoint localPos, CStdFPoint localRot, std::string strName);
153 virtual void WorldToBodyCoords(VxReal3 vWorldPos, StdVector3 &vLocalPos);
float m_fltNullReport
This is used to report back 0 from GetDataPointer for items that are not supported in vortex...
osg::ref_ptr< osg::MatrixTransform > m_osgGeometryRotationMT
Classes for implementing the cm-labs vortex physics engine for AnimatLab.