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_VolumeCollider.cpp
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
27
30
// Precompiled Header
31
#include "
Stdafx.h
"
32
33
using namespace
Opcode;
34
36
39
VolumeCollider::VolumeCollider
() :
41
mTouchedPrimitives (
null
),
42
mNbVolumeBVTests (0),
43
mNbVolumePrimTests (0)
44
{
45
}
46
48
51
VolumeCollider::~VolumeCollider
()
53
{
54
mTouchedPrimitives
=
null
;
55
}
56
58
62
const
char
*
VolumeCollider::ValidateSettings
()
64
{
65
return
null
;
66
}
67
68
// Pretty dumb way to dump - to do better - one day...
69
70
#define IMPLEMENT_NOLEAFDUMP(type) \
71
void VolumeCollider::_Dump(const type* node) \
72
{ \
73
if(node->HasPosLeaf()) mTouchedPrimitives->Add(node->GetPosPrimitive()); \
74
else _Dump(node->GetPos()); \
75
\
76
if(ContactFound()) return; \
77
\
78
if(node->HasNegLeaf()) mTouchedPrimitives->Add(node->GetNegPrimitive()); \
79
else _Dump(node->GetNeg()); \
80
}
81
82
#define IMPLEMENT_LEAFDUMP(type) \
83
void VolumeCollider::_Dump(const type* node) \
84
{ \
85
if(node->IsLeaf()) \
86
{ \
87
mTouchedPrimitives->Add(node->GetPrimitive()); \
88
} \
89
else \
90
{ \
91
_Dump(node->GetPos()); \
92
\
93
if(ContactFound()) return; \
94
\
95
_Dump(node->GetNeg()); \
96
} \
97
}
98
99
IMPLEMENT_NOLEAFDUMP
(
AABBNoLeafNode
)
100
IMPLEMENT_NOLEAFDUMP
(
AABBQuantizedNoLeafNode
)
101
102
IMPLEMENT_LEAFDUMP
(
AABBCollisionNode
)
103
IMPLEMENT_LEAFDUMP
(
AABBQuantizedNode
)
src
cmd
collide2
OPC_VolumeCollider.cpp
Generated on Fri May 29 2015 23:07:13 for Vegastrike 0.5.1 rc1 by
1.8.4