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