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_LSSCollider.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_LSSCOLLIDER_H__
21
#define __OPC_LSSCOLLIDER_H__
22
23
struct
OPCODE_API
LSSCache
:
VolumeCache
24
{
25
LSSCache
()
26
{
27
Previous.mP0 =
Point
(0.0
f
, 0.0
f
, 0.0
f
);
28
Previous.mP1 =
Point
(0.0
f
, 0.0
f
, 0.0
f
);
29
Previous.mRadius = 0.0f;
30
FatCoeff = 1.1f;
31
}
32
33
// Cached faces signature
34
LSS
Previous
;
35
// User settings
36
float
FatCoeff
;
37
};
38
39
class
OPCODE_API
LSSCollider
:
public
VolumeCollider
40
{
41
public
:
42
// Constructor / Destructor
43
LSSCollider
();
44
virtual
~
LSSCollider
();
45
47
61
bool
Collide(
LSSCache
& cache,
const
LSS
& lss,
const
Model
&
model
,
const
Matrix4x4
* worldl=
null
,
const
Matrix4x4
* worldm=
null
);
63
//
64
bool
Collide(
LSSCache
& cache,
const
LSS
& lss,
const
AABBTree
* tree);
65
protected
:
66
// LSS in model space
67
Segment
mSeg
;
68
float
mRadius2
;
69
// Internal methods
70
void
_Collide(
const
AABBCollisionNode
* node);
71
void
_Collide(
const
AABBNoLeafNode
* node);
72
void
_Collide(
const
AABBQuantizedNode
* node);
73
void
_Collide(
const
AABBQuantizedNoLeafNode
* node);
74
void
_Collide(
const
AABBTreeNode
* node);
75
void
_CollideNoPrimitiveTest(
const
AABBCollisionNode
* node);
76
void
_CollideNoPrimitiveTest(
const
AABBNoLeafNode
* node);
77
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNode
* node);
78
void
_CollideNoPrimitiveTest(
const
AABBQuantizedNoLeafNode
* node);
79
// Overlap tests
80
inline_
bool
LSSContainsBox(
const
Point
& bc,
const
Point
& be);
81
inline_
bool
LSSAABBOverlap(
const
Point
&
center
,
const
Point
& extents);
82
inline_
bool
LSSTriOverlap(
const
Point
& vert0,
const
Point
& vert1,
const
Point
& vert2);
83
// Init methods
84
bool
InitQuery
(
LSSCache
& cache,
const
LSS
& lss,
const
Matrix4x4
* worldl=
null
,
const
Matrix4x4
* worldm=
null
);
85
};
86
87
class
OPCODE_API
HybridLSSCollider
:
public
LSSCollider
88
{
89
public
:
90
// Constructor / Destructor
91
HybridLSSCollider
();
92
virtual
~
HybridLSSCollider
();
93
94
bool
Collide
(
LSSCache
& cache,
const
LSS
& lss,
const
HybridModel
&
model
,
const
Matrix4x4
* worldl=
null
,
const
Matrix4x4
* worldm=
null
);
95
protected
:
96
Container
mTouchedBoxes
;
97
};
98
99
#endif // __OPC_LSSCOLLIDER_H__
src
cmd
collide2
OPC_LSSCollider.h
Generated on Fri May 29 2015 23:07:12 for Vegastrike 0.5.1 rc1 by
1.8.4