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