hrplib
hrpCollision
Opcode
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
)
Opcode::AABBQuantizedNoLeafNode
Definition:
Opcode.h:122
null
#define null
our own NULL pointer
Definition:
IceTypes.h:57
Opcode
Definition:
CollisionPairInserterBase.h:18
IMPLEMENT_LEAFDUMP
#define IMPLEMENT_LEAFDUMP(type)
Definition:
OPC_VolumeCollider.cpp:82
VolumeCollider::~VolumeCollider
virtual ~VolumeCollider()=0
Opcode::Collider::ValidateSettings
virtual const char * ValidateSettings()=0
Opcode::AABBQuantizedNode
Definition:
Opcode.h:101
Stdafx.h
Opcode::VolumeCollider::VolumeCollider
VolumeCollider()
Definition:
OPC_VolumeCollider.cpp:40
IMPLEMENT_NOLEAFDUMP
#define IMPLEMENT_NOLEAFDUMP(type)
Definition:
OPC_VolumeCollider.cpp:70
Opcode::AABBNoLeafNode
Definition:
Opcode.h:117
Opcode::AABBCollisionNode
Definition:
Opcode.h:77
Opcode::VolumeCollider::mTouchedPrimitives
Container * mTouchedPrimitives
List of touched primitives.
Definition:
Opcode.h:94
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:04