forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodeCollisionEntry.I
More file actions
103 lines (92 loc) · 2.11 KB
/
odeCollisionEntry.I
File metadata and controls
103 lines (92 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file odeCollisionEntry.I
* @author rdb
* @date 2009-03-13
*/
/**
*
*/
INLINE OdeCollisionEntry::
OdeCollisionEntry() {
}
/**
* Returns the first geom in the collision.
*/
INLINE OdeGeom OdeCollisionEntry::
get_geom1() const {
return OdeGeom(_geom1);
}
/**
* Returns the second geom in the collision.
*/
INLINE OdeGeom OdeCollisionEntry::
get_geom2() const {
return OdeGeom(_geom2);
}
/**
* Returns the first body in the collision.
*/
INLINE OdeBody OdeCollisionEntry::
get_body1() const {
return OdeBody(_body1);
}
/**
* Returns the second body in the collision.
*/
INLINE OdeBody OdeCollisionEntry::
get_body2() const {
return OdeBody(_body2);
}
/**
* Returns the number of contacts in the collision.
*/
INLINE size_t OdeCollisionEntry::
get_num_contacts() const {
return _num_contacts;
}
/**
* Returns the nth contact geom in the collision.
*/
INLINE OdeContactGeom OdeCollisionEntry::
get_contact_geom(size_t n) const {
nassertr(n >= 0 && n < _num_contacts, OdeContactGeom());
return _contact_geoms[n];
}
/**
* Returns the nth contact geom in the collision.
*/
INLINE OdeContactGeom OdeCollisionEntry::
operator [] (size_t n) const {
nassertr(n >= 0 && n < _num_contacts, OdeContactGeom());
return _contact_geoms[n];
}
/**
* Returns the nth contact point in the collision. This does exactly the same
* as get_contact_geom(n).get_pos().
*/
INLINE LPoint3f OdeCollisionEntry::
get_contact_point(size_t n) const {
nassertr(n >= 0 && n < _num_contacts, LPoint3f::zero());
return _contact_geoms[n].get_pos();
}
/**
* An OdeCollisionEntry evaluates to False if it holds no contacts.
*/
INLINE OdeCollisionEntry::
operator bool () const {
return (_num_contacts != 0);
}
/**
* Returns true if the entry holds no contacts.
*/
INLINE bool OdeCollisionEntry::
is_empty() const {
return (_num_contacts == 0);
}