Momentum Scripting v1
Loading...
Searching...
No Matches
MOMENTUM_NAMESPACE Namespace Reference

Classes

class  AffineMatrix4x4
 
class  AngularMotor
 
class  AngularRange
 
class  AngularSecondaryJoint
 
class  AngularSpring
 
class  BallJoint
 
class  BodyDistribution
 
class  BodyModel
 
class  ContactPoint
 
class  ConveyorBelt
 
class  CylindricalJoint
 
class  DataBufferAccessor
 
class  Emitter
 
class  EulerAngles
 
class  EulerConvention
 
class  FrictionController
 
class  Geometry
 
class  GranularBody
 
class  GranularBodySystem
 
class  GranularGranularContact
 
class  GranularRigidBodyContact
 
class  HingeJoint
 
class  Joint
 
class  LinearMotor
 
class  LinearRange
 
class  LinearSecondaryJoint
 
class  LinearSpring
 
class  LockJoint
 
class  Material
 
class  MaterialPair
 
class  Matrix3x3
 
class  Matrix4x4
 
class  Observer
 
class  ParticleDistribution
 
class  ParticleModel
 
class  PrismaticJoint
 
class  Quat
 
class  RigidBody
 
class  SceneGraph
 
class  SceneNode
 
class  Screw1D
 
class  SecondaryJoint
 
class  Sensor
 
class  Simulation
 
class  SpringJoint
 
class  Vec3
 
class  Vec4
 

Typedefs

typedef std::shared_ptr< BallJointBallJointPtr
 
typedef std::vector< std::shared_ptr< BallJoint > > BallJointVector
 
typedef std::shared_ptr< BodyDistributionBodyDistributionPtr
 
typedef std::vector< std::shared_ptr< BodyDistribution > > BodyDistributionVector
 
typedef std::shared_ptr< BodyModelBodyModelPtr
 
typedef std::vector< std::shared_ptr< BodyModel > > BodyModelVector
 
typedef std::shared_ptr< ContactPointContactPointPtr
 
typedef std::vector< std::shared_ptr< ContactPoint > > ContactPointVector
 
typedef std::shared_ptr< ConveyorBeltConveyorBeltPtr
 
typedef std::vector< std::shared_ptr< ConveyorBelt > > ConveyorBeltVector
 
typedef std::shared_ptr< CylindricalJointCylindricalJointPtr
 
typedef std::vector< std::shared_ptr< CylindricalJoint > > CylindricalJointVector
 
typedef std::shared_ptr< EmitterEmitterPtr
 
typedef std::vector< std::shared_ptr< Emitter > > EmitterVector
 
typedef std::shared_ptr< FrictionControllerFrictionControllerPtr
 
typedef std::vector< std::shared_ptr< FrictionController > > FrictionControllerVector
 
typedef std::shared_ptr< GeometryGeometryPtr
 
typedef std::vector< std::shared_ptr< Geometry > > GeometryVector
 
typedef std::shared_ptr< GranularBodyGranularBodyPtr
 
typedef std::vector< std::shared_ptr< GranularBody > > GranularBodyVector
 
typedef std::shared_ptr< GranularGranularContactGranularGranularContactPtr
 
typedef std::vector< std::shared_ptr< GranularGranularContact > > GranularGranularContactVector
 
typedef std::shared_ptr< GranularRigidBodyContactGranularRigidBodyContactPtr
 
typedef std::vector< std::shared_ptr< GranularRigidBodyContact > > GranularRigidBodyContactVector
 
typedef std::shared_ptr< HingeJointHingeJointPtr
 
typedef std::vector< std::shared_ptr< HingeJoint > > HingeJointVector
 
typedef std::shared_ptr< JointJointPtr
 
typedef std::vector< std::shared_ptr< Joint > > JointVector
 
typedef std::shared_ptr< LockJointLockJointPtr
 
typedef std::vector< std::shared_ptr< LockJoint > > LockJointVector
 
typedef std::shared_ptr< MaterialPairMaterialPairPtr
 
typedef std::vector< std::shared_ptr< MaterialPair > > MaterialPairVector
 
typedef std::shared_ptr< MaterialMaterialPtr
 
typedef std::vector< std::shared_ptr< Material > > MaterialVector
 
typedef std::shared_ptr< ObserverObserverPtr
 
typedef std::vector< std::shared_ptr< Observer > > ObserverVector
 
typedef std::shared_ptr< ParticleDistributionParticleDistributionPtr
 
typedef std::vector< std::shared_ptr< ParticleDistribution > > ParticleDistributionVector
 
typedef std::shared_ptr< ParticleModelParticleModelPtr
 
typedef std::vector< std::shared_ptr< ParticleModel > > ParticleModelVector
 
typedef std::shared_ptr< PrismaticJointPrismaticJointPtr
 
typedef std::vector< std::shared_ptr< PrismaticJoint > > PrismaticJointVector
 
typedef std::pair< double, double > RangeReal
 
typedef std::shared_ptr< RigidBodyRigidBodyPtr
 
typedef std::vector< std::shared_ptr< RigidBody > > RigidBodyVector
 
typedef std::shared_ptr< SceneGraphSceneGraphPtr
 
typedef std::vector< std::shared_ptr< SceneGraph > > SceneGraphVector
 
typedef std::shared_ptr< SceneNodeSceneNodePtr
 
typedef std::vector< std::shared_ptr< SceneNode > > SceneNodeVector
 
typedef std::shared_ptr< Screw1DScrew1DPtr
 
typedef std::vector< std::shared_ptr< Screw1D > > Screw1DVector
 
typedef std::shared_ptr< SensorSensorPtr
 
typedef std::vector< std::shared_ptr< Sensor > > SensorVector
 
typedef std::shared_ptr< SpringJointSpringJointPtr
 
typedef std::vector< std::shared_ptr< SpringJoint > > SpringJointVector
 

Functions

template<typename T >
bool _equivalent (T lhs, T rhs, T epsilon=T(MOMENTUM_EQUIVALENT_EPSILON))
 
template<typename T >
bool _relativelyEquivalent (T lhs, T rhs, T relativeEpsilon=T(MOMENTUM_EQUIVALENT_EPSILON))
 
Vec3 absolute (const Vec3 &a)
 
Vec4 absolute (const Vec4 &a)
 
Vec3 asin (const Vec3 &a)
 
Vec3 clamp (const Vec3 &vec, const Vec3 &minimum, const Vec3 &maximum)
 
Vec4 clamp (const Vec4 &vec, const Vec4 &minimum, const Vec4 &maximum)
 
bool equalsZero (double d, double eps=DBL_EPSILON)
 
bool equivalent (const Matrix3x3 &a, const Matrix3x3 &b, double epsilon=1e-6)
 
bool equivalent (const Matrix4x4 &a, const Matrix4x4 &b, double epsilon=1e-6)
 
bool equivalent (const Quat &a, const Quat &b, double epsilon=double(MOMENTUM_EQUIVALENT_EPSILON))
 
bool equivalent (const Vec3 &a, const Vec3 &b, double epsilon=double(MOMENTUM_EQUIVALENT_EPSILON))
 
bool equivalent (const Vec4 &a, const Vec4 &b, double epsilon=double(MOMENTUM_EQUIVALENT_EPSILON))
 
bool equivalent (double lhs, double rhs, double epsilon=(double) MOMENTUM_EQUIVALENT_EPSILON)
 
SimulationgetSimulation ()
 
template<typename T1 , typename T2 >
T1 const lerp (T1 const &a, T1 const &b, T2 s)
 
template<typename T >
T const logInterpolate (T const &a, T const &b, float s)
 
Vec3 max (const Vec3 &lhs, const Vec3 &rhs)
 
Vec3 min (const Vec3 &lhs, const Vec3 &rhs)
 
double operator* (const Vec3 &lhs, const Vec4 &rhs)
 
Vec3 operator* (const Vec3 &v, const Matrix3x3 &m)
 
Vec3 operator* (const Vec3 &v, const Matrix4x4 &m)
 
