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

#include <ContactPoint.h>

Public Member Functions

 ContactPoint ()
 
 ContactPoint (const ContactPoint &copy)
 
std::shared_ptr< RigidBodygetBody1 () const
 
std::shared_ptr< RigidBodygetBody2 () const
 
std::shared_ptr< MaterialPairgetContactMaterial () const
 
double getDepth () const
 
Vec3 getForce () const
 
Vec3 getFrictionForce () const
 
Vec3 getNormalForce () const
 
Vec3 getPoint () const
 

Static Public Member Functions

static Vec3 calculateSumForce (const std::vector< std::shared_ptr< ContactPoint > > &points)
 
static Vec3 calculateSumFrictionForce (const std::vector< std::shared_ptr< ContactPoint > > &points)
 
static Vec3 calculateSumNormalForce (const std::vector< std::shared_ptr< ContactPoint > > &points)
 

Detailed Description

A class describing a single contact point.

Constructor & Destructor Documentation

◆ ContactPoint() [1/2]

MOMENTUM_NAMESPACE::ContactPoint::ContactPoint ( )

Default constructor.

◆ ContactPoint() [2/2]

MOMENTUM_NAMESPACE::ContactPoint::ContactPoint ( const ContactPoint copy)

Member Function Documentation

◆ calculateSumForce()

static Vec3 MOMENTUM_NAMESPACE::ContactPoint::calculateSumForce ( const std::vector< std::shared_ptr< ContactPoint > > &  points)
static

This static method will calculate the resulting sum of all Normal and Friction forces (in world coordinate system) for the specified contact points.

Parameters
points- Vector of contact points
Returns
sum of all Normal and Friction forces

◆ calculateSumFrictionForce()

static Vec3 MOMENTUM_NAMESPACE::ContactPoint::calculateSumFrictionForce ( const std::vector< std::shared_ptr< ContactPoint > > &  points)
static

This static method will calculate the resulting sum of all Friction forces (in world coordinate system) for the specified contact points.

Parameters
points- Vector of contact points
Returns
sum of all Friction forces

◆ calculateSumNormalForce()

static Vec3 MOMENTUM_NAMESPACE::ContactPoint::calculateSumNormalForce ( const std::vector< std::shared_ptr< ContactPoint > > &  points)
static

This static method will calculate the resulting sum of all Normal forces (in world coordinate system) for the specified contact points.

Parameters
points- Vector of contact points
Returns
sum of all Normal forces

◆ getBody1()

std::shared_ptr< RigidBody > MOMENTUM_NAMESPACE::ContactPoint::getBody1 ( ) const

Get the first of the bodies in the contact.

Returns
one of the bodies in the contact

◆ getBody2()

std::shared_ptr< RigidBody > MOMENTUM_NAMESPACE::ContactPoint::getBody2 ( ) const

Get the second of the bodies in the contact.

Returns
one of the bodies in the contact

◆ getContactMaterial()

std::shared_ptr< MaterialPair > MOMENTUM_NAMESPACE::ContactPoint::getContactMaterial ( ) const

Get the contact material that the collision is using.

Returns
the contact material between the two objects that are colliding

◆ getDepth()

double MOMENTUM_NAMESPACE::ContactPoint::getDepth ( ) const

Get the depth of the contact in meters, describing the size of the overlap.

Returns
the depth of the contact

◆ getForce()

Vec3 MOMENTUM_NAMESPACE::ContactPoint::getForce ( ) const

Get the force that this contact applies to its bodies in Newton.

Returns
the force of this contact

◆ getFrictionForce()

Vec3 MOMENTUM_NAMESPACE::ContactPoint::getFrictionForce ( ) const

Get the friction force that this contact applies to its bodies in Newton.

Along the surface of the contact

Returns
the friction force of this contact

◆ getNormalForce()

Vec3 MOMENTUM_NAMESPACE::ContactPoint::getNormalForce ( ) const

Get the normal that this contact applies to its bodies in Newton.

Orthogonal against the surface of the contact

Returns
the normal force of this contact

◆ getPoint()

Vec3 MOMENTUM_NAMESPACE::ContactPoint::getPoint ( ) const

Get the point of the contact in the world.

In meters.

Returns
the point of the contact