45#ifndef CGELMassParticleH
46#define CGELMassParticleH
102 m_externalForce = a_force;
146 m_externalForce.
zero();
157 glVertex3dv( (
const double *)&
m_pos);
161 glColor4fv( (
const float *)&
m_color);
164 glVertex3dv( (
const double *)&
m_pos);
165 glVertex3dv( (
const double *)&v);
This class implements a simple mass particle point.
Definition CGELMassParticle.h:70
chai3d::cVector3d m_vel
Instant velocity.
Definition CGELMassParticle.h:188
void clearForces()
This method clears all forces.
Definition CGELMassParticle.h:131
bool m_fixed
If true, then mass is fixed in space and cannot move.
Definition CGELMassParticle.h:194
chai3d::cVector3d m_force
Current force being applied.
Definition CGELMassParticle.h:182
chai3d::cVector3d m_nextPos
Next computed position of particle.
Definition CGELMassParticle.h:223
virtual ~cGELMassParticle()
Destructor of cGELMassParticle.
Definition CGELMassParticle.cpp:96
void clearExternalForces()
This method clears all external forces.
Definition CGELMassParticle.h:144
static bool s_show_forces
Default property - force display status.
Definition CGELMassParticle.h:258
static double s_default_mass
Default property - mass.
Definition CGELMassParticle.h:246
chai3d::cColorf m_color
Color used to display nodes.
Definition CGELMassParticle.h:210
void render()
This method renders this node in OpenGL.
Definition CGELMassParticle.h:150
void addForce(chai3d::cVector3d &a_force)
This method adds a force to this mass particle.
Definition CGELMassParticle.h:94
void setExternalForce(chai3d::cVector3d &a_force)
This method assigns an external force to this mass particle.
Definition CGELMassParticle.h:100
chai3d::cVector3d m_acc
Instant acceleration.
Definition CGELMassParticle.h:185
void applyNextPose()
This method updates the position with its latest computed values.
Definition CGELMassParticle.h:125
static bool s_default_useGravity
Default property - use of gravity field.
Definition CGELMassParticle.h:252
void computeNextPose(double a_timeInterval)
This method updates the simulation over a specified time interval.
Definition CGELMassParticle.h:106
double m_kDampingPos
Linear damping.
Definition CGELMassParticle.h:191
void setMass(double a_mass)
This method assigns the mass of this particle.
Definition CGELMassParticle.cpp:108
double m_mass
Mass property.
Definition CGELMassParticle.h:179
static chai3d::cColorf s_default_color
Default property - color.
Definition CGELMassParticle.h:249
static bool s_scale_force_vector_display
Default property - force vector display magnitude.
Definition CGELMassParticle.h:261
chai3d::cVector3d m_pos
Position of particle.
Definition CGELMassParticle.h:220
chai3d::cVector3d m_gravity
Gravity field.
Definition CGELMassParticle.h:200
bool m_useGravity
If true, then gravity field is taken into account.
Definition CGELMassParticle.h:197
cGELMassParticle()
Constructor of cGELMassParticle.
Definition CGELMassParticle.cpp:75
static chai3d::cVector3d s_default_gravity
Default property - gravity field.
Definition CGELMassParticle.h:255
static double s_default_kDampingPos
Default property - linear damping.
Definition CGELMassParticle.h:243
void mulr(const double &a_scalar, cVector3d &a_result) const
void add(const cVector3d &a_vector)