Browse Source

Exposed additional member of btManifoldPoint

enn0x 13 years ago
parent
commit
a762ee42f4

+ 277 - 0
panda/src/bullet/bulletManifoldPoint.I

@@ -22,3 +22,280 @@ INLINE BulletManifoldPoint::
 
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::is_const
+//       Access: Published
+//  Description: Returns TRUE if this instance of BulletManifoldPoint
+//               can not be modified.
+////////////////////////////////////////////////////////////////////
+INLINE bool BulletManifoldPoint::
+is_const() const {
+
+  return _const;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_lateral_friction_initialized
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_lateral_friction_initialized(bool value) {
+
+  nassertv(!_const);
+  _pt.m_lateralFrictionInitialized = value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_lateral_friction_initialized
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE bool BulletManifoldPoint::
+get_lateral_friction_initialized() const {
+
+  return _pt.m_lateralFrictionInitialized;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_lateral_friction_dir1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_lateral_friction_dir1(const LVecBase3 &dir) {
+
+  nassertv(!_const);
+  _pt.m_lateralFrictionDir1 = LVecBase3_to_btVector3(dir);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_lateral_friction_dir1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE LVector3 BulletManifoldPoint::
+get_lateral_friction_dir1() const {
+
+  return btVector3_to_LVector3(_pt.m_lateralFrictionDir1);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_lateral_friction_dir2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_lateral_friction_dir2(const LVecBase3 &dir) {
+
+  nassertv(!_const);
+  _pt.m_lateralFrictionDir2 = LVecBase3_to_btVector3(dir);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_lateral_friction_dir2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE LVector3 BulletManifoldPoint::
+get_lateral_friction_dir2() const {
+
+  return btVector3_to_LVector3(_pt.m_lateralFrictionDir2);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_contact_motion1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_contact_motion1(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_contactMotion1 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_contact_motion1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_contact_motion1() const {
+
+  return (PN_stdfloat)_pt.m_contactMotion1;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_contact_motion2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_contact_motion2(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_contactMotion2 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_contact_motion2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_contact_motion2() const {
+
+  return (PN_stdfloat)_pt.m_contactMotion2;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_combined_friction
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_combined_friction(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_combinedFriction = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_combined_friction
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_combined_friction() const {
+
+  return (PN_stdfloat)_pt.m_combinedFriction;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_combined_restitution
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_combined_restitution(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_combinedRestitution = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_combined_restitution
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_combined_restitution() const {
+
+  return (PN_stdfloat)_pt.m_combinedRestitution;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_applied_impulse
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_applied_impulse(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_appliedImpulse = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_applied_impulse_lateral1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_applied_impulse_lateral1(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_appliedImpulseLateral1 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_applied_impulse_lateral1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_applied_impulse_lateral1() const {
+
+  return (PN_stdfloat)_pt.m_appliedImpulseLateral1;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_applied_impulse_lateral2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_applied_impulse_lateral2(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_appliedImpulseLateral2 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_applied_impulse_lateral2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_applied_impulse_lateral2() const {
+
+  return (PN_stdfloat)_pt.m_appliedImpulseLateral2;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_contact_cfm1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_contact_cfm1(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_contactCFM1 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_contact_cfm1
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_contact_cfm1() const {
+
+  return (PN_stdfloat)_pt.m_contactCFM1;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::set_contact_cfm2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletManifoldPoint::
+set_contact_cfm2(PN_stdfloat value) {
+
+  nassertv(!_const);
+  _pt.m_contactCFM2 = (btScalar)value;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_contact_cfm2
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE PN_stdfloat BulletManifoldPoint::
+get_contact_cfm2() const {
+
+  return (PN_stdfloat)_pt.m_contactCFM2;
+}
+

+ 25 - 1
panda/src/bullet/bulletManifoldPoint.cxx

@@ -20,10 +20,23 @@
 //  Description:
 ////////////////////////////////////////////////////////////////////
 BulletManifoldPoint::
-BulletManifoldPoint(const btManifoldPoint &pt) : _pt(pt) {
+BulletManifoldPoint(btManifoldPoint &pt) 
+ : _pt(pt), _const(false) {
 
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::Constructor
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+BulletManifoldPoint::
+BulletManifoldPoint(const btManifoldPoint &pt) {
+
+  _pt = (btManifoldPoint &)pt;
+  _const = true;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletManifoldPoint::get_lift_time
 //       Access: Published
@@ -79,6 +92,17 @@ get_position_world_on_b() const {
   return btVector3_to_LPoint3(_pt.getPositionWorldOnB());
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletManifoldPoint::get_normal_world_on_b
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+LPoint3 BulletManifoldPoint::
+get_normal_world_on_b() const {
+
+  return btVector3_to_LPoint3(_pt.m_normalWorldOnB);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletManifoldPoint::get_local_point_a
 //       Access: Published

+ 31 - 1
panda/src/bullet/bulletManifoldPoint.h

@@ -36,6 +36,7 @@ PUBLISHED:
   PN_stdfloat get_applied_impulse() const;
   LPoint3 get_position_world_on_a() const;
   LPoint3 get_position_world_on_b() const;
+  LPoint3 get_normal_world_on_b() const;
   LPoint3 get_local_point_a() const;
   LPoint3 get_local_point_b() const;
 
@@ -44,11 +45,40 @@ PUBLISHED:
   int get_index0() const;
   int get_index1() const;
 
+  INLINE bool is_const() const;
+
+  INLINE void set_lateral_friction_initialized(bool value);
+  INLINE void set_lateral_friction_dir1(const LVecBase3 &dir);
+  INLINE void set_lateral_friction_dir2(const LVecBase3 &dir);
+  INLINE void set_contact_motion1(PN_stdfloat value);
+  INLINE void set_contact_motion2(PN_stdfloat value);
+  INLINE void set_combined_friction(PN_stdfloat value);
+  INLINE void set_combined_restitution(PN_stdfloat value);
+  INLINE void set_applied_impulse(PN_stdfloat value);
+  INLINE void set_applied_impulse_lateral1(PN_stdfloat value);
+  INLINE void set_applied_impulse_lateral2(PN_stdfloat value);
+  INLINE void set_contact_cfm1(PN_stdfloat value);
+  INLINE void set_contact_cfm2(PN_stdfloat value);
+
+  INLINE bool get_lateral_friction_initialized() const;
+  INLINE LVector3 get_lateral_friction_dir1() const;
+  INLINE LVector3 get_lateral_friction_dir2() const;
+  INLINE PN_stdfloat get_contact_motion1() const;
+  INLINE PN_stdfloat get_contact_motion2() const;
+  INLINE PN_stdfloat get_combined_friction() const;
+  INLINE PN_stdfloat get_combined_restitution() const;
+  INLINE PN_stdfloat get_applied_impulse_lateral1() const;
+  INLINE PN_stdfloat get_applied_impulse_lateral2() const;
+  INLINE PN_stdfloat get_contact_cfm1() const;
+  INLINE PN_stdfloat get_contact_cfm2() const;
+
 public:
   BulletManifoldPoint(const btManifoldPoint &pt);
+  BulletManifoldPoint(btManifoldPoint &pt);
 
 private:
-  const btManifoldPoint _pt;
+  btManifoldPoint _pt;
+  bool _const;
 };
 
 #include "bulletManifoldPoint.I"