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