double operator* (const Vec4 &lhs, const Vec3 &rhs)
 
Vec4 operator* (const Vec4 &v, const Matrix4x4 &m)
 
Vec3 operator* (double val, const Vec3 &vec)
 
std::ostream & operator<< (std::ostream &os, const EulerAngles &e)
 
std::ostream & operator<< (std::ostream &os, const Matrix3x3 &m)
 
std::ostream & operator<< (std::ostream &os, const Matrix4x4 &m)
 
template<typename T >
std::ostream & operator<< (std::ostream &output, const Quat &quat)
 
std::ostream & operator<< (std::ostream &output, const Vec3 &v)
 
std::ostream & operator<< (std::ostream &output, const Vec4 &v)
 
bool relativelyEquivalent (double lhs, double rhs, double epsilon=(double) MOMENTUM_EQUIVALENT_EPSILON)
 
Vec3 sinc (const Vec3 &a)
 

Variables

const double GRAVITY_ACCELERATION = double(9.80665)
 
const double Infinity = std::numeric_limits<double>::infinity()
 
const double MOMENTUM_EQUIVALENT_EPSILON = (double)1E-9
 
const double PI = double(M_PI)
 
const double PI_2 = double(M_PI_2)
 
const double PI_4 = double(M_PI_4)
 
const double REAL_SQRT_EPSILON = std::sqrt(std::numeric_limits< double >::epsilon())
 

Detailed Description

Namespace for Momentum Scripting API.

Typedef Documentation

◆ BallJointPtr

typedef std::shared_ptr< BallJoint > MOMENTUM_NAMESPACE::BallJointPtr

◆ BallJointVector

typedef std::vector<std::shared_ptr< BallJoint > > MOMENTUM_NAMESPACE::BallJointVector

A vector with objects of the type BallJoint .


◆ BodyDistributionPtr

◆ BodyDistributionVector

typedef std::vector<std::shared_ptr< BodyDistribution > > MOMENTUM_NAMESPACE::BodyDistributionVector

A vector with objects of the type BodyDistribution .


◆ BodyModelPtr

typedef std::shared_ptr< BodyModel > MOMENTUM_NAMESPACE::BodyModelPtr

◆ BodyModelVector

typedef std::vector<std::shared_ptr< BodyModel > > MOMENTUM_NAMESPACE::BodyModelVector

A vector with objects of the type BodyModel .


◆ ContactPointPtr

◆ ContactPointVector

typedef std::vector<std::shared_ptr< ContactPoint > > MOMENTUM_NAMESPACE::ContactPointVector

A vector with objects of the type ContactPoint .


◆ ConveyorBeltPtr

◆ ConveyorBeltVector

typedef std::vector<std::shared_ptr< ConveyorBelt > > MOMENTUM_NAMESPACE::ConveyorBeltVector

A vector with objects of the type ConveyorBelt .


◆ CylindricalJointPtr

◆ CylindricalJointVector

typedef std::vector<std::shared_ptr< CylindricalJoint > > MOMENTUM_NAMESPACE::CylindricalJointVector

A vector with objects of the type CylindricalJoint .


◆ EmitterPtr

typedef std::shared_ptr< Emitter > MOMENTUM_NAMESPACE::EmitterPtr

◆ EmitterVector

typedef std::vector<std::shared_ptr< Emitter > > MOMENTUM_NAMESPACE::EmitterVector

A vector with objects of the type Emitter .


◆ FrictionControllerPtr

◆ FrictionControllerVector

typedef std::vector<std::shared_ptr< FrictionController > > MOMENTUM_NAMESPACE::FrictionControllerVector

A vector with objects of the type FrictionController .


◆ GeometryPtr

typedef std::shared_ptr< Geometry > MOMENTUM_NAMESPACE::GeometryPtr

◆ GeometryVector

typedef std::vector<std::shared_ptr< Geometry > > MOMENTUM_NAMESPACE::GeometryVector

A vector with objects of the type Geometry .


◆ GranularBodyPtr

◆ GranularBodyVector

typedef std::vector<std::shared_ptr< GranularBody > > MOMENTUM_NAMESPACE::GranularBodyVector

A vector with objects of the type GranularBody .


◆ GranularGranularContactPtr

◆ GranularGranularContactVector

A vector with objects of the type GranularGranularContact .


◆ GranularRigidBodyContactPtr

◆ GranularRigidBodyContactVector

A vector with objects of the type GranularRigidBodyContact .


◆ HingeJointPtr

typedef std::shared_ptr< HingeJoint > MOMENTUM_NAMESPACE::HingeJointPtr

◆ HingeJointVector

typedef std::vector<std::shared_ptr< HingeJoint > > MOMENTUM_NAMESPACE::HingeJointVector

A vector with objects of the type HingeJoint .


◆ JointPtr

typedef std::shared_ptr< Joint > MOMENTUM_NAMESPACE::JointPtr

◆ JointVector

typedef std::vector<std::shared_ptr< Joint > > MOMENTUM_NAMESPACE::JointVector

A vector with objects of the type Joint .


◆ LockJointPtr

typedef std::shared_ptr< LockJoint > MOMENTUM_NAMESPACE::LockJointPtr

◆ LockJointVector

typedef std::vector<std::shared_ptr< LockJoint > > MOMENTUM_NAMESPACE::LockJointVector

A vector with objects of the type LockJoint .


◆ MaterialPairPtr

◆ MaterialPairVector

typedef std::vector<std::shared_ptr< MaterialPair > > MOMENTUM_NAMESPACE::MaterialPairVector

A vector with objects of the type MaterialPair .


◆ MaterialPtr

typedef std::shared_ptr< Material > MOMENTUM_NAMESPACE::MaterialPtr

◆ MaterialVector

typedef std::vector<std::shared_ptr< Material > > MOMENTUM_NAMESPACE::MaterialVector

A vector with objects of the type Material .


◆ ObserverPtr

typedef std::shared_ptr< Observer > MOMENTUM_NAMESPACE::ObserverPtr

◆ ObserverVector

typedef std::vector<std::shared_ptr< Observer > > MOMENTUM_NAMESPACE::ObserverVector

A vector with objects of the type Observer .


◆ ParticleDistributionPtr

◆ ParticleDistributionVector

typedef std::vector<std::shared_ptr< ParticleDistribution > > MOMENTUM_NAMESPACE::ParticleDistributionVector

A vector with objects of the type ParticleDistribution .


◆ ParticleModelPtr

◆ ParticleModelVector

typedef std::vector<std::shared_ptr< ParticleModel > > MOMENTUM_NAMESPACE::ParticleModelVector

A vector with objects of the type ParticleModel .


◆ PrismaticJointPtr

◆ PrismaticJointVector

typedef std::vector<std::shared_ptr< PrismaticJoint > > MOMENTUM_NAMESPACE::PrismaticJointVector

A vector with objects of the type PrismaticJoint .


◆ RangeReal

typedef std::pair<double,double> MOMENTUM_NAMESPACE::RangeReal

◆ RigidBodyPtr

typedef std::shared_ptr< RigidBody > MOMENTUM_NAMESPACE::RigidBodyPtr

◆ RigidBodyVector

typedef std::vector<std::shared_ptr< RigidBody > > MOMENTUM_NAMESPACE::RigidBodyVector

A vector with objects of the type RigidBody .


◆ SceneGraphPtr

typedef std::shared_ptr< SceneGraph > MOMENTUM_NAMESPACE::SceneGraphPtr

◆ SceneGraphVector

typedef std::vector<std::shared_ptr< SceneGraph > > MOMENTUM_NAMESPACE::SceneGraphVector

A vector with objects of the type SceneGraph .


◆ SceneNodePtr

typedef std::shared_ptr< SceneNode > MOMENTUM_NAMESPACE::SceneNodePtr

◆ SceneNodeVector

typedef std::vector<std::shared_ptr< SceneNode > > MOMENTUM_NAMESPACE::SceneNodeVector

A vector with objects of the type SceneNode .


◆ Screw1DPtr

typedef std::shared_ptr< Screw1D > MOMENTUM_NAMESPACE::Screw1DPtr

