Momentum Scripting v1
Loading...
Searching...
No Matches
MOMENTUM_NAMESPACE::BallJoint Class Reference

#include <BallJoint.h>

Public Types

enum  DegreeOfFreedom { X , Y , Z }
 

Public Member Functions

std::shared_ptr< BallJointasBallJoint ()
 
std::shared_ptr< CylindricalJointasCylindricalJoint ()
 
std::shared_ptr< HingeJointasHingeJoint ()
 
std::shared_ptr< LockJointasLockJoint ()
 
std::shared_ptr< PrismaticJointasPrismaticJoint ()
 
std::shared_ptr< SpringJointasSpringJoint ()
 
std::shared_ptr< RigidBodygetBody (int body) const
 
Vec3 getBodyForce (int body) const
 
Vec3 getBodyTorque (int body) const
 
bool getEnabled () const
 
std::string getName () const
 
double getRotationalDamping (DegreeOfFreedom dof) const
 
double getRotationalElasticity (DegreeOfFreedom dof) const
 
AffineMatrix4x4 getTransformation (int body) const
 
double getTranslationalDamping (DegreeOfFreedom dof) const
 
double getTranslationalElasticity (DegreeOfFreedom dof) const
 
bool operator== (const Joint &other) const
 
void setEnabled (bool enabled)
 
void setRotationalDamping (DegreeOfFreedom dof, double damping)
 
void setRotationalElasticity (DegreeOfFreedom dof, double elasticity)
 
void setTransformation (int body, const AffineMatrix4x4 &transform)
 
void setTranslationalDamping (DegreeOfFreedom dof, double damping)
 
void setTranslationalElasticity (DegreeOfFreedom dof, double elasticity)
 

Protected Member Functions

virtual int getAgxRotationalDOF (Joint::DegreeOfFreedom dof) const
 
virtual int getAgxTranslationalDOF (Joint::DegreeOfFreedom dof) const
 
agx::Real getDampingInternal (int agxDOF) const
 
void setDampingInternal (int agxDOF, double damping)
 

Detailed Description

The ball joint class, a joint where all the rotational axis are unconstrained.

Member Enumeration Documentation

◆ DegreeOfFreedom

Enumerator

Member Function Documentation

◆ asBallJoint()

std::shared_ptr< BallJoint > MOMENTUM_NAMESPACE::Joint::asBallJoint ( )
inherited
Returns
a reference to the joint as a BallJoint if it is a BallJoint, otherwise nullptr will be returned

◆ asCylindricalJoint()

std::shared_ptr< CylindricalJoint > MOMENTUM_NAMESPACE::Joint::asCylindricalJoint ( )
inherited
Returns
a reference to the joint as a CylindricalJoint if it is a CylindricalJoint, otherwise nullptr will be returned

◆ asHingeJoint()

std::shared_ptr< HingeJoint > MOMENTUM_NAMESPACE::Joint::asHingeJoint ( )
inherited
Returns
a reference to the joint as a HingeJoint if it is a HingeJoint, otherwise nullptr will be returned

◆ asLockJoint()

std::shared_ptr< LockJoint > MOMENTUM_NAMESPACE::Joint::asLockJoint ( )
inherited
Returns
a reference to the joint as a LockJoint if it is a LockJoint, otherwise nullptr will be returned

◆ asPrismaticJoint()

std::shared_ptr< PrismaticJoint > MOMENTUM_NAMESPACE::Joint::asPrismaticJoint ( )
inherited
Returns
a reference to the joint as a PrismaticJoint if it is a PrismaticJoint, otherwise nullptr will be returned

◆ asSpringJoint()

std::shared_ptr< SpringJoint > MOMENTUM_NAMESPACE::Joint::asSpringJoint ( )
inherited
Returns
a reference to the joint as a SpringJoint if it is a SpringJoint, otherwise nullptr will be returned

◆ getAgxRotationalDOF()

virtual int MOMENTUM_NAMESPACE::BallJoint::getAgxRotationalDOF ( Joint::DegreeOfFreedom  dof) const
protectedvirtual

Reimplemented from MOMENTUM_NAMESPACE::Joint.

◆ getAgxTranslationalDOF()

virtual int MOMENTUM_NAMESPACE::BallJoint::getAgxTranslationalDOF ( Joint::DegreeOfFreedom  dof) const
protectedvirtual

Reimplemented from MOMENTUM_NAMESPACE::Joint.

◆ getBody()

std::shared_ptr< RigidBody > MOMENTUM_NAMESPACE::Joint::getBody ( int  body) const
inherited

Return the body at position 0 or 1, 1 can be nullptr, if that is the case, it is attached to world.

Parameters
body- 0 for first body, 1 for second
Returns
the attached body

◆ getBodyForce()

Vec3 MOMENTUM_NAMESPACE::Joint::getBodyForce ( int  body) const
inherited

Get the force that the joint exerts on the specified body in the frame of the body, in newton.

Parameters
body- 0 for first body, 1 for second
Returns
the force applied to the body from the constraint

◆ getBodyTorque()

Vec3 MOMENTUM_NAMESPACE::Joint::getBodyTorque ( int  body) const
inherited

Get the torque that the joint exerts on the specified body in the frame of the body, in newton-meters.

Parameters
body- 0 for first body, 1 for second
Returns
the torque applied to the body from the constraint

◆ getDampingInternal()

agx::Real MOMENTUM_NAMESPACE::Joint::getDampingInternal ( int  agxDOF) const
protectedinherited

◆ getEnabled()

bool MOMENTUM_NAMESPACE::Joint::getEnabled ( ) const
inherited

Is the joint is enabled?

Returns
if the joint is enabled for simulation

◆ getName()

std::string MOMENTUM_NAMESPACE::Joint::getName ( ) const
inherited

Get the name of the Joint.

Returns
the name of the joint

◆ getRotationalDamping()

double MOMENTUM_NAMESPACE::Joint::getRotationalDamping ( DegreeOfFreedom  dof) const
inherited

Get the rotational damping along the axis of the joint, in newton-meter-seconds per radian.

Parameters
dofthe degree of freedom to get the damping of
Returns
the rotational damping

◆ getRotationalElasticity()

double MOMENTUM_NAMESPACE::Joint::getRotationalElasticity ( DegreeOfFreedom  dof) const
inherited

Get the rotational elasticity along the axis of the joint, in newton per radian.

Parameters
dofthe degree of freedom to get the elasticity of
Returns
the rotational elasticity

◆ getTransformation()

AffineMatrix4x4 MOMENTUM_NAMESPACE::Joint::getTransformation ( int  body) const
inherited

Get the transformation in the world frame of the attachment of specified body.

Parameters
body- 0 for first body, 1 for second
Returns
the attachment transformation in the world frame.

◆ getTranslationalDamping()

double MOMENTUM_NAMESPACE::Joint::getTranslationalDamping ( DegreeOfFreedom  dof) const
inherited

Get the translational damping along the axis of the joint, in newton-seconds per meter.

Parameters
dofthe degree of freedom to get the damping of
Returns
the translational damping

◆ getTranslationalElasticity()

double MOMENTUM_NAMESPACE::Joint::getTranslationalElasticity ( DegreeOfFreedom  dof) const
inherited

Get the translational elasticity along the axis of the joint.

It is returned in newton per meter.

Parameters
dof- select which dof for which the elasticity will be returned
Returns
the translational elasticity

◆ operator==()

bool MOMENTUM_NAMESPACE::Joint::operator== ( const Joint other) const
inherited

◆ setDampingInternal()

void MOMENTUM_NAMESPACE::Joint::setDampingInternal ( int  agxDOF,
double  damping 
)
protectedinherited

◆ setEnabled()

void MOMENTUM_NAMESPACE::Joint::setEnabled ( bool  enabled)
inherited

Set to true if the joint should be enabled and should interact with the simulation.

Parameters
enabled- if true the joint should interact with the simulation

Only available in simulation mode

◆ setRotationalDamping()

void MOMENTUM_NAMESPACE::Joint::setRotationalDamping ( DegreeOfFreedom  dof,
double  damping 
)
inherited

Set the rotational damping along the axis of the joint, in newton-meter-seconds per radian.

Parameters
dofthe degree of freedom to set the damping of
dampingnew the rotational damping

Only available in simulation mode

◆ setRotationalElasticity()

void MOMENTUM_NAMESPACE::Joint::setRotationalElasticity ( DegreeOfFreedom  dof,
double  elasticity 
)
inherited

Set the rotational elasticity along the axis of the joint, in newton per radian.

Parameters
dofthe degree of freedom to set the elasticity of
elasticitythe new rotational elasticity

Only available in simulation mode

◆ setTransformation()

void MOMENTUM_NAMESPACE::Joint::setTransformation ( int  body,
const AffineMatrix4x4 transform 
)
inherited

Set the attachment transformation in the world frame of the specified body.

Parameters
body- 0 for first body, 1 for second
transform- the new transformation of the attachment

Only available in simulation mode

◆ setTranslationalDamping()

void MOMENTUM_NAMESPACE::Joint::setTranslationalDamping ( DegreeOfFreedom  dof,
double  damping 
)
inherited

Set the translational damping along the axis of the joint, in newton-seconds per meter.

Parameters
dofthe degree of freedom to set the damping of
dampingthe new translational damping

Only available in simulation mode

◆ setTranslationalElasticity()

void MOMENTUM_NAMESPACE::Joint::setTranslationalElasticity ( DegreeOfFreedom  dof,
double  elasticity 
)
inherited

Set the translational elasticity along the axis of the joint, in newton per meter.

Parameters
dofthe degree of freedom to set the elasticity of
elasticitythe new translational elasticity

Only available in simulation mode