Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
b2Contact Class Referenceabstract

#include <b2_contact.h>

Inheritance diagram for b2Contact:
Inheritance graph
[legend]

Public Member Functions

virtual void Evaluate (b2Manifold *manifold, const b2Transform &xfA, const b2Transform &xfB)=0
 Evaluate this contact with your own manifold and transforms. More...
 
int32 GetChildIndexA () const
 Get the child primitive index for fixture A. More...
 
int32 GetChildIndexB () const
 Get the child primitive index for fixture B. More...
 
b2FixtureGetFixtureA ()
 Get fixture A in this contact. More...
 
const b2FixtureGetFixtureA () const
 
b2FixtureGetFixtureB ()
 Get fixture B in this contact. More...
 
const b2FixtureGetFixtureB () const
 
float GetFriction () const
 Get the friction. More...
 
b2ManifoldGetManifold ()
 
const b2ManifoldGetManifold () const
 
b2ContactGetNext ()
 Get the next contact in the world's contact list. More...
 
const b2ContactGetNext () const
 
float GetRestitution () const
 Get the restitution. More...
 
float GetRestitutionThreshold () const
 Get the restitution threshold. More...
 
float GetTangentSpeed () const
 Get the desired tangent speed. In meters per second. More...
 
void GetWorldManifold (b2WorldManifold *worldManifold) const
 Get the world manifold. More...
 
bool IsEnabled () const
 Has this contact been disabled? More...
 
bool IsTouching () const
 Is this contact touching? More...
 
void ResetFriction ()
 Reset the friction mixture to the default value. More...
 
void ResetRestitution ()
 Reset the restitution to the default value. More...
 
void ResetRestitutionThreshold ()
 Reset the restitution threshold to the default value. More...
 
void SetEnabled (bool flag)
 
void SetFriction (float friction)
 
void SetRestitution (float restitution)
 
void SetRestitutionThreshold (float threshold)
 
void SetTangentSpeed (float speed)
 Set the desired tangent speed for a conveyor belt behavior. In meters per second. More...
 

Protected Types

enum  {
  e_islandFlag = 0x0001, e_touchingFlag = 0x0002, e_enabledFlag = 0x0004, e_filterFlag = 0x0008,
  e_bulletHitFlag = 0x0010, e_toiFlag = 0x0020
}
 

Protected Member Functions

 b2Contact ()
 
 b2Contact (b2Fixture *fixtureA, int32 indexA, b2Fixture *fixtureB, int32 indexB)
 
void FlagForFiltering ()
 Flag this contact for filtering. Filtering will occur the next time step. More...
 
void Update (b2ContactListener *listener)
 
virtual ~b2Contact ()
 

Static Protected Member Functions

static void AddType (b2ContactCreateFcn *createFcn, b2ContactDestroyFcn *destroyFcn, b2Shape::Type typeA, b2Shape::Type typeB)
 
static b2ContactCreate (b2Fixture *fixtureA, int32 indexA, b2Fixture *fixtureB, int32 indexB, b2BlockAllocator *allocator)
 
static void Destroy (b2Contact *contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator *allocator)
 
static void Destroy (b2Contact *contact, b2BlockAllocator *allocator)
 
static void InitializeRegisters ()
 

Protected Attributes

b2Fixturem_fixtureA
 
b2Fixturem_fixtureB
 
uint32 m_flags
 
float m_friction
 
int32 m_indexA
 
int32 m_indexB
 
b2Manifold m_manifold
 
b2Contactm_next
 
b2ContactEdge m_nodeA
 
b2ContactEdge m_nodeB
 
b2Contactm_prev
 
float m_restitution
 
float m_restitutionThreshold
 
float m_tangentSpeed
 
float m_toi
 
int32 m_toiCount
 

Static Protected Attributes

static bool s_initialized = false
 
static b2ContactRegister s_registers [b2Shape::e_typeCount][b2Shape::e_typeCount]
 

Friends

class b2Body
 
class b2ContactManager
 
class b2ContactSolver
 
class b2Fixture
 
class b2World
 

Detailed Description

The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no contact points.

Definition at line 88 of file b2_contact.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
e_islandFlag 
e_touchingFlag 
e_enabledFlag 
e_filterFlag 
e_bulletHitFlag 
e_toiFlag 

Definition at line 176 of file b2_contact.h.

Constructor & Destructor Documentation

◆ b2Contact() [1/2]

b2Contact::b2Contact ( )
inlineprotected

Definition at line 207 of file b2_contact.h.

◆ b2Contact() [2/2]

