1 #ifndef OBJECT_MOVEMENT_H
2 #define OBJECT_MOVEMENT_H
10 #include <osg/ShapeDrawable>
13 using namespace vrecko;
15 namespace APEditorQAbilities {
22 virtual bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode *parameters = NULL);
24 virtual void update(
void);
27 virtual CAINFO* createInfo();
28 virtual void fillDefaultInfo();
33 virtual bool activate();
34 virtual void deactivate();
48 SnapBox() : color(0.0f, 1.0f, 0.0f, 0.4f) { owner = NULL; };
53 void updateShape(
const osg::Vec3 ¢er,
const osg::Vec3 &halfLengths,
const osg::Matrix &transform);
76 bool objectTransformationFromPointer(
EnvironmentObject *eo, osg::Matrix *outTrans);
142 bool addSnappingPlane(
143 unsigned long objectID,
unsigned long objectSide,
144 osg::Vec3 ¢er, osg::Vec3 &normal,
145 osg::Vec3 &halfVec1, osg::Vec3 &halfVec2, osg::Vec3 shiftVec,
float shiftLen2, osg::Vec3 &snapPoint,
146 float halfRect1SnapMul,
float halfRect2SnapMul,
147 float fMinU,
float fMaxU,
float fMinV,
float fMaxV,
149 bool isPlaneCompatibleWithSelectedSet(
int iPlaneIndex);
153 bool calcFinalShiftFromSelectedSet(osg::Vec3 &outShift,
int additionalPlane = -1);
157 bool intersect2Planes(osg::Vec3 &p1p, osg::Vec3 &p1normal, osg::Vec3 &p2p, osg::Vec3 &p2normal,
158 osg::Vec3 &outLineStart, osg::Vec3 &outLineDir);
164 bool intersectLinePlane(osg::Vec3 &lineStart, osg::Vec3 &lineDir, osg::Vec3 &planePoint,
165 osg::Vec3 &planeNormal, osg::Vec3 &outPoint);
168 bool projectPointOnPlaneUV(osg::Vec3 &point, osg::Vec3 &planePoint, osg::Vec3 &planeNormal,
169 osg::Vec3 &halfVec1, osg::Vec3 &halfVec2, osg::Vec3 *outProjectedPoint,
170 float *outDist,
float *outU,
float *outV);