17 #ifndef AGX_POINTGRAVITYFIELD_H 18 #define AGX_POINTGRAVITYFIELD_H 44 void setGravity(
const Real gravityMagnitude );
47 void setCenter(
const Vec3& center );
50 Real getGravity( )
const;
61 virtual Vec3 calculateGravity(
const Vec3& position )
const override;
65 virtual Task* createRigidBodyTask()
override;
68 virtual Task* createParticleSystemTask()
override;
84 Vec3 pos = m_center->get() - position;
87 return pos * m_gravity->get();
92 return m_gravity->get();
97 return m_center->get();
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
#define AGXPHYSICS_EXPORT
const Real GRAVITY_ACCELERATION
#define AGX_DECLARE_POINTER_TYPES(type)
A representation of a generic task.
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
virtual Vec3 calculateGravity(const Vec3 &position) const override
Given position, a gravity acceleration will be calculated and returned.
Real normalize()
Normalize the vector so that it has length unity.
A class holding 3 dimensional vectors and providing basic arithmetic.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
The class PointGravityField calculates a gravity which is uniform in magnitude over the entire space ...