45 #ifndef ACG_SKELETONNODET_HH 46 #define ACG_SKELETONNODET_HH 51 #include <ACG/Scenegraph/MaterialNode.hh> 52 #include <ACG/Scenegraph/DrawModes.hh> 53 #include <ACG/GL/GLPrimitives.hh> 54 #include <ACG/GL/globjects.hh> 76 template <
class SkeletonType>
83 typedef typename SkeletonType::Point Point;
85 typedef typename SkeletonType::Pose Pose;
86 typedef typename SkeletonType::Matrix Matrix;
120 bool coordFramesVisible();
193 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_SKELETONNODET_C) 194 #define ACG_SKELETONNODET_TEMPLATES 195 #include "SkeletonNodeT_impl.hh" 198 #endif // ACG_SKELETONNODET_HH defined SkeletonType & skeleton()
Returns a pointer to the skeleton.
void setActivePose(const AnimationHandle &_hAni)
Set the pose which should be rendered.
void pick(GLState &_state, PickTarget _target) override
Renders the node in picking mode, restricted to the node components given by _target.
Namespace providing different geometric functions concerning angles.
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode) override
Renders the nodes contents using the given render state and draw mode.
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat) override
Adds renderobjects to renderer for flexible shader pipeline.
Class to define the vertex input layout.
void showCoordFrames(bool _bVisible=true)
Toggle visibility of coordinate frames for all joints.
double fFrameSize_
size for the coord-frame
void getJointColor(const Vec4f &_baseColor, Vec4f &_result)
get a joint color suitable to the baseColor
PickTarget
What target to use for picking.
GeometryBuffer boneInstanceData_
per instance data of bones
AnimationHandle hAni_
The active pose, this one is going to be rendered.
Represents a single joint in the skeleton.
SkeletonNodeT(SkeletonType &_skeleton, BaseNode *_parent=0, std::string _name="<SkeletonNode>")
Constructor.
bool bCoordFramesVisible_
Coordinate frames are visible if this is true, not visible if false.
double frameSize()
returns the size of the rendered coordinate system
void pick_vertices(GLState &_state)
Pick method for vertices.
void addBoneToRenderer(IRenderer *_renderer, RenderObject &_base, const Point &_parent, const Point &_axis)
Helper function to create a renderobject for bones.
DrawModes::DrawMode availableDrawModes() const override
Returns available draw modes.
AnimationHandle activePose()
Get the pose that is used for rendering.
void draw_bone(GLState &_state, DrawModes::DrawMode _drawMode, const Point &_parent, const Point &_axis)
Helper function to draw the bones.
void HSVtoRGB(const Vec4f &_HSV, Vec4f &_RGB)
Convert HSV color to RGB.
void NormalizeCoordinateFrame(Matrix &_mat)
Normalizes a coordinate frame defined by the given matrix.
void pick_edges(GLState &_state)
Pick method for edges.
void computeConeMatrices(const GLMatrixf &_modelView, const Point &_parent, const Point &_axis, GLMatrixf *_outCone0, GLMatrixf *_outCone1)
Helper function to compute modelview matrices for the two cones composing a bone. ...
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax) override
Returns the bounding box of this node.
~SkeletonNodeT()
Destructor.
double unprojectPointSize(double _pointSize, const Vec3d &_point, GLState &_state)
Simulate glPointSize(12) with a sphere.
SkeletonType & skeleton_
The skeleton nodes skeleton.
void RGBtoHSV(const Vec4f &_RGB, Vec4f &_HSV)
Convert RGB color to HSV.
Interface class between scenegraph and renderer.
A handle used to refer to an animation or to a specific frame in an animation.
GeometryBuffer pointInstanceData_
per instance data of joint spheres