Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
OPC_AABBCollider.h
Go to the documentation of this file.
1
/*
3
* OPCODE - Optimized Collision Detection
4
* Copyright (C) 2001 Pierre Terdiman
5
* Homepage: http://www.codercorner.com/Opcode.htm
6
*/
8
10
16
19
// Include Guard
20
#ifndef __OPC_AABBCOLLIDER_H__
21
#define __OPC_AABBCOLLIDER_H__
22
23
struct
OPCODE_API
AABBCache
:
VolumeCache
24
{
25
AABBCache
() : FatCoeff(1.1
f
)
26
{
27
FatBox.mCenter.Zero();
28
FatBox.mExtents.Zero();
29
}
30
31
// Cached faces signature
32
CollisionAABB
FatBox
;
33
// User settings
34
float
FatCoeff
;
35
};
36
37
class
OPCODE_API
AABBCollider
:
public
VolumeCollider
38
{
39
public
:
40
// Constructor / Destructor
41
AABBCollider
();
42
virtual
~
AABBCollider
();
43
45
57
bool
Collide(
AABBCache
& cache,
const
CollisionAABB
& box,
const
Model
&
model
);
59
//
60
bool
Collide(
AABBCache
& cache,
const
CollisionAABB
& box,
const
AABBTree
* tree);
61
protected
:
62
CollisionAABB
mBox
;
63
Point
mMin
;
64
Point
mMax
;
65
// Leaf description
66
Point
mLeafVerts[3];
67
// Internal methods
68
void
_Collide(
const
AABBCollisionNode
* node);
69
void
_Collide(
const
AABBNoLeafNode
* node);
70
void
_Collide(
const
AABBQuantizedNode
* node);
71
void
_Collide(
const
AABBQuantizedNoLeafNode
* node);
72
void
_Collide(
const
AABBTreeNode
* node);
73
void
_CollideNoPrimitiveTest(
const
AABBCollisionNode
* node);
74
void
_CollideNoPrimitiveTest(
const
AABBNoLeafNode
* node);
75
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNode
* node);
76
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNoLeafNode
* node);
77
// Overlap tests
78
inline_
bool
AABBContainsBox(
const
Point
& bc,
const
Point
& be);
79
inline_
bool
AABBAABBOverlap(
const
Point
&
b
,
const
Point
& Pb);
80
inline_
bool
TriBoxOverlap();
81
// Init methods
82
bool
InitQuery
(
AABBCache
& cache,
const
CollisionAABB
& box);
83
};
84
85
class
OPCODE_API
HybridAABBCollider
:
public
AABBCollider
86
{
87
public
:
88
// Constructor / Destructor
89
HybridAABBCollider
();
90
virtual
~
HybridAABBCollider
();
91
92
bool
Collide
(
AABBCache
& cache,
const
CollisionAABB
& box,
const
HybridModel
&
model
);
93
protected
:
94
Container
mTouchedBoxes
;
95
};
96
97
#endif // __OPC_AABBCOLLIDER_H__
src
cmd
collide2
OPC_AABBCollider.h
Generated on Fri May 29 2015 23:07:12 for Vegastrike 0.5.1 rc1 by
1.8.4