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_OBBCollider.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_OBBCOLLIDER_H__
21
#define __OPC_OBBCOLLIDER_H__
22
23
struct
OPCODE_API
OBBCache
:
VolumeCache
24
{
25
OBBCache
() : FatCoeff(1.1
f
)
26
{
27
FatBox.mCenter.Zero();
28
FatBox.mExtents.Zero();
29
FatBox.mRot.Identity();
30
}
31
32
// Cached faces signature
33
OBB
FatBox
;
34
// User settings
35
float
FatCoeff
;
36
};
37
38
class
OPCODE_API
OBBCollider
:
public
VolumeCollider
39
{
40
public
:
41
// Constructor / Destructor
42
OBBCollider
();
43
virtual
~
OBBCollider
();
44
46
60
bool
Collide(
OBBCache
& cache,
const
OBB
& box,
const
Model
&
model
,
const
Matrix4x4
* worldb=
null
,
const
Matrix4x4
* worldm=
null
);
62
63
// Settings
64
66
70
inline_
void
SetFullBoxBoxTest(
bool
flag) { mFullBoxBoxTest = flag; }
72
73
// Settings
74
76
80
override
(
Collider
)
const
char
*
ValidateSettings
();
82
83
protected
:
84
// Precomputed data
85
Matrix3x3
mAR
;
86
Matrix3x3
mRModelToBox
;
87
Matrix3x3
mRBoxToModel
;
88
Point
mTModelToBox
;
89
Point
mTBoxToModel
;
90
91
Point
mBoxExtents
;
92
Point
mB0
;
93
Point
mB1
;
94
95
float
mBBx1
;
96
float
mBBy1
;
97
float
mBBz1
;
98
99
float
mBB_1
;
100
float
mBB_2
;
101
float
mBB_3
;
102
float
mBB_4
;
103
float
mBB_5
;
104
float
mBB_6
;
105
float
mBB_7
;
106
float
mBB_8
;
107
float
mBB_9
;
108
109
// Leaf description
110
Point
mLeafVerts[3];
111
// Settings
112
bool
mFullBoxBoxTest
;
113
// Internal methods
114
void
_Collide(
const
AABBCollisionNode
* node);
115
void
_Collide(
const
AABBNoLeafNode
* node);
116
void
_Collide(
const
AABBQuantizedNode
* node);
117
void
_Collide(
const
AABBQuantizedNoLeafNode
* node);
118
void
_CollideNoPrimitiveTest(
const
AABBCollisionNode
* node);
119
void
_CollideNoPrimitiveTest(
const
AABBNoLeafNode
* node);
120
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNode
* node);
121
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNoLeafNode
* node);
122
// Overlap tests
123
inline_
bool
OBBContainsBox(
const
Point
& bc,
const
Point
& be);
124
inline_
bool
BoxBoxOverlap(
const
Point
& extents,
const
Point
&
center
);
125
inline_
bool
TriBoxOverlap();
126
// Init methods
127
bool
InitQuery
(
OBBCache
& cache,
const
OBB
& box,
const
Matrix4x4
* worldb=
null
,
const
Matrix4x4
* worldm=
null
);
128
};
129
130
class
OPCODE_API
HybridOBBCollider
:
public
OBBCollider
131
{
132
public
:
133
// Constructor / Destructor
134
HybridOBBCollider
();
135
virtual
~
HybridOBBCollider
();
136
137
bool
Collide
(
OBBCache
& cache,
const
OBB
& box,
const
HybridModel
&
model
,
const
Matrix4x4
* worldb=
null
,
const
Matrix4x4
* worldm=
null
);
138
protected
:
139
Container
mTouchedBoxes
;
140
};
141
142
#endif // __OPC_OBBCOLLIDER_H__
src
cmd
collide2
OPC_OBBCollider.h
Generated on Fri May 29 2015 23:07:12 for Vegastrike 0.5.1 rc1 by
1.8.4