15#ifndef MOMENTUM_RIGIDBODY_H
16#define MOMENTUM_RIGIDBODY_H
18#include "momentum_export.h"
19#include "momentum_namespace.h"
24#include "AffineMatrix4x4.h"
27#include "ContactPoint.h"
78#ifndef AGX_MOMENTUM_ANALYSIS_API
88#ifndef AGX_MOMENTUM_ANALYSIS_API
148#ifndef AGX_MOMENTUM_ANALYSIS_API
245#ifndef AGX_MOMENTUM_ANALYSIS_API
267#ifndef AGX_MOMENTUM_ANALYSIS_API
304 std::string __str__()
const;
314#ifndef AGX_MOMENTUM_ANALYSIS_API
335#ifndef AGX_MOMENTUM_ANALYSIS_API
350#ifndef AGX_MOMENTUM_ANALYSIS_API
372#ifndef AGX_MOMENTUM_ANALYSIS_API
676#ifndef AGX_MOMENTUM_ANALYSIS_API
694#ifndef AGX_MOMENTUM_ANALYSIS_API
717 bool is(agx::RigidBody* body)
const;
743 agx::RigidBody *m_body;
Matrix class for rigid transformations (translation, rotation).
Definition: AffineMatrix4x4.h:51
This class provides conversion services between Euler angles in any of the 24 conventions and corresp...
Definition: EulerAngles.h:64
Matrix class for inertia.
Definition: Matrix3x3.h:52
The Observer is a coordinate system which can be used to measure positions,velocities,...
Definition: Observer.h:46
The object holding quaternions and providing operations on these.
Definition: Quat.h:55
A rigid body is a moving (translation/rotation) object with a mass and a inertia.
Definition: RigidBody.h:52
void addForce(const Vec3 &force)
Adds the force, given in world coordinate system, that will be affecting this body in the next solve.
void setTransform(const AffineMatrix4x4 &matrix)
Set the transformation of the body in world coordinate system.
void setCmPosition(const Vec3 &p)
Assign new center of mass position, given in world coordinate frame.
Matrix3x3 getInertia()
Get the inertia of the rigid body in the specified coordinate system.
void addForce(double fx, double fy, double fz)
Adds the force, given in world coordinate system, that will be affecting this body in the next solve.
Vec3 getLinearVelocity() const
Velocity of center of mass in world coordinate system.
void setPosition(const Vec3 &p)
Set the position of the model frame in world coordinate system.
void setCmLocalTranslate(const Vec3 &translate)
Sets the local offset of the center of mass position to the model origin (in the local rigid body coo...
Quat getRotation() const
Current rigid body rotation, given in world coordinate system.
void addTorque(const Vec3 &torque)
Adds the torque, given in world coordinate system, that will be affecting this body in the next solve...
MotionControl
The MotionControl enumeration indicates what makes a RigidBody move.
Definition: RigidBody.h:63
bool operator==(const RigidBody &other) const
Vec3 getLinearMomentum() const
AffineMatrix4x4 getCmTransform() const
void addLocalTorque(const Vec3 &torque)
Adds the torque, given in local coordinate system, that will be affecting this body in the next solve...
Vec3 getCmPosition() const
bool isEmittedBody() const
double getRotationalEnergy() const
Vec3 getAngularMomentum() const
void addTorque(double tx, double ty, double tz)
Adds the torque, given in world coordinate system, that will be affecting this body in the next solve...
double getTranslationalEnergy() const
void setAngularVelocityDamping(double damping)
Set angular velocity damping for the body in all directions x, y and z.
double getTotalEnergy() const
Vec3 getModelAcceleration(const Vec3 &relPos=Vec3()) const
Calculates the linear acceleration at the given point relPos.
Vec3 getAngularAcceleration() const
Will always be 0 for KINEMATIC and STATIC bodies.
Vec3 getAngularVelocityDamping() const
std::string getName() const
void setLinearVelocityDamping(double damping)
Set linear velocity damping for the body in all directions x, y and z.
void setMotionControl(RigidBody::MotionControl control)
Assign new motion control state to this rigid body.
void setForce(const Vec3 &force)
Explicitly set the force, given in world coordinate system, that will be affecting this body in the n...
Vec3 getModelVelocity(const Vec3 &relPos=Vec3()) const
Calculates the linear velocity at the given point relPos.
void setMass(double mass)
Set the mass of the rigid body in kilograms.
void moveTo(const Vec3 &targetPosition, const Quat &targetRotation, double dt)
Utility method to calculate and assign linear- and angular velocity given a target transform and the ...
void setForce(double fx, double fy, double fz)
Explicitly set the force, given in world coordinate system, that will be affecting this body in the n...
void setRotation(const Quat &q)
Set the rotation of the body relative to world coordinate system.
Vec3 getAngularVelocity() const
Angular velocity in world coordinate system.
void setRotation(const EulerAngles *e)
Set the rotation of the body relative to world coordinate system.
void addForceAtLocalCmPosition(const Vec3 &force, const Vec3 &position)
Add a force, given in world coordinate system, applied at a position relative to the center of mass.
AffineMatrix4x4 getTransform() const
Current rigid body transformation, given in world coordinate system.
bool getEnable() const
Access the state enable flag.
void setLinearVelocityDamping(const Vec3 &damping)
Give linear velocity damping in each direction, given in local body coordinate system.
Vec3 getLinearAcceleration() const
Will always be 0 for KINEMATIC and STATIC bodies.
size_t getNumConstraints() const
void setAngularVelocity(double vx, double vy, double vz)
Set the angular velocity of the center of mass of this rigid body.
Vec3 getLinearVelocityDamping() const
void setCmTransform(const AffineMatrix4x4 &matrix)
Assign new center of mass transform, given in world coordinate frame.
ContactPointVector getContacts() const
Get all contacts in which this rigid body is involved.
void addForceAtPosition(double fx, double fy, double fz, double px, double py, double pz)
Add a force, given in world coordinate system, applied at a position given in world coordinate system...
Vec3 getLastForce() const
Access the summed force applied to this rigid body last time the system was integrated.
void moveTo(const AffineMatrix4x4 &target, double t)
Utility method to calculate and assign linear- and angular velocity given a target transform and the ...
RigidBody::MotionControl getMotionControl() const
void setTorque(const Vec3 &torque)
Explicitly set the torque, given in world coordinate system, that will be affecting this body in the ...
void addForceAtLocalPosition(double fx, double fy, double fz, double px, double py, double pz)
Add a force, given in world coordinate system, applied at a position given in local rigid body coordi...
void setLinearVelocity(const Vec3 &velocity)
Set the linear velocity of the center of mass of this rigid body.
bool is(agx::RigidBody *body) const
Check if this a representation of the specified agx::RigidBody.
void addForceAtLocalCmPosition(double fx, double fy, double fz, double px, double py, double pz)
Add a force, given in world coordinate system, applied at a position relative to the center of mass.
void setVelocityDamping(double damping)
Set both linear- and angular velocity damping in all directions.
void setAngularVelocity(const Vec3 &angularVelocity)
Set the angular velocity of the center of mass of this rigid body.
agx::RigidBody * body() const
void addForceAtPosition(const Vec3 &force, const Vec3 &position)
Add a force, given in world coordinate system, applied at a position given in world coordinate system...
Vec3 getPosition() const
Current rigid body position, given in world coordinate system.
void setAngularVelocityDamping(const Vec3 &damping)
Give angular velocity damping in each direction, given in local body coordinate system.
void setTorque(double tx, double ty, double tz)
Explicitly set the torque, given in world coordinate system, that will be affecting this body in the ...
GeometryVector getGeometries() const
Get all geometries of the rigid body.
void addLocalTorque(double tx, double ty, double tz)
Adds the torque, given in local coordinate system, that will be affecting this body in the next solve...
bool setCmAndInertiaInObserver(const Observer &observer, const Matrix3x3 &inertia)
Assign a new center of mass and inertia tensor using an observer.
void addForceAtLocalPosition(const Vec3 &force, const Vec3 &position)
Add a force, given in world coordinate system, applied at a position given in local rigid body coordi...
double getMass()
Get the mass of the rigid body in kilograms.
Vec3 getLastTorque() const
Access the summed torque applied to this rigid body last time the system was integrated.
void setEnable(bool enable)
Change state enable of this rigid body.
Vec3 getCmLocalTranslate() const
void setPosition(double x, double y, double z)
Set the position of the model frame in world coordinate system.
void setLinearVelocity(double vx, double vy, double vz)
Set the linear velocity of the center of mass of this rigid body.
bool setInertia(Matrix3x3 inertia)
Set the inertia of the rigid body in the specified coordinate system.
This class is used to access an existing simulation with all its contents including joints,...
Definition: Simulation.h:70
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29
std::vector< std::shared_ptr< ContactPoint > > ContactPointVector
A vector with objects of the type ContactPoint .
Definition: ContactPoint.h:43
std::vector< std::shared_ptr< Geometry > > GeometryVector
A vector with objects of the type Geometry .
Definition: Geometry.h:169