Panda3D

odeSpace.I

00001 // Filename: odeSpace.I
00002 // Created by:  joswilso (27Dec06)
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: OdeSpace::is_empty
00017 //       Access: Published
00018 //  Description: Returns true if the ID is 0, meaning the OdeSpace
00019 //               does not point to a valid space. It is an error to
00020 //               call a method on an empty space.
00021 //               Note that an empty OdeSpace also evaluates to False.
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE bool OdeSpace::
00024 is_empty() const {
00025   return (_id == 0);
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: OdeSpace::get_id
00030 //       Access: Published
00031 //  Description: Returns the underlying dSpaceID.
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE dSpaceID OdeSpace::
00034 get_id() const {
00035   return _id;
00036 }
00037 
00038 INLINE void OdeSpace::
00039 set_cleanup(int mode) {
00040   dSpaceSetCleanup(_id, mode);
00041 }
00042 
00043 INLINE int OdeSpace::
00044 get_cleanup() const {
00045   return dSpaceGetCleanup(_id);
00046 }
00047 
00048 INLINE int OdeSpace::
00049 get_num_geoms() const {
00050   return dSpaceGetNumGeoms(_id);
00051 }
00052 
00053 INLINE OdeSpace OdeSpace::
00054 get_space() const {
00055   return OdeSpace(dGeomGetSpace((dGeomID)_id));
00056 }
00057 
00058 INLINE void OdeSpace::
00059 get_AABB(LVecBase3f &min, LVecBase3f &max) const {
00060   dReal result[6];
00061   dGeomGetAABB((dGeomID)_id, result);
00062   min.set(result[0], result[2], result[4]);
00063   max.set(result[1], result[3], result[5]);
00064 }
00065 
00066 INLINE int OdeSpace::
00067 is_space() {
00068   return dGeomIsSpace((dGeomID)_id);
00069 }
00070 
00071 INLINE int OdeSpace::
00072 get_class() const {
00073   return dGeomGetClass((dGeomID)_id);
00074 }
00075 
00076 INLINE void OdeSpace::
00077 set_category_bits(const BitMask32 &bits) {
00078   dGeomSetCategoryBits((dGeomID)_id, bits.get_word());
00079 }
00080 
00081 INLINE void OdeSpace::
00082 set_collide_bits(const BitMask32 &bits) {
00083   dGeomSetCollideBits((dGeomID)_id, bits.get_word());
00084 }
00085 
00086 INLINE BitMask32 OdeSpace::
00087 get_category_bits() {
00088   return BitMask32(dGeomGetCategoryBits((dGeomID)_id));
00089 }
00090 
00091 INLINE BitMask32 OdeSpace::
00092 get_collide_bits() {
00093   return BitMask32(dGeomGetCollideBits((dGeomID)_id));
00094 }
00095 
00096 INLINE void OdeSpace::
00097 enable() {
00098   dGeomEnable((dGeomID)_id);
00099 }
00100 
00101 INLINE void OdeSpace::
00102 disable() {
00103   dGeomDisable((dGeomID)_id);
00104 }
00105 
00106 INLINE int OdeSpace::
00107 is_enabled() {
00108   return dGeomIsEnabled((dGeomID)_id);
00109 }
00110 
00111 INLINE void OdeSpace::
00112 set_collision_event(const string &event_name) {
00113   _collision_event = event_name;
00114 }
00115 
00116 INLINE string OdeSpace::
00117 get_collision_event() {
00118   return _collision_event;
00119 }
00120 
 All Classes Functions Variables Enumerations