Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Opcode::Collider Class Referenceabstract

#include <Opcode.h>

Inheritance diagram for Opcode::Collider:
Opcode::AABBTreeCollider Opcode::RayCollider Opcode::VolumeCollider Opcode::AABBCollider Opcode::LSSCollider Opcode::OBBCollider Opcode::PlanesCollider Opcode::SphereCollider Opcode::HybridAABBCollider Opcode::HybridLSSCollider Opcode::HybridOBBCollider Opcode::HybridPlanesCollider Opcode::HybridSphereCollider

Public Member Functions

 Collider ()
 
virtual ~Collider ()
 
inline_ BOOL GetContactStatus () const
 
inline_ BOOL FirstContactEnabled () const
 
inline_ BOOL TemporalCoherenceEnabled () const
 
inline_ BOOL ContactFound () const
 
inline_ BOOL TemporalHit () const
 
inline_ BOOL SkipPrimitiveTests () const
 
inline_ void SetFirstContact (bool flag)
 
inline_ void SetTemporalCoherence (bool flag)
 
inline_ void SetPrimitiveTests (bool flag)
 
virtual const char * ValidateSettings ()=0
 

Protected Member Functions

inline_ BOOL Setup (const BaseModel *model)
 
virtual inline_ void InitQuery ()
 

Protected Attributes

udword mFlags
 Bit flags. More...
 
const BaseModelmCurrentModel
 Current model for collision query (owner of touched faces) More...
 
const MeshInterfacemIMesh
 User-defined mesh interface. More...
 

Detailed Description

Definition at line 38 of file Opcode.h.

Constructor & Destructor Documentation

Collider::Collider ( )

Constructor.

Definition at line 40 of file OPC_Collider.cpp.

40  :
41  mFlags (0),
43  mIMesh (null)
44 {
45 }
Collider::~Collider ( )
virtual

Destructor.

Definition at line 52 of file OPC_Collider.cpp.

53 {
54 }

Member Function Documentation

inline_ BOOL Opcode::Collider::ContactFound ( ) const
inline

Checks a first contact has already been found.

Returns
true if a first contact has been found and we can stop a query

Definition at line 77 of file Opcode.h.

inline_ BOOL Opcode::Collider::FirstContactEnabled ( ) const
inline

Gets the "first contact" mode.

Returns
true if "first contact" mode is on

Definition at line 61 of file Opcode.h.

Referenced by csOPCODECollider::GetOneHitOnly().

inline_ BOOL Opcode::Collider::GetContactStatus ( ) const
inline

Gets the last collision status after a collision query.

Returns
true if a collision occured

Definition at line 53 of file Opcode.h.

Referenced by Opcode::HybridSphereCollider::Collide(), Opcode::HybridAABBCollider::Collide(), Opcode::HybridLSSCollider::Collide(), Opcode::HybridPlanesCollider::Collide(), and Opcode::HybridOBBCollider::Collide().

virtual inline_ void Opcode::Collider::InitQuery ( )
inlineprotectedvirtual
inline_ void Opcode::Collider::SetFirstContact ( bool  flag)
inline

Reports all contacts (false) or first contact only (true)

Parameters
flag[in] true for first contact, false for all contacts
See Also
SetTemporalCoherence(bool flag)
ValidateSettings()

Definition at line 105 of file Opcode.h.

Referenced by Opcode::Picking(), Opcode::SetupAllHits(), Opcode::SetupClosestHit(), Opcode::SetupInOutTest(), and Opcode::SetupShadowFeeler().

inline_ void Opcode::Collider::SetPrimitiveTests ( bool  flag)
inline

Enable/disable primitive tests.

Parameters
flag[in] true to enable primitive tests, false to discard them

Definition at line 131 of file Opcode.h.

inline_ void Opcode::Collider::SetTemporalCoherence ( bool  flag)
inline

Enable/disable temporal coherence.

Parameters
flag[in] true to enable temporal coherence, false to discard it
See Also
SetFirstContact(bool flag)
ValidateSettings()

Definition at line 119 of file Opcode.h.

Referenced by Opcode::Picking().

inline_ BOOL Opcode::Collider::Setup ( const BaseModel model)
inlineprotected

Setups current collision model

Parameters
model[in] current collision model
Returns
TRUE if success

Definition at line 159 of file Opcode.h.

Referenced by Opcode::HybridSphereCollider::Collide(), Opcode::HybridAABBCollider::Collide(), Opcode::HybridLSSCollider::Collide(), Opcode::HybridPlanesCollider::Collide(), and Opcode::HybridOBBCollider::Collide().

inline_ BOOL Opcode::Collider::SkipPrimitiveTests ( ) const
inline

Checks primitive tests are enabled;

Returns
true if primitive tests must be skipped

Definition at line 93 of file Opcode.h.

inline_ BOOL Opcode::Collider::TemporalCoherenceEnabled ( ) const
inline

Gets the temporal coherence mode.

Returns
true if temporal coherence is on

Definition at line 69 of file Opcode.h.

inline_ BOOL Opcode::Collider::TemporalHit ( ) const
inline

Checks there's been an early exit due to temporal coherence;

Returns
true if a temporal hit has occured

Definition at line 85 of file Opcode.h.

virtual const char* Opcode::Collider::ValidateSettings ( )
pure virtual

Validates current settings. You should call this method after all the settings / callbacks have been defined for a collider.

Returns
null if everything is ok, else a string describing the problem

Member Data Documentation

const BaseModel* Opcode::Collider::mCurrentModel
protected

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