|
Momentum Scripting v1
|
#include <GranularBody.h>
Public Types | |
| enum | MotionControl { KINEMATICS = 2 , DYNAMICS = 3 } |
Public Member Functions | |
| GranularBody () | |
| GranularBody (agx::Physics::GranularBodyPtr) | |
| void | addForce (const Vec3 &force) |
| void | addForce (double fx, double fy, double fz) |
| void | addTorque (const Vec3 &torque) |
| void | addTorque (double tx, double ty, double tz) |
| void | destroy () |
| Vec3 | getAngularVelocity () const |
| Vec4 | getColor () const |
| Vec3 | getForce () const |
| unsigned int | getId () const |
| double | getMass () const |
| Material * | getMaterial () const |
| GranularBody::MotionControl | getMotionControl () const |
| Vec3 | getPosition () const |
| double | getRadius () const |
| Quat | getRotation () const |
| Vec3 | getVelocity () const |
| bool | is (agx::Physics::GranularBodyPtr granularBody) const |
| bool | isValid () const |
| bool | operator== (const GranularBody &other) const |
| agx::Physics::GranularBodyPtr | ptr () const |
| void | setAngularVelocity (const Vec3 &angularVelocity) |
| void | setAngularVelocity (double ax, double ay, double az) |
| void | setColor (const Vec4 &color) |
| void | setForce (const Vec3 &force) |
| void | setForce (double fx, double fy, double fz) |
| void | setLinearVelocity (const Vec3 &velocity) |
| void | setLinearVelocity (double vx, double vy, double vz) |
| void | setMass (double mass) |
| void | setMaterial (const Material *material) |
| void | setMotionControl (GranularBody::MotionControl motionControl) |
| void | setPosition (const Vec3 &position) |
| void | setPosition (double x, double y, double z) |
| void | setRadius (double radius) |
| void | setRotation (const EulerAngles &e) |
| void | setRotation (const Quat &q) |
| void | setTorque (const Vec3 &torque) |
| void | setTorque (double tx, double ty, double tz) |
| void | setVelocity (const Vec3 &velocity) |
| void | setVelocity (double vx, double vy, double vz) |
A GranularBody class, representing a 6DOF spherical object that interacts with the environment trough hertzian contacts with coulomb friction and rolling resistance.
There are two forms of motion allowed : -KINEMATICS means that motion is scripted; -DYNAMICS means that motion results from forces;.
| MOMENTUM_NAMESPACE::GranularBody::GranularBody | ( | agx::Physics::GranularBodyPtr | ) |
Create a wrapper around an agx::Physics::GranularBodyPtr.
| MOMENTUM_NAMESPACE::GranularBody::GranularBody | ( | ) |
Null-constructor.
| void MOMENTUM_NAMESPACE::GranularBody::addForce | ( | const Vec3 & | force | ) |
Adds the force, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
| force | - the force, given in world coordinate frame, |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::addForce | ( | double | fx, |
| double | fy, | ||
| double | fz | ||
| ) |
Adds the force, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
| fx,fy,fz | - the force, given in world coordinate frame, |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::addTorque | ( | const Vec3 & | torque | ) |
Adds the torque, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
| torque | - the torque, given in world coordinate frame |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::addTorque | ( | double | tx, |
| double | ty, | ||
| double | tz | ||
| ) |
Adds the torque, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
| tx,ty,tz | - the torque, given in world coordinate frame |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::destroy | ( | ) |
Tag the GranularBody for destruction at the end of the timestep.
Will make the GranularBody non-valid.
Only available in simulation mode.
| Vec3 MOMENTUM_NAMESPACE::GranularBody::getAngularVelocity | ( | ) | const |
Returns the current world angular velocity of the GranularBody.
| Vec4 MOMENTUM_NAMESPACE::GranularBody::getColor | ( | ) | const |
Get the color that will be used during rendering of the GranularBody.
| Vec3 MOMENTUM_NAMESPACE::GranularBody::getForce | ( | ) | const |
Gets the current active force on the GranularBody that will be active during the next simulation step.
| unsigned int MOMENTUM_NAMESPACE::GranularBody::getId | ( | ) | const |
Gets the unique identifier id for the GranularBody.
| double MOMENTUM_NAMESPACE::GranularBody::getMass | ( | ) | const |
Gets the mass of the GranularBody.
| Material * MOMENTUM_NAMESPACE::GranularBody::getMaterial | ( | ) | const |
Gets the active material on the GranularBody.
| GranularBody::MotionControl MOMENTUM_NAMESPACE::GranularBody::getMotionControl | ( | ) | const |
| Vec3 MOMENTUM_NAMESPACE::GranularBody::getPosition | ( | ) | const |
Returns the current world position of the GranularBody.
| double MOMENTUM_NAMESPACE::GranularBody::getRadius | ( | ) | const |
Gets the radius of the GranularBody.
| Quat MOMENTUM_NAMESPACE::GranularBody::getRotation | ( | ) | const |
Returns the current world orientation of the GranularBody.
| Vec3 MOMENTUM_NAMESPACE::GranularBody::getVelocity | ( | ) | const |
Returns the current world velocity of the GranularBody.
| bool MOMENTUM_NAMESPACE::GranularBody::is | ( | agx::Physics::GranularBodyPtr | granularBody | ) | const |
| bool MOMENTUM_NAMESPACE::GranularBody::isValid | ( | ) | const |
Gets true/false if the active GranularBody is valid or not.
Will return false if the GranularBody has been removed from the simulation.
| bool MOMENTUM_NAMESPACE::GranularBody::operator== | ( | const GranularBody & | other | ) | const |
| agx::Physics::GranularBodyPtr MOMENTUM_NAMESPACE::GranularBody::ptr | ( | ) | const |
| void MOMENTUM_NAMESPACE::GranularBody::setAngularVelocity | ( | const Vec3 & | angularVelocity | ) |
Set the world angular velocity of the GranularBody.
| angularVelocity | - angular velocity around the respective world axis ( x, y ,z ) to set on the GranularBody. |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setAngularVelocity | ( | double | ax, |
| double | ay, | ||
| double | az | ||
| ) |
Set the world angular velocity of the GranularBody.
| ax | - the angular velocity around the world x-axis to set. |
| ay | - the angular velocity around the world y-axis to set. |
| az | - the angular velocity around the world z-axis to set. |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setColor | ( | const Vec4 & | color | ) |
Set the color that will be used during rendering of the GranularBody.
| color | The color that should be set on the GranularBody |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setForce | ( | const Vec3 & | force | ) |
Explicitly set the force, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
force. | force | - the force |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setForce | ( | double | fx, |
| double | fy, | ||
| double | fz | ||
| ) |
Explicitly set the force, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
force. | fx,fy,fz | - the force |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setLinearVelocity | ( | const Vec3 & | velocity | ) |
Set the world linear velocity of the GranularBody.
| velocity | - the desired world linear velocity to set on the GranularBody. |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setLinearVelocity | ( | double | vx, |
| double | vy, | ||
| double | vz | ||
| ) |
Set the world linear velocity of the GranularBody.
| vx | - the linear velocity in the world x-axis to set. |
| vy | - the linear velocity in the world y-axis to set. |
| vz | - the linear velocity in the world z-axis to set. |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setMass | ( | double | mass | ) |
Explicitly set the mass of the GranularBody.
| mass | the mass to set on the GranularBody |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setMaterial | ( | const Material * | material | ) |
Set the material on the GranularBody.
| mass | the mass to set on the GranularBody |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setMotionControl | ( | GranularBody::MotionControl | motionControl | ) |
Assign new motion control state to this granular body.
If new state is KINEMATICS - the body will have infinite mass and only move from user velocity/position input. Default: DYNAMICS
| control | - new motion control |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::GranularBody::setPosition | ( | const Vec3 & | position | ) |
Set the world position of the GranularBody.
| position | the desired position to set on the GranularBody. |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setPosition | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Set the world position of the GranularBody.
| x | - desired x-coordinate in world frame |
| y | - desired y-coordinate in world frame |
| z | - desired z-coordinate in world frame |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setRadius | ( | double | radius | ) |
Explicitly set the radius of the GranularBody.
| radius | the radius to set on the GranularBody |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setRotation | ( | const EulerAngles & | e | ) |
Set the rotation of the GranularBody relative to world coordinate system.
| e | - rotation given as Euler angles |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::GranularBody::setRotation | ( | const Quat & | q | ) |
Set the rotation of the GranularBody relative to world coordinate system.
| q | - rotation given as a quaternion |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::GranularBody::setTorque | ( | const Vec3 & | torque | ) |
Explicitly set the torque, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
torque. | torque | - the torque |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setTorque | ( | double | tx, |
| double | ty, | ||
| double | tz | ||
| ) |
Explicitly set the torque, given in world coordinate frame, that will be affecting this GranularBody in the next solve.
torque. | tx,ty,tz | - the torque |
Only available in simulation mode.
| void MOMENTUM_NAMESPACE::GranularBody::setVelocity | ( | const Vec3 & | velocity | ) |
| void MOMENTUM_NAMESPACE::GranularBody::setVelocity | ( | double | vx, |
| double | vy, | ||
| double | vz | ||
| ) |