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 <b2Contact.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
 
float32 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
 
float32 GetRestitution () const
 Get the restitution. More...
 
float32 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 SetEnabled (bool flag)
 
void SetFriction (float32 friction)
 
void SetRestitution (float32 restitution)
 
void SetTangentSpeed (float32 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
 
float32 m_friction
 
int32 m_indexA
 
int32 m_indexB
 
b2Manifold m_manifold
 
b2Contactm_next
 
b2ContactEdge m_nodeA
 
b2ContactEdge m_nodeB
 
b2Contactm_prev
 
float32 m_restitution
 
float32 m_tangentSpeed
 
float32 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 77 of file b2Contact.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
e_islandFlag 
e_touchingFlag 
e_enabledFlag 
e_filterFlag 
e_bulletHitFlag 
e_toiFlag 

Definition at line 155 of file b2Contact.h.

Constructor & Destructor Documentation

b2Contact::b2Contact ( )
inlineprotected

Definition at line 186 of file b2Contact.h.

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

Definition at line 126 of file b2Contact.cpp.

virtual b2Contact::~b2Contact ( )
inlineprotectedvirtual

Definition at line 188 of file b2Contact.h.

Member Function Documentation

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

Definition at line 51 of file b2Contact.cpp.

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

Definition at line 69 of file b2Contact.cpp.

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

Definition at line 101 of file b2Contact.cpp.

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

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

Definition at line 304 of file b2Contact.h.

int32 b2Contact::GetChildIndexA ( ) const
inline

Get the child primitive index for fixture A.

Definition at line 289 of file b2Contact.h.

int32 b2Contact::GetChildIndexB ( ) const
inline

Get the child primitive index for fixture B.

Definition at line 299 of file b2Contact.h.

b2Fixture * b2Contact::GetFixtureA ( )
inline

Get fixture A in this contact.

Definition at line 274 of file b2Contact.h.

const b2Fixture * b2Contact::GetFixtureA ( ) const
inline

Definition at line 279 of file b2Contact.h.

b2Fixture * b2Contact::GetFixtureB ( )
inline

Get fixture B in this contact.

Definition at line 284 of file b2Contact.h.

const b2Fixture * b2Contact::GetFixtureB ( ) const
inline

Definition at line 294 of file b2Contact.h.

float32 b2Contact::GetFriction ( ) const
inline

Get the friction.

Definition at line 314 of file b2Contact.h.

b2Manifold * b2Contact::GetManifold ( )
inline

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

Definition at line 222 of file b2Contact.h.

const b2Manifold * b2Contact::GetManifold ( ) const
inline

Definition at line 227 of file b2Contact.h.

b2Contact * b2Contact::GetNext ( )
inline

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

Definition at line 264 of file b2Contact.h.

const b2Contact * b2Contact::GetNext ( ) const
inline

Definition at line 269 of file b2Contact.h.

float32 b2Contact::GetRestitution ( ) const
inline

Get the restitution.

Definition at line 329 of file b2Contact.h.

float32 b2Contact::GetTangentSpeed ( ) const
inline

Get the desired tangent speed. In meters per second.

Definition at line 344 of file b2Contact.h.

void b2Contact::GetWorldManifold ( b2WorldManifold worldManifold) const
inline

Get the world manifold.

Definition at line 232 of file b2Contact.h.

void b2Contact::InitializeRegisters ( )
staticprotected

Definition at line 40 of file b2Contact.cpp.

bool b2Contact::IsEnabled ( ) const
inline

Has this contact been disabled?

Definition at line 254 of file b2Contact.h.

bool b2Contact::IsTouching ( ) const
inline

Is this contact touching?

Definition at line 259 of file b2Contact.h.

void b2Contact::ResetFriction ( )
inline

Reset the friction mixture to the default value.

Definition at line 319 of file b2Contact.h.

void b2Contact::ResetRestitution ( )
inline

Reset the restitution to the default value.

Definition at line 334 of file b2Contact.h.

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 242 of file b2Contact.h.

void b2Contact::SetFriction ( float32  friction)
inline

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

Definition at line 309 of file b2Contact.h.

void b2Contact::SetRestitution ( float32  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 324 of file b2Contact.h.

void b2Contact::SetTangentSpeed ( float32  speed)
inline

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

Definition at line 339 of file b2Contact.h.

void b2Contact::Update ( b2ContactListener listener)
protected

Definition at line 161 of file b2Contact.cpp.

Friends And Related Function Documentation

friend class b2Body
friend

Definition at line 151 of file b2Contact.h.

friend class b2ContactManager
friend

Definition at line 148 of file b2Contact.h.

friend class b2ContactSolver
friend

Definition at line 150 of file b2Contact.h.

friend class b2Fixture
friend

Definition at line 152 of file b2Contact.h.

friend class b2World
friend

Definition at line 149 of file b2Contact.h.

Member Data Documentation

b2Fixture* b2Contact::m_fixtureA
protected

Definition at line 205 of file b2Contact.h.

b2Fixture* b2Contact::m_fixtureB
protected

Definition at line 206 of file b2Contact.h.

uint32 b2Contact::m_flags
protected

Definition at line 195 of file b2Contact.h.

float32 b2Contact::m_friction
protected

Definition at line 216 of file b2Contact.h.

int32 b2Contact::m_indexA
protected

Definition at line 208 of file b2Contact.h.

int32 b2Contact::m_indexB
protected

Definition at line 209 of file b2Contact.h.

b2Manifold b2Contact::m_manifold
protected

Definition at line 211 of file b2Contact.h.

b2Contact* b2Contact::m_next
protected

Definition at line 199 of file b2Contact.h.

b2ContactEdge b2Contact::m_nodeA
protected

Definition at line 202 of file b2Contact.h.

b2ContactEdge b2Contact::m_nodeB
protected

Definition at line 203 of file b2Contact.h.

b2Contact* b2Contact::m_prev
protected

Definition at line 198 of file b2Contact.h.

float32 b2Contact::m_restitution
protected

Definition at line 217 of file b2Contact.h.

float32 b2Contact::m_tangentSpeed
protected

Definition at line 219 of file b2Contact.h.

float32 b2Contact::m_toi
protected

Definition at line 214 of file b2Contact.h.

int32 b2Contact::m_toiCount
protected

Definition at line 213 of file b2Contact.h.

bool b2Contact::s_initialized = false
staticprotected

Definition at line 193 of file b2Contact.h.

b2ContactRegister b2Contact::s_registers
staticprotected

Definition at line 192 of file b2Contact.h.


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


mvsim
Author(s):
autogenerated on Thu Jun 6 2019 19:36:40