 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
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();
The class PointGravityField calculates a gravity which is uniform in magnitude over the entire space ...
virtual Vec3 calculateGravity(const Vec3 &position) const override
Given position, a gravity acceleration will be calculated and returned.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXPHYSICS_EXPORT
A representation of a generic task.
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
const Real GRAVITY_ACCELERATION
#define AGX_DECLARE_POINTER_TYPES(type)
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
Real normalize()
Normalize the vector so that it has length unity.