45#ifndef CGELSkeletonNodeH
46#define CGELSkeletonNodeH
108 m_externalForce = a_force;
114 m_externalTorque = a_torque;
143 if (normAngVel < 0.000001)
179 m_externalForce.
zero();
180 m_externalTorque.
zero();
192 glMultMatrixd( (
const double *)mat.
getData() );
209 glColor4fv( (
const float *)&
m_color);
212 glVertex3dv( (
const double *)&
m_pos);
213 glVertex3dv( (
const double *)&v);
This class implements a mass node with mass and inertia properties.
Definition CGELSkeletonNode.h:70
static double s_default_kDampingRot
Default value for revolute damping.
Definition CGELSkeletonNode.h:324
void clearExternalForces()
This method clears the external forces and torques.
Definition CGELSkeletonNode.h:177
void addTorque(chai3d::cVector3d &a_torque)
This method adds a torque to the node.
Definition CGELSkeletonNode.h:100
bool m_useGravity
If true, then gravity is enabled.
Definition CGELSkeletonNode.h:273
chai3d::cMatrix3d m_nextRot
Next rotation computed.
Definition CGELSkeletonNode.h:295
static bool s_default_showFrame
Default value - Is the node reference frame displayed?
Definition CGELSkeletonNode.h:336
double m_kDampingPos
Linear damping.
Definition CGELSkeletonNode.h:261
chai3d::cColorf m_color
Color used to display nodes.
Definition CGELSkeletonNode.h:227
chai3d::cVector3d m_nextPos
Next position computed.
Definition CGELSkeletonNode.h:292
static bool s_default_useGravity
Default value - Is gravity field enabled?
Definition CGELSkeletonNode.h:330
bool m_fixed
If true, then mass is fixed in space and can not move.
Definition CGELSkeletonNode.h:270
chai3d::cMatrix3d m_rot
Rotation computed.
Definition CGELSkeletonNode.h:289
double m_mass
Mass property.
Definition CGELSkeletonNode.h:240
chai3d::cVector3d m_angAcc
Instant angular acceleration at node.
Definition CGELSkeletonNode.h:252
~cGELSkeletonNode()
Destructor of cGELSkeletonNode.
Definition CGELSkeletonNode.cpp:101
void applyNextPose()
This method updates the position and orientation of this node with the latest computed values.
Definition CGELSkeletonNode.h:155
void setExternalForce(chai3d::cVector3d &a_force)
This method sets an external force to the node.
Definition CGELSkeletonNode.h:106
chai3d::cVector3d m_pos
Position computed.
Definition CGELSkeletonNode.h:286
cGELSkeletonNode()
Constructor of cGELSkeletonNode.
Definition CGELSkeletonNode.cpp:74
double m_kDampingRot
Angular damping.
Definition CGELSkeletonNode.h:264
static double s_default_mass
Default value for node mass.
Definition CGELSkeletonNode.h:327
static chai3d::cVector3d s_default_gravity
Default value - Gravity field magnitude and direction.
Definition CGELSkeletonNode.h:333
void setMass(double a_mass)
This method sets the mass of the node.
Definition CGELSkeletonNode.cpp:114
chai3d::cVector3d m_gravity
Gravity field.
Definition CGELSkeletonNode.h:276
chai3d::cVector3d m_angVel
Instant angular velocity at node.
Definition CGELSkeletonNode.h:258
double m_radius
Radius of mass node.
Definition CGELSkeletonNode.h:237
void computeNextPose(double a_timeInterval)
This method update the position of the node over a time interval.
Definition CGELSkeletonNode.h:118
static chai3d::cColorf s_default_color
Default color used to render the node.
Definition CGELSkeletonNode.h:339
static double s_default_radius
Default value for node radius.
Definition CGELSkeletonNode.h:318
void addForce(chai3d::cVector3d &a_force)
This method adds a force to the node.
Definition CGELSkeletonNode.h:94
chai3d::cVector3d m_vel
Instant velocity at node.
Definition CGELSkeletonNode.h:255
double m_inertia
Inertia (to be completed).
Definition CGELSkeletonNode.h:267
void setExternalTorque(chai3d::cVector3d &a_torque)
This method sets an external torque to the node.
Definition CGELSkeletonNode.h:112
void clearForces()
This method clears the current forces and torques.
Definition CGELSkeletonNode.h:162
void render()
This method renders this node in OpenGL.
Definition CGELSkeletonNode.h:184
chai3d::cVector3d m_torque
Current torque applies on node.
Definition CGELSkeletonNode.h:246
chai3d::cVector3d m_acc
Instant acceleration at node.
Definition CGELSkeletonNode.h:249
static double s_default_kDampingPos
Default value for linear damping.
Definition CGELSkeletonNode.h:321
chai3d::cVector3d m_force
Current force applied on node.
Definition CGELSkeletonNode.h:243
void cDrawFrame(const double &a_scale=1.0)
void cDrawSphere(const double &a_radius, const unsigned int a_numSlices=10, const unsigned int a_numStacks=10)
bool rotateAboutGlobalAxisRad(const cVector3d &a_axis, const double &a_angleRad)
void mulr(const double &a_scalar, cVector3d &a_result) const
void add(const cVector3d &a_vector)
void mul(const double &a_scalar)