AABBSphereCollider Class Reference

Inherits Collider.

List of all members.

Public Methods

 AABBSphereCollider ()
virtual ~AABBSphereCollider ()
bool Collide (const Sphere &sphere, OPCODE_Model *model, const Matrix4x4 &worlds, const Matrix4x4 &worldm, udword *cache=null)
bool Collide (const Sphere &sphere, const AABBCollisionTree *tree, const Matrix4x4 &worlds, const Matrix4x4 &worldm, udword *cache=null)
bool Collide (const Sphere &sphere, const AABBNoLeafTree *tree, const Matrix4x4 &worlds, const Matrix4x4 &worldm, udword *cache=null)
bool Collide (const Sphere &sphere, const AABBQuantizedTree *tree, const Matrix4x4 &worlds, const Matrix4x4 &worldm, udword *cache=null)
bool Collide (const Sphere &sphere, const AABBQuantizedNoLeafTree *tree, const Matrix4x4 &worlds, const Matrix4x4 &worldm, udword *cache=null)
__forceinline void SetDestination (CollisionFaces *cf)
__forceinline udword GetNbSphereBVTests () const
__forceinline udword GetNbSpherePrimTests () const
__forceinline AABBSphereCollider & SetUserData (udword data)
__forceinline AABBSphereCollider & SetCallbackObj (OPC_CALLBACK callback)
 override (Collider) const char *ValidateSettings()


Detailed Description

Contains an AABB sphere collider. This class performs a collision test between a sphere and an AABB tree. You can use this to do a standard player vs world collision, in a Nettle/Telemachos way. It doesn't suffer from all reported bugs in those two classic codes - the "new" one by Paul Nettle is a debuggued version I think. Collision response can be driven by reported collision data - it works extremely well for me. In sake of efficiency, all meshes (that is, all AABB trees) should of course also be kept in an extra hierarchical structure (octree, whatever).

Author:
Pierre Terdiman
Version:
1.0
Date:
June, 2, 2001


Constructor & Destructor Documentation

AABBSphereCollider::AABBSphereCollider  
 

Constructor.

AABBSphereCollider::~AABBSphereCollider   [virtual]
 

Destructor.


Member Function Documentation

bool AABBSphereCollider::Collide const Sphere &    sphere,
const AABBQuantizedNoLeafTree   tree,
const Matrix4x4   worlds,
const Matrix4x4   worldm,
udword   cache = null
 

Collision query for quantized no-leaf trees.

Parameters:
sphere  [in] collision sphere in local space
tree  [in] model's AABB tree
worlds  [in] sphere's world matrix
worldm  [in] model's world matrix
cache  [in] a possibly cached face index, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

bool AABBSphereCollider::Collide const Sphere &    sphere,
const AABBQuantizedTree   tree,
const Matrix4x4   worlds,
const Matrix4x4   worldm,
udword   cache = null
 

Collision query for quantized trees.

Parameters:
sphere  [in] collision sphere in local space
tree  [in] model's AABB tree
worlds  [in] sphere's world matrix
worldm  [in] model's world matrix
cache  [in] a possibly cached face index, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

bool AABBSphereCollider::Collide const Sphere &    sphere,
const AABBNoLeafTree   tree,
const Matrix4x4   worlds,
const Matrix4x4   worldm,
udword   cache = null
 

Collision query for no-leaf trees.

Parameters:
sphere  [in] collision sphere in local space
tree  [in] model's AABB tree
worlds  [in] sphere's world matrix
worldm  [in] model's world matrix
cache  [in] a possibly cached face index, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

bool AABBSphereCollider::Collide const Sphere &    sphere,
const AABBCollisionTree   tree,
const Matrix4x4   worlds,
const Matrix4x4   worldm,
udword   cache = null
 

Collision query for normal trees.

Parameters:
sphere  [in] collision sphere in local space
tree  [in] model's AABB tree
worlds  [in] sphere's world matrix
worldm  [in] model's world matrix
cache  [in] a possibly cached face index, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

bool AABBSphereCollider::Collide const Sphere &    sphere,
OPCODE_Model   model,
const Matrix4x4   worlds,
const Matrix4x4   worldm,
udword   cache = null
 

Generic collision query for generic OPCODE models. After the call, access the results:

Parameters:
sphere  [in] collision sphere in local space
model  [in] Opcode model to collide with
worlds  [in] sphere's world matrix
worldm  [in] model's world matrix
cache  [in] a possibly cached face index, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

__forceinline udword AABBSphereCollider::GetNbSphereBVTests   const [inline]
 

Stats: gets the number of Sphere-BV overlap tests after a collision query.

See also:
GetNbSpherePrimTests()
Returns:
the number of Sphere-BV tests performed during last query

__forceinline udword AABBSphereCollider::GetNbSpherePrimTests   const [inline]
 

Stats: gets the number of Sphere-Triangle overlap tests after a collision query.

See also:
GetNbSphereBVTests()
Returns:
the number of Sphere-Triangle tests performed during last query

AABBSphereCollider::override Collider    const
 

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

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

__forceinline AABBSphereCollider& AABBSphereCollider::SetCallbackObj OPC_CALLBACK    callback [inline]
 

Callback control: a method to setup object callback. Must provide triangle-vertices for a given triangle index.

Parameters:
callback  [in] user-defined callback
Returns:
Self-Reference

__forceinline void AABBSphereCollider::SetDestination CollisionFaces *    cf [inline]
 

Settings: sets the destination array for stabbed faces.

Parameters:
cf  [in] destination array, filled during queries

__forceinline AABBSphereCollider& AABBSphereCollider::SetUserData udword    data [inline]
 

Callback control: a method to setup user-data assigned to object callback.

Parameters:
data  [in] user-defined data
Returns:
Self-Reference


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


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen