added get_AABB functionality

This commit is contained in:
Josh Wilson 2007-02-11 07:57:32 +00:00
parent a80d9f95ba
commit 15c717ad3f
8 changed files with 53 additions and 10 deletions

View File

@ -33,3 +33,12 @@ def getConvertedSpace(self):
"""
"""
return self.getSpace().convert()
def getAABounds(self):
"""
A more Pythonic way of calling getAABB().
"""
min = Point3()
max = Point3()
self.getAABB(min,max)
return min,max

View File

@ -21,3 +21,12 @@ def getConvertedSpace(self):
"""
"""
return self.getSpace().convert()
def getAABounds(self):
"""
A more Pythonic way of calling getAABB()
"""
min = Point3()
max = Point3()
self.getAABB(min,max)
return min,max

View File

@ -50,3 +50,15 @@ def getConvertedSpace(self):
return self.getSpace().convert()
Dtool_funcToMethod(getConvertedSpace, OdeGeom)
del getConvertedSpace
def getAABounds(self):
"""
A more Pythonic way of calling getAABB()
"""
min = Point3()
max = Point3()
self.getAABB(min,max)
return min,max
Dtool_funcToMethod(getAABounds, OdeGeom)
del getAABounds

View File

@ -41,3 +41,14 @@ def getConvertedSpace(self):
Dtool_funcToMethod(getConvertedSpace, OdeSpace)
del getConvertedSpace
def getAABounds(self):
"""
A more Pythonic way of calling getAABB()
"""
min = Point3()
max = Point3()
self.getAABB(min,max)
return min,max
Dtool_funcToMethod(getAABounds, OdeSpace)
del getAABounds

View File

@ -83,12 +83,13 @@ get_quaternion() const {
return LQuaternionf(res[0], res[1], res[2], res[3]);
}
/*
INLINE void OdeGeom::
get_aabb(dReal aabb[6]) const {
return dGeomGetAABB(_id, aabb[6]);
get_AABB(LVecBase3f &min, LVecBase3f &max) const {
dReal result[6];
dGeomGetAABB(_id, result);
min.set(result[0], result[2], result[4]);
max.set(result[1], result[3], result[5]);
}
*/
INLINE int OdeGeom::
is_space() {

View File

@ -82,7 +82,7 @@ PUBLISHED:
INLINE LPoint3f get_position() const;
INLINE LMatrix3f get_rotation() const;
INLINE LQuaternionf get_quaternion() const;
//INLINE void get_aabb(dReal aabb[6]) const;
INLINE void get_AABB(LVecBase3f &min, LVecBase3f &max) const;
INLINE int is_space();
INLINE int get_class() const;
INLINE void set_category_bits(const BitMask32 &bits);

View File

@ -42,12 +42,13 @@ get_space() const {
return OdeSpace(dGeomGetSpace((dGeomID)_id));
}
/*
INLINE void OdeSpace::
get_aabb(dReal aabb[6]) const {
return dGeomGetAABB((dGeomID)_id, aabb[6]);
get_AABB(LVecBase3f &min, LVecBase3f &max) const {
dReal result[6];
dGeomGetAABB((dGeomID)_id, result);
min.set(result[0], result[2], result[4]);
max.set(result[1], result[3], result[5]);
}
*/
INLINE int OdeSpace::
is_space() {

View File

@ -51,7 +51,7 @@ PUBLISHED:
INLINE int query(const OdeGeom& geom) const;
INLINE int query(const OdeSpace& space) const;
INLINE int get_num_geoms() const;
// INLINE void get_aabb() const;
INLINE void get_AABB(LVecBase3f &min, LVecBase3f &max) const;
INLINE int is_space();
INLINE int get_class() const;
INLINE void set_category_bits(const BitMask32 &bits);