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