physics
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Contact Class Reference

A data structure to pass data received from a collision to the solver. More...

#include "contact.hpp"

Public Member Functions

 Contact (CollisionBody &hullA, CollisionBody &hullB)
 Constructor, instantiated with the collision query between two CollisionBody objects. More...
 
int applyImpulse ()
 Impulse-solver function, applies both normal impulse and friction impulses. More...
 
int preStep (float dt)
 Apply impulse from previous frame for better coherence. More...
 

Public Attributes

vec3 normal = vec3(0,0,0)
 
vec3 tangent = vec3(0,0,0)
 
vec3 bitangent = vec3(0,0,0)
 
vec3 collision_point
 
float penetration = 0
 
float bias = 0
 
float effective_mass_bitangent = 0.0f
 
float effective_mass_tangent = 0.0f
 
float effective_mass_normal = 0.0f
 
float Pn = 0
 
float Pt = 0
 
float Pbt = 0
 
RigidBodybody_a
 
RigidBodybody_b
 
CollisionBodycol_body_a
 
CollisionBodycol_body_b
 
ContactType type
 
vector< int > id
 
int warmStartNo = 0
 

Static Public Attributes

static vector< ContactallContacts
 
static unsigned int iterations
 

Detailed Description

A data structure to pass data received from a collision to the solver.

Constructor & Destructor Documentation

◆ Contact()

Contact::Contact ( CollisionBody hullA,
CollisionBody hullB 
)

Constructor, instantiated with the collision query between two CollisionBody objects.

Member Function Documentation

◆ applyImpulse()

int Contact::applyImpulse ( )

Impulse-solver function, applies both normal impulse and friction impulses.

◆ preStep()

int Contact::preStep ( float  dt)

Apply impulse from previous frame for better coherence.

Member Data Documentation

◆ allContacts

vector<Contact> Contact::allContacts
static

◆ bias

float Contact::bias = 0

◆ bitangent

vec3 Contact::bitangent = vec3(0,0,0)

◆ body_a

RigidBody* Contact::body_a

◆ body_b

RigidBody* Contact::body_b

◆ col_body_a

CollisionBody* Contact::col_body_a

◆ col_body_b

CollisionBody* Contact::col_body_b

◆ collision_point

vec3 Contact::collision_point

◆ effective_mass_bitangent

float Contact::effective_mass_bitangent = 0.0f

◆ effective_mass_normal

float Contact::effective_mass_normal = 0.0f

◆ effective_mass_tangent

float Contact::effective_mass_tangent = 0.0f

◆ id

vector<int> Contact::id

◆ iterations

unsigned int Contact::iterations
static

◆ normal

vec3 Contact::normal = vec3(0,0,0)

◆ Pbt

float Contact::Pbt = 0

◆ penetration

float Contact::penetration = 0

◆ Pn

float Contact::Pn = 0

◆ Pt

float Contact::Pt = 0

◆ tangent

vec3 Contact::tangent = vec3(0,0,0)

◆ type

ContactType Contact::type

◆ warmStartNo

int Contact::warmStartNo = 0

The documentation for this class was generated from the following file: