Public Member Functions | Protected Member Functions | Protected Attributes
SphereCollider Class Reference

#include <OPC_SphereCollider.h>

Inheritance diagram for SphereCollider:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool Collide (SphereCache &cache, const Sphere &sphere, const Model &model, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
bool Collide (SphereCache &cache, const Sphere &sphere, const AABBTree *tree)
 SphereCollider ()
virtual ~SphereCollider ()

Protected Member Functions

void _Collide (const AABBCollisionNode *node)
void _Collide (const AABBNoLeafNode *node)
void _Collide (const AABBQuantizedNode *node)
void _Collide (const AABBQuantizedNoLeafNode *node)
void _Collide (const AABBTreeNode *node)
void _CollideNoPrimitiveTest (const AABBCollisionNode *node)
void _CollideNoPrimitiveTest (const AABBNoLeafNode *node)
void _CollideNoPrimitiveTest (const AABBQuantizedNode *node)
void _CollideNoPrimitiveTest (const AABBQuantizedNoLeafNode *node)
BOOL InitQuery (SphereCache &cache, const Sphere &sphere, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
inline_ BOOL SphereAABBOverlap (const Point &center, const Point &extents)
inline_ BOOL SphereContainsBox (const Point &bc, const Point &be)
BOOL SphereTriOverlap (const Point &vert0, const Point &vert1, const Point &vert2)

Protected Attributes

Point mCenter
 Sphere center.
float mRadius2
 Sphere radius squared.

Detailed Description

Contains a sphere-vs-tree 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.3
Date:
June, 2, 2001

Definition at line 35 of file OPC_SphereCollider.h.


Constructor & Destructor Documentation

virtual SphereCollider::~SphereCollider ( ) [virtual]

Member Function Documentation

bool SphereCollider::Collide ( SphereCache cache,
const Sphere sphere,
const Model model,
const Matrix4x4 worlds = null,
const Matrix4x4 worldm = null 
)

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

Parameters:
cache[in/out] a sphere cache
sphere[in] collision sphere in local space
model[in] Opcode model to collide with
worlds[in] sphere's world matrix, or null
worldm[in] model's world matrix, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.
bool SphereCollider::Collide ( SphereCache cache,
const Sphere sphere,
const AABBTree tree 
)
BOOL SphereCollider::InitQuery ( SphereCache cache,
const Sphere sphere,
const Matrix4x4 worlds = null,
const Matrix4x4 worldm = null 
) [protected]
inline_ BOOL SphereCollider::SphereAABBOverlap ( const Point center,
const Point extents 
) [protected]

Sphere-AABB overlap test, based on Jim Arvo's code.

Parameters:
center[in] box center
extents[in] box extents
Returns:
TRUE on overlap

Definition at line 9 of file OPC_SphereAABBOverlap.h.

BOOL SphereCollider::SphereTriOverlap ( const Point vert0,
const Point vert1,
const Point vert2 
) [protected]

Definition at line 9 of file OPC_SphereTriOverlap.h.


Member Data Documentation

Sphere center.

Definition at line 64 of file OPC_SphereCollider.h.

float SphereCollider::mRadius2 [protected]

Sphere radius squared.

Definition at line 65 of file OPC_SphereCollider.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:21