1#ifndef _CO_VR_3D_ROT_GIZMO
2#define _CO_VR_3D_ROT_GIZMO
19 bool _rotateXonly{
false}, _rotateYonly{
false}, _rotateZonly{
false};
20 bool _wristRotation{
false};
21 const float _radius{3};
22 osg::Vec3 _startPointOnCircle;
24 enum class RotationAxis { Z = 0, X, Y };
26 osg::ref_ptr<osg::MatrixTransform> _axisTransform;
27 osg::ref_ptr<osg::Geode> _sphereGeode;
28 osg::ref_ptr<osg::Group> _xRotCylGroup;
29 osg::ref_ptr<osg::Group> _zRotCylGroup;
30 osg::ref_ptr<osg::Group> _yRotCylGroup;
35 osg::Group* circlesFromCylinders( RotationAxis axis,
int approx, osg::Vec4 color,
float cylinderLength );
37 osg::Vec3Array* circleVerts(RotationAxis axis,
int approx);
41 osg::Matrix calcRotation2D(
const osg::Vec3& lp0_o,
const osg::Vec3& lp1_o, osg::Vec3 rotationAxis);
43 osg::Matrix calcRotation3D(osg::Vec3 rotationAxis);
44 void snapTo45(
float& angle)
const;
48 bool rotateAroundSpecificAxis(osg::Group *group)
const;
50 bool useWristRotation()
const;
55 float closestDistanceLineCircle(
const osg::Vec3& lp0,
const osg::Vec3& lp1,osg::Vec3 rotationAxis, osg::Vec3& pointOnCircle)
const;
58 double vecAngle360(
const osg::Vec3 vec1,
const osg::Vec3 &vec2,
const osg::Vec3& refVec);
65 coVR3DRotGizmo(osg::Matrix m,
float s, coInteraction::InteractionType type,
const char *iconName,
const char *interactorName, coInteraction::InteractionPriority priority,
coVR3DGizmo* gizmoPointer =
nullptr);
Definition: ARToolKit.h:33
Definition: coVR3DGizmo.h:20
Definition: coVR3DGizmoType.h:22
Definition: coVR3DRotGizmo.h:17
void createGeometry() override
virtual void doInteraction() override
virtual ~coVR3DRotGizmo()
coVR3DRotGizmo(osg::Matrix m, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority, coVR3DGizmo *gizmoPointer=nullptr)
virtual void stopInteraction() override
virtual void startInteraction() override