Panda3D

bulletPersistentManifold.cxx

00001 // Filename: bulletPersistentManifold.cxx
00002 // Created by:  enn0x (07Mar10)
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 #include "bulletPersistentManifold.h"
00016 #include "bulletManifoldPoint.h"
00017 
00018 ////////////////////////////////////////////////////////////////////
00019 //     Function: BulletPersistentManifold::Constructor
00020 //       Access: Public
00021 //  Description:
00022 ////////////////////////////////////////////////////////////////////
00023 BulletPersistentManifold::
00024 BulletPersistentManifold(btPersistentManifold *manifold) : _manifold(manifold) {
00025 
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: BulletPersistentManifold::get_contact_breaking_threshold
00030 //       Access: Published
00031 //  Description:
00032 ////////////////////////////////////////////////////////////////////
00033 PN_stdfloat BulletPersistentManifold::
00034 get_contact_breaking_threshold() const {
00035 
00036   return (PN_stdfloat)_manifold->getContactBreakingThreshold();
00037 }
00038 
00039 ////////////////////////////////////////////////////////////////////
00040 //     Function: BulletPersistentManifold::get_contact_processing_threshold
00041 //       Access: Published
00042 //  Description:
00043 ////////////////////////////////////////////////////////////////////
00044 PN_stdfloat BulletPersistentManifold::
00045 get_contact_processing_threshold() const {
00046 
00047   return (PN_stdfloat)_manifold->getContactProcessingThreshold();
00048 }
00049 
00050 ////////////////////////////////////////////////////////////////////
00051 //     Function: BulletPersistentManifold::set_suspension_stiffness
00052 //       Access: Published
00053 //  Description:
00054 ////////////////////////////////////////////////////////////////////
00055 void BulletPersistentManifold::
00056 clear_manifold() {
00057 
00058   _manifold->clearManifold();
00059 }
00060 
00061 ////////////////////////////////////////////////////////////////////
00062 //     Function: BulletPersistentManifold::get_node0
00063 //       Access: Published
00064 //  Description:
00065 ////////////////////////////////////////////////////////////////////
00066 PandaNode *BulletPersistentManifold::
00067 get_node0() {
00068 
00069   btCollisionObject *obj = static_cast<btCollisionObject *>(_manifold->getBody0());
00070 
00071   return (obj) ? (PandaNode *)obj->getUserPointer(): NULL;
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //     Function: BulletPersistentManifold::get_node1
00076 //       Access: Published
00077 //  Description:
00078 ////////////////////////////////////////////////////////////////////
00079 PandaNode *BulletPersistentManifold::
00080 get_node1() {
00081 
00082   btCollisionObject *obj = static_cast<btCollisionObject *>(_manifold->getBody1());
00083 
00084   return (obj) ? (PandaNode *)obj->getUserPointer(): NULL;
00085 }
00086 
00087 ////////////////////////////////////////////////////////////////////
00088 //     Function: BulletPersistentManifold::get_num_manifold_points
00089 //       Access: Published
00090 //  Description:
00091 ////////////////////////////////////////////////////////////////////
00092 int BulletPersistentManifold::
00093 get_num_manifold_points() const {
00094 
00095   return _manifold->getNumContacts();
00096 }
00097 
00098 ////////////////////////////////////////////////////////////////////
00099 //     Function: BulletPersistentManifold::get_manifold_point
00100 //       Access: Published
00101 //  Description:
00102 ////////////////////////////////////////////////////////////////////
00103 BulletManifoldPoint *BulletPersistentManifold::
00104 get_manifold_point(int idx) const {
00105 
00106   nassertr(idx < _manifold->getNumContacts(), NULL)
00107 
00108   return new BulletManifoldPoint(_manifold->getContactPoint(idx));
00109 }
00110 
 All Classes Functions Variables Enumerations