◆ Screw1DVector

typedef std::vector<std::shared_ptr< Screw1D > > MOMENTUM_NAMESPACE::Screw1DVector

A vector with objects of the type Screw1D .


◆ SensorPtr

typedef std::shared_ptr< Sensor > MOMENTUM_NAMESPACE::SensorPtr

◆ SensorVector

typedef std::vector<std::shared_ptr< Sensor > > MOMENTUM_NAMESPACE::SensorVector

A vector with objects of the type Sensor .


◆ SpringJointPtr

typedef std::shared_ptr< SpringJoint > MOMENTUM_NAMESPACE::SpringJointPtr

◆ SpringJointVector

typedef std::vector<std::shared_ptr< SpringJoint > > MOMENTUM_NAMESPACE::SpringJointVector

A vector with objects of the type SpringJoint .


Function Documentation

◆ _equivalent()

template<typename T >
bool MOMENTUM_NAMESPACE::_equivalent ( lhs,
rhs,
epsilon = T(MOMENTUM_EQUIVALENT_EPSILON) 
)

Compare two values for equality.

Meaning that the difference between them is less than an epsilon value

Returns
true if lhs and rhs are equivalent

◆ _relativelyEquivalent()

template<typename T >
bool MOMENTUM_NAMESPACE::_relativelyEquivalent ( lhs,
rhs,
relativeEpsilon = T(MOMENTUM_EQUIVALENT_EPSILON) 
)

Compare two values for relative equality.

Meaning that the difference between them is less than an epsilon value The epsilon value is scaled with the values compared, to a minimum of relativeEpsilon.

Returns
true if lhs and rhs are equivalent

◆ absolute() [1/2]

Vec3 MOMENTUM_NAMESPACE::absolute ( const Vec3 a)

◆ absolute() [2/2]

Vec4 MOMENTUM_NAMESPACE::absolute ( const Vec4 a)

◆ asin()

Vec3 MOMENTUM_NAMESPACE::asin ( const Vec3 a)

◆ clamp() [1/2]

Vec3 MOMENTUM_NAMESPACE::clamp ( const Vec3 vec,
const Vec3 minimum,
const Vec3 maximum 
)

◆ clamp() [2/2]

Vec4 MOMENTUM_NAMESPACE::clamp ( const Vec4 vec,
const Vec4 minimum,
const Vec4 maximum 
)

◆ equalsZero()

bool MOMENTUM_NAMESPACE::equalsZero ( double  d,
double  eps = DBL_EPSILON 
)
Returns
true if d is within the range of (-DBL_EPSILON, DBL_EPSILON).

◆ equivalent() [1/6]

bool MOMENTUM_NAMESPACE::equivalent ( const Matrix3x3 a,
const Matrix3x3 b,
double  epsilon = 1e-6 
)

◆ equivalent() [2/6]

bool MOMENTUM_NAMESPACE::equivalent ( const Matrix4x4 a,
const Matrix4x4 b,
double  epsilon = 1e-6 
)

◆ equivalent() [3/6]

bool MOMENTUM_NAMESPACE::equivalent ( const Quat a,
const Quat b,
double  epsilon = double( MOMENTUM_EQUIVALENT_EPSILON ) 
)

◆ equivalent() [4/6]

bool MOMENTUM_NAMESPACE::equivalent ( const Vec3 a,
const Vec3 b,
double  epsilon = double(MOMENTUM_EQUIVALENT_EPSILON) 
)

◆ equivalent() [5/6]

bool MOMENTUM_NAMESPACE::equivalent ( const Vec4 a,
const Vec4 b,
double  epsilon = double(MOMENTUM_EQUIVALENT_EPSILON) 
)

◆ equivalent() [6/6]

bool MOMENTUM_NAMESPACE::equivalent ( double  lhs,
double  rhs,
double  epsilon = (double)MOMENTUM_EQUIVALENT_EPSILON 
)

Compare two values for equality.

Meaning that the difference between them is less than an epsilon value

Returns
true if lhs and rhs are equivalent

◆ getSimulation()

