hrplib
hrpCollision
Opcode
OPC_SweepAndPrune.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_SWEEPANDPRUNE_H__
21
#define __OPC_SWEEPANDPRUNE_H__
22
24
31
typedef
BOOL
(*
PairCallback
) (
udword
id0,
udword
id1,
void
* user_data);
33
34
class
SAP_Element;
35
class
SAP_EndPoint;
36
class
SAP_Box;
37
38
class
OPCODE_API
SAP_PairData
39
{
40
public
:
41
SAP_PairData
();
42
~
SAP_PairData
();
43
44
bool
Init(
udword
nb_objects);
45
46
void
AddPair(
udword
id1,
udword
id2);
47
void
RemovePair(
udword
id1,
udword
id2);
48
49
void
DumpPairs(
Pairs
& pairs)
const
;
50
void
DumpPairs(
PairCallback
callback,
void
* user_data)
const
;
51
private
:
52
udword
mNbElements
;
53
udword
mNbUsedElements
;
54
SAP_Element*
mElementPool
;
55
SAP_Element*
mFirstFree
;
56
57
udword
mNbObjects
;
58
SAP_Element**
mArray
;
59
// Internal methods
60
SAP_Element* GetFreeElem(
udword
id
, SAP_Element* next,
udword
* remap=
null
);
61
inline_
void
FreeElem(SAP_Element* elem);
62
void
Release();
63
};
64
65
class
OPCODE_API
SweepAndPrune
66
{
67
public
:
68
SweepAndPrune
();
69
~
SweepAndPrune
();
70
71
bool
Init(
udword
nb_objects,
const
AABB
** boxes);
72
bool
UpdateObject(
udword
i
,
const
AABB
&
box
);
73
74
void
GetPairs(
Pairs
& pairs)
const
;
75
void
GetPairs(
PairCallback
callback,
void
* user_data)
const
;
76
private
:
77
SAP_PairData
mPairs
;
78
79
udword
mNbObjects
;
80
SAP_Box*
mBoxes
;
81
SAP_EndPoint* mList[3];
82
// Internal methods
83
bool
CheckListsIntegrity();
84
};
85
86
#endif //__OPC_SWEEPANDPRUNE_H__
SAP_PairData::mNbObjects
udword mNbObjects
Max number of objects we can handle.
Definition:
OPC_SweepAndPrune.h:57
i
png_uint_32 i
Definition:
png.h:2732
box
Definition:
jquant2.c:258
udword
unsigned int udword
sizeof(udword) must be 4
Definition:
IceTypes.h:65
BOOL
int BOOL
Another boolean type.
Definition:
IceTypes.h:102
SAP_PairData::mNbUsedElements
udword mNbUsedElements
Number of used elements.
Definition:
OPC_SweepAndPrune.h:53
SweepAndPrune
Definition:
OPC_SweepAndPrune.h:65
SAP_PairData::mElementPool
SAP_Element * mElementPool
Array of mNbElements elements.
Definition:
OPC_SweepAndPrune.h:54
SAP_PairData
Definition:
OPC_SweepAndPrune.h:38
SAP_PairData::mNbElements
udword mNbElements
Total number of elements in the pool.
Definition:
OPC_SweepAndPrune.h:52
PairCallback
BOOL(* PairCallback)(udword id0, udword id1, void *user_data)
Definition:
OPC_SweepAndPrune.h:32
SweepAndPrune::mNbObjects
udword mNbObjects
Definition:
OPC_SweepAndPrune.h:79
SAP_PairData::mArray
SAP_Element ** mArray
Pointers to pool.
Definition:
OPC_SweepAndPrune.h:58
OPCODE_API
#define OPCODE_API
Definition:
Opcode.h:68
Pairs
Definition:
IcePairs.h:25
SAP_PairData::mFirstFree
SAP_Element * mFirstFree
First free element in the pool.
Definition:
OPC_SweepAndPrune.h:55
SweepAndPrune::mPairs
SAP_PairData mPairs
Definition:
OPC_SweepAndPrune.h:77
inline_
#define inline_
Definition:
IcePreprocessor.h:103
AABB
Definition:
IceAABB.h:267
SweepAndPrune::mBoxes
SAP_Box * mBoxes
Definition:
OPC_SweepAndPrune.h:80
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:04