#include <OPC_SphereCollider.h>
Protected Attributes | |
Point | mCenter |
Sphere center. More... | |
float | mRadius2 |
Sphere radius squared. More... | |
Protected Attributes inherited from VolumeCollider | |
Point | mCenterCoeff |
Point | mExtentsCoeff |
udword | mNbVolumeBVTests |
Number of Volume-BV tests. More... | |
udword | mNbVolumePrimTests |
Number of Volume-Primitive tests. More... | |
Container * | mTouchedPrimitives |
List of touched primitives. More... | |
Protected Attributes inherited from Collider | |
const BaseModel * | mCurrentModel |
Current model for collision query (owner of touched faces) More... | |
udword | mFlags |
Bit flags. More... | |
const MeshInterface * | mIMesh |
User-defined mesh interface. More... | |
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).
Definition at line 35 of file OPC_SphereCollider.h.
SphereCollider::SphereCollider | ( | ) |
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
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:
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 |
bool SphereCollider::Collide | ( | SphereCache & | cache, |
const Sphere & | sphere, | ||
const AABBTree * | tree | ||
) |
|
protected |
|
protected |
Sphere-AABB overlap test, based on Jim Arvo's code.
center | [in] box center |
extents | [in] box extents |
Definition at line 9 of file OPC_SphereAABBOverlap.h.
|
protected |
Definition at line 9 of file OPC_SphereTriOverlap.h.
|
protected |
Sphere center.
Definition at line 64 of file OPC_SphereCollider.h.
|
protected |
Sphere radius squared.
Definition at line 65 of file OPC_SphereCollider.h.