45 #ifndef CGELMassParticleH 46 #define CGELMassParticleH 102 m_externalForce = a_force;
146 m_externalForce.
zero();
155 glVertex3dv( (
const double *)&
m_pos);
159 glColor4fv( (
const float *)&
m_color);
162 glVertex3dv( (
const double *)&
m_pos);
163 glVertex3dv( (
const double *)&v);
double m_kDampingPos
Linear damping.
Definition: CGELMassParticle.h:187
chai3d::cVector3d m_vel
Instant velocity.
Definition: CGELMassParticle.h:184
chai3d::cVector3d m_gravity
Gravity field.
Definition: CGELMassParticle.h:196
void addForce(chai3d::cVector3d &a_force)
This method adds a force to this mass particle.
Definition: CGELMassParticle.h:94
cGELMassParticle()
Constructor of cGELMassParticle.
Definition: CGELMassParticle.cpp:75
cVector3d cAdd(const cVector3d &a_vector1, const cVector3d &a_vector2)
static double s_default_kDampingPos
Default property - linear damping.
Definition: CGELMassParticle.h:239
chai3d::cColorf m_color
Color used to display nodes.
Definition: CGELMassParticle.h:206
static chai3d::cVector3d s_default_gravity
Default property - gravity field.
Definition: CGELMassParticle.h:251
static bool s_scale_force_vector_display
Default property - force vector display magnitude.
Definition: CGELMassParticle.h:257
chai3d::cVector3d m_pos
Position of particle.
Definition: CGELMassParticle.h:216
virtual ~cGELMassParticle()
Destructor of cGELMassParticle.
Definition: CGELMassParticle.cpp:96
void mulr(const double &a_scalar, cVector3d &a_result) const
void applyNextPose()
This method updates the position with its latest computed values.
Definition: CGELMassParticle.h:125
cVector3d cDiv(const double &a_value, const cVector3d &a_vector)
bool m_useGravity
If true, then gravity field is taken into account.
Definition: CGELMassParticle.h:193
void clearForces()
This method clears all forces.
Definition: CGELMassParticle.h:131
cVector3d cMul(const double &a_value, const cVector3d &a_vector)
bool m_fixed
If true, then mass is fixed in space and cannot move.
Definition: CGELMassParticle.h:190
void clearExternalForces()
This method clears all external forces.
Definition: CGELMassParticle.h:144
static double s_default_mass
Default property - mass.
Definition: CGELMassParticle.h:242
chai3d::cVector3d m_force
Current force being applied.
Definition: CGELMassParticle.h:178
static bool s_show_forces
Default property - force display status.
Definition: CGELMassParticle.h:254
double m_mass
Mass property.
Definition: CGELMassParticle.h:175
chai3d::cVector3d m_nextPos
Next computed position of particle.
Definition: CGELMassParticle.h:219
void render()
This method renders this node in OpenGL.
Definition: CGELMassParticle.h:150
static chai3d::cColorf s_default_color
Default property - color.
Definition: CGELMassParticle.h:245
This class implements a simple mass particle point.
Definition: CGELMassParticle.h:69
void setExternalForce(chai3d::cVector3d &a_force)
This method assigns an external force to this mass particle.
Definition: CGELMassParticle.h:100
void setMass(double a_mass)
This method assigns the mass of this particle.
Definition: CGELMassParticle.cpp:108
void add(const cVector3d &a_vector)
static bool s_default_useGravity
Default property - use of gravity field.
Definition: CGELMassParticle.h:248
chai3d::cVector3d m_acc
Instant acceleration.
Definition: CGELMassParticle.h:181
void computeNextPose(double a_timeInterval)
This method updates the simulation over a specified time interval.
Definition: CGELMassParticle.h:106