Simulation * MOMENTUM_NAMESPACE::getSimulation ( )

Return a pointer to the simulation object which can be used to access all joints, bodies, contacts etc.

Returns
the active simulation

◆ lerp()

template<typename T1 , typename T2 >
T1 const MOMENTUM_NAMESPACE::lerp ( T1 const &  a,
T1 const &  b,
T2  s 
)

Linearly interpolate from a to b using s = {0,..1}.

◆ logInterpolate()

template<typename T >
T const MOMENTUM_NAMESPACE::logInterpolate ( T const &  a,
T const &  b,
float  s 
)

logarithmic interpolation from a to b using s = {0,..1}

◆ max()

Vec3 MOMENTUM_NAMESPACE::max ( const Vec3 lhs,
const Vec3 rhs 
)

◆ min()

Vec3 MOMENTUM_NAMESPACE::min ( const Vec3 lhs,
const Vec3 rhs 
)

◆ operator*() [1/6]

double MOMENTUM_NAMESPACE::operator* ( const Vec3 lhs,
const Vec4 rhs 
)

Compute the dot product of a (Vec3,1.0) and a Vec4.

◆ operator*() [2/6]

Vec3 MOMENTUM_NAMESPACE::operator* ( const Vec3 v,
const Matrix3x3 m 
)

◆ operator*() [3/6]

Vec3 MOMENTUM_NAMESPACE::operator* ( const Vec3 v,
const Matrix4x4 m 
)

◆ operator*() [4/6]

double MOMENTUM_NAMESPACE::operator* ( const Vec4 lhs,
const Vec3 rhs 
)

Compute the dot product of a Vec4 and a (Vec3,1.0).

◆ operator*() [5/6]

Vec4 MOMENTUM_NAMESPACE::operator* ( const Vec4 v,
const Matrix4x4 m 
)

◆ operator*() [6/6]

Vec3 MOMENTUM_NAMESPACE::operator* ( double  val,
const Vec3 vec 
)

◆ operator<<() [1/6]

std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  os,
const EulerAngles e 
)

◆ operator<<() [2/6]

std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  os,
const Matrix3x3 m 
)

◆ operator<<() [3/6]

std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  os,
const Matrix4x4 m 
)

◆ operator<<() [4/6]

template<typename T >
std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  output,
const Quat quat 
)

◆ operator<<() [5/6]

std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  output,
const Vec3 v 
)

◆ operator<<() [6/6]

std::ostream & MOMENTUM_NAMESPACE::operator<< ( std::ostream &  output,
const Vec4 v 
)

◆ relativelyEquivalent()

bool MOMENTUM_NAMESPACE::relativelyEquivalent ( double  lhs,
double  rhs,
double  epsilon = (double)MOMENTUM_EQUIVALENT_EPSILON 
)

Compare two values for relative equality.

Meaning that the difference between them is less than an epsilon value The epsilon value is scaled with the values compared, to a minimum of relativeEpsilon^2.

Returns
true if lhs and rhs are equivalent

◆ sinc()

Vec3 MOMENTUM_NAMESPACE::sinc ( const Vec3 a)

Variable Documentation

◆ GRAVITY_ACCELERATION

const double MOMENTUM_NAMESPACE::GRAVITY_ACCELERATION = double(9.80665)

◆ Infinity

const double MOMENTUM_NAMESPACE::Infinity = std::numeric_limits<double>::infinity()

◆ MOMENTUM_EQUIVALENT_EPSILON

const double MOMENTUM_NAMESPACE::MOMENTUM_EQUIVALENT_EPSILON = (double)1E-9

◆ PI

const double MOMENTUM_NAMESPACE::PI = double(M_PI)

◆ PI_2

const double MOMENTUM_NAMESPACE::PI_2 = double(M_PI_2)

◆ PI_4

const double MOMENTUM_NAMESPACE::PI_4 = double(M_PI_4)

◆ REAL_SQRT_EPSILON

const double MOMENTUM_NAMESPACE::REAL_SQRT_EPSILON = std::sqrt(std::numeric_limits< double >::epsilon())