Panda3D
 All Classes Functions Variables Enumerations
odeCollisionEntry.I
00001 // Filename: odeCollisionEntry.cxx
00002 // Created by:  pro-rsoft (13Mar09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 ////////////////////////////////////////////////////////////////////
00016 //     Function: OdeCollisionEntry::Constructor
00017 //       Access: Private
00018 //  Description: 
00019 ////////////////////////////////////////////////////////////////////
00020 INLINE OdeCollisionEntry::
00021 OdeCollisionEntry() {
00022 }
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: OdeCollisionEntry::get_geom1
00026 //       Access: Published
00027 //  Description: Returns the first geom in the collision.
00028 ////////////////////////////////////////////////////////////////////
00029 INLINE OdeGeom OdeCollisionEntry::
00030 get_geom1() const {
00031   return OdeGeom(_geom1);
00032 }
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //     Function: OdeCollisionEntry::get_geom2
00036 //       Access: Published
00037 //  Description: Returns the second geom in the collision.
00038 ////////////////////////////////////////////////////////////////////
00039 INLINE OdeGeom OdeCollisionEntry::
00040 get_geom2() const {
00041   return OdeGeom(_geom2);
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: OdeCollisionEntry::get_body1
00046 //       Access: Published
00047 //  Description: Returns the first body in the collision.
00048 ////////////////////////////////////////////////////////////////////
00049 INLINE OdeBody OdeCollisionEntry::
00050 get_body1() const {
00051   return OdeBody(_body1);
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: OdeCollisionEntry::get_body2
00056 //       Access: Published
00057 //  Description: Returns the second body in the collision.
00058 ////////////////////////////////////////////////////////////////////
00059 INLINE OdeBody OdeCollisionEntry::
00060 get_body2() const {
00061   return OdeBody(_body2);
00062 }
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 //     Function: OdeCollisionEntry::get_num_contacts
00066 //       Access: Published
00067 //  Description: Returns the number of contacts in the collision.
00068 ////////////////////////////////////////////////////////////////////
00069 INLINE size_t OdeCollisionEntry::
00070 get_num_contacts() const {
00071   return _num_contacts;
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //     Function: OdeCollisionEntry::get_contact_geom
00076 //       Access: Published
00077 //  Description: Returns the nth contact geom in the collision.
00078 ////////////////////////////////////////////////////////////////////
00079 INLINE OdeContactGeom OdeCollisionEntry::
00080 get_contact_geom(size_t n) const {
00081   nassertr(n >= 0 && n < _num_contacts, OdeContactGeom());
00082   return _contact_geoms[n];
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: OdeCollisionEntry::operator []
00087 //       Access: Published
00088 //  Description: Returns the nth contact geom in the collision.
00089 ////////////////////////////////////////////////////////////////////
00090 INLINE OdeContactGeom OdeCollisionEntry::
00091 operator [] (size_t n) const {
00092   nassertr(n >= 0 && n < _num_contacts, OdeContactGeom());
00093   return _contact_geoms[n];
00094 }
00095 
00096 ////////////////////////////////////////////////////////////////////
00097 //     Function: OdeCollisionEntry::get_contact_point
00098 //       Access: Published
00099 //  Description: Returns the nth contact point in the collision.
00100 //               This does exactly the same as
00101 //               get_contact_geom(n).get_pos().
00102 ////////////////////////////////////////////////////////////////////
00103 INLINE LPoint3f OdeCollisionEntry::
00104 get_contact_point(size_t n) const {
00105   nassertr(n >= 0 && n < _num_contacts, LPoint3f::zero());
00106   return _contact_geoms[n].get_pos();
00107 }
00108 
00109 ////////////////////////////////////////////////////////////////////
00110 //     Function: OdeCollisionEntry::operator bool
00111 //       Access: Published
00112 //  Description: An OdeCollisionEntry evaluates to False if it
00113 //               holds no contacts.
00114 ////////////////////////////////////////////////////////////////////
00115 INLINE OdeCollisionEntry::
00116 operator bool () const {
00117   return (_num_contacts != 0);
00118 }
00119 
00120 ////////////////////////////////////////////////////////////////////
00121 //     Function: OdeCollisionEntry::is_empty
00122 //       Access: Published
00123 //  Description: Returns true if the entry holds no contacts.
00124 ////////////////////////////////////////////////////////////////////
00125 INLINE bool OdeCollisionEntry::
00126 is_empty() const {
00127   return (_num_contacts == 0);
00128 }
00129 
 All Classes Functions Variables Enumerations