b2Contact::b2Contact ( b2Fixture fixtureA,
int32  indexA,
b2Fixture fixtureB,
int32  indexB 
)
protected

Definition at line 130 of file b2_contact.cpp.

◆ ~b2Contact()

virtual b2Contact::~b2Contact ( )
inlineprotectedvirtual

Definition at line 209 of file b2_contact.h.

Member Function Documentation

◆ AddType()

void b2Contact::AddType ( b2ContactCreateFcn createFcn,
b2ContactDestroyFcn destroyFcn,
b2Shape::Type  typeA,
b2Shape::Type  typeB 
)
staticprotected

Definition at line 55 of file b2_contact.cpp.

◆ Create()

b2Contact * b2Contact::Create ( b2Fixture fixtureA,
int32  indexA,
b2Fixture fixtureB,
int32  indexB,
b2BlockAllocator allocator 
)
staticprotected

Definition at line 73 of file b2_contact.cpp.

◆ Destroy() [1/2]

static void b2Contact::Destroy ( b2Contact contact,
b2Shape::Type  typeA,
b2Shape::Type  typeB,
b2BlockAllocator allocator 
)
staticprotected

◆ Destroy() [2/2]

void b2Contact::Destroy ( b2Contact contact,
b2BlockAllocator allocator 
)
staticprotected

Definition at line 105 of file b2_contact.cpp.

◆ Evaluate()

virtual void b2Contact::Evaluate ( b2Manifold manifold,
const b2Transform xfA,
const b2Transform xfB 
)
pure virtual

◆ FlagForFiltering()

void b2Contact::FlagForFiltering ( )
inlineprotected

Flag this contact for filtering. Filtering will occur the next time step.

Definition at line 326 of file b2_contact.h.

◆ GetChildIndexA()

int32 b2Contact::GetChildIndexA ( ) const
inline

Get the child primitive index for fixture A.

Definition at line 311 of file b2_contact.h.

◆ GetChildIndexB()

int32 b2Contact::GetChildIndexB ( ) const
inline

Get the child primitive index for fixture B.

Definition at line 321 of file b2_contact.h.

◆ GetFixtureA() [1/2]

b2Fixture * b2Contact::GetFixtureA ( )
inline

Get fixture A in this contact.

Definition at line 296 of file b2_contact.h.

◆ GetFixtureA() [2/2]

const b2Fixture * b2Contact::GetFixtureA ( ) const
inline

Definition at line 301 of file b2_contact.h.

◆ GetFixtureB() [1/2]

b2Fixture * b2Contact::GetFixtureB ( )
inline

Get fixture B in this contact.

Definition at line 306 of file b2_contact.h.

◆ GetFixtureB() [2/2]

const b2Fixture * b2Contact::GetFixtureB ( ) const
inline

Definition at line 316 of file b2_contact.h.

◆ GetFriction()

float b2Contact::GetFriction ( ) const
inline

Get the friction.

Definition at line 336 of file b2_contact.h.

◆ GetManifold() [1/2]

b2Manifold * b2Contact::GetManifold ( )
inline

Get the contact manifold. Do not modify the manifold unless you understand the internals of Box2D.

Definition at line 244 of file b2_contact.h.

◆ GetManifold() [2/2]

const b2Manifold * b2Contact::GetManifold ( ) const
inline

Definition at line 249 of file b2_contact.h.

◆ GetNext() [1/2]

b2Contact * b2Contact::GetNext ( )
inline

Get the next contact in the world's contact list.

Definition at line 286 of file b2_contact.h.

◆ GetNext() [2/2]

const b2Contact * b2Contact::GetNext ( ) const
inline

Definition at line 291 of file b2_contact.h.

◆ GetRestitution()

float b2Contact::GetRestitution ( ) const
inline

Get the restitution.

Definition at line 351 of file b2_contact.h.

◆ GetRestitutionThreshold()

float b2Contact::GetRestitutionThreshold ( ) const
inline

Get the restitution threshold.

Definition at line 366 of file b2_contact.h.

◆ GetTangentSpeed()

float b2Contact::GetTangentSpeed ( ) const
inline

Get the desired tangent speed. In meters per second.

Definition at line 381 of file b2_contact.h.

◆ GetWorldManifold()

void b2Contact::GetWorldManifold ( b2WorldManifold worldManifold) const
inline

Get the world manifold.

Definition at line 254 of file b2_contact.h.

◆ InitializeRegisters()

void b2Contact::InitializeRegisters ( )
staticprotected

Definition at line 44 of file b2_contact.cpp.

◆ IsEnabled()

bool b2Contact::IsEnabled ( ) const
inline

Has this contact been disabled?

Definition at line 276 of file b2_contact.h.

◆ IsTouching()

bool b2Contact::IsTouching ( ) const
inline

Is this contact touching?

Definition at line 281 of file b2_contact.h.

◆ ResetFriction()

void b2Contact::ResetFriction ( )
inline

Reset the friction mixture to the default value.

Definition at line 341 of file b2_contact.h.

◆ ResetRestitution()

void b2Contact::ResetRestitution ( )
inline

Reset the restitution to the default value.

Definition at line 356 of file b2_contact.h.

◆ ResetRestitutionThreshold()

void b2Contact::ResetRestitutionThreshold ( )
inline

Reset the restitution threshold to the default value.

Definition at line 371 of file b2_contact.h.

◆ SetEnabled()

void b2Contact::SetEnabled ( bool  flag)
inline

Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).

Definition at line 264 of file b2_contact.h.

◆ SetFriction()

void b2Contact::SetFriction ( float  friction)
inline

Override the default friction mixture. You can call this in b2ContactListener::PreSolve. This value persists until set or reset.

Definition at line 331 of file b2_contact.h.

◆ SetRestitution()

void b2Contact::SetRestitution ( float  restitution)
inline

Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.

Definition at line 346 of file b2_contact.h.

◆ SetRestitutionThreshold()

void b2Contact::SetRestitutionThreshold ( float  threshold)
inline

Override the default restitution velocity threshold mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.

Definition at line 361 of file b2_contact.h.

◆ SetTangentSpeed()

void b2Contact::SetTangentSpeed ( float  speed)
inline

Set the desired tangent speed for a conveyor belt behavior. In meters per second.

Definition at line 376 of file b2_contact.h.

◆ Update()

void b2Contact::Update ( b2ContactListener listener)
protected

Definition at line 166 of file b2_contact.cpp.

Friends And Related Function Documentation

◆ b2Body

friend class b2Body
friend

Definition at line 172 of file b2_contact.h.

◆ b2ContactManager

friend class b2ContactManager
friend

Definition at line 169 of file b2_contact.h.

◆ b2ContactSolver

friend class b2ContactSolver
friend

Definition at line 171 of file b2_contact.h.

◆ b2Fixture

friend class b2Fixture
friend

Definition at line 173 of file b2_contact.h.

◆ b2World

friend class b2World
friend

Definition at line 170 of file b2_contact.h.

Member Data Documentation

◆ m_fixtureA

b2Fixture* b2Contact::m_fixtureA
protected

Definition at line 226 of file b2_contact.h.

◆ m_fixtureB

b2Fixture* b2Contact::m_fixtureB
protected

Definition at line 227 of file b2_contact.h.

◆ m_flags

uint32 b2Contact::m_flags
protected

Definition at line 216 of file b2_contact.h.

◆ m_friction

float b2Contact::m_friction
protected

Definition at line 237 of file b2_contact.h.

◆ m_indexA

int32 b2Contact::m_indexA
protected

Definition at line 229 of file b2_contact.h.

◆ m_indexB

int32 b2Contact::m_indexB
protected

Definition at line 230 of file b2_contact.h.

◆ m_manifold

b2Manifold b2Contact::m_manifold
protected

Definition at line 232 of file b2_contact.h.

◆ m_next

b2Contact* b2Contact::m_next
protected

Definition at line 220 of file b2_contact.h.

◆ m_nodeA

b2ContactEdge b2Contact::m_nodeA
protected

Definition at line 223 of file b2_contact.h.

◆ m_nodeB

b2ContactEdge b2Contact::m_nodeB
protected

Definition at line 224 of file b2_contact.h.

◆ m_prev

b2Contact* b2Contact::m_prev
protected

Definition at line 219 of file b2_contact.h.

◆ m_restitution

float b2Contact::m_restitution
protected

Definition at line 238 of file b2_contact.h.

◆ m_restitutionThreshold

float b2Contact::m_restitutionThreshold
protected

Definition at line 239 of file b2_contact.h.

◆ m_tangentSpeed

float b2Contact::m_tangentSpeed
protected

Definition at line 241 of file b2_contact.h.

◆ m_toi

float b2Contact::m_toi
protected

Definition at line 235 of file b2_contact.h.

◆ m_toiCount

int32 b2Contact::m_toiCount
protected

Definition at line 234 of file b2_contact.h.

◆ s_initialized

bool b2Contact::s_initialized = false
staticprotected

Definition at line 214 of file b2_contact.h.

◆ s_registers

b2ContactRegister b2Contact::s_registers
staticprotected

Definition at line 213 of file b2_contact.h.


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


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22