Explorar o código

Refactor debug names, this time using C++ strings

enn0x %!s(int64=15) %!d(string=hai) anos
pai
achega
955b03dff9
Modificáronse 100 ficheiros con 158 adicións e 166 borrados
  1. 1 5
      panda/src/physx/physxActor.I
  2. 4 4
      panda/src/physx/physxActor.cxx
  3. 1 1
      panda/src/physx/physxActor.h
  4. 2 3
      panda/src/physx/physxActorDesc.I
  5. 2 3
      panda/src/physx/physxActorDesc.cxx
  6. 3 1
      panda/src/physx/physxActorDesc.h
  7. 0 1
      panda/src/physx/physxBoxForceFieldShape.I
  8. 2 0
      panda/src/physx/physxBoxForceFieldShape.cxx
  9. 2 1
      panda/src/physx/physxBoxForceFieldShapeDesc.I
  10. 0 1
      panda/src/physx/physxBoxShape.I
  11. 2 0
      panda/src/physx/physxBoxShape.cxx
  12. 1 1
      panda/src/physx/physxBoxShapeDesc.I
  13. 0 1
      panda/src/physx/physxCapsuleForceFieldShape.I
  14. 2 0
      panda/src/physx/physxCapsuleForceFieldShape.cxx
  15. 2 1
      panda/src/physx/physxCapsuleForceFieldShapeDesc.I
  16. 0 1
      panda/src/physx/physxCapsuleShape.I
  17. 2 0
      panda/src/physx/physxCapsuleShape.cxx
  18. 1 1
      panda/src/physx/physxCapsuleShapeDesc.I
  19. 4 8
      panda/src/physx/physxCloth.I
  20. 6 5
      panda/src/physx/physxCloth.cxx
  21. 1 1
      panda/src/physx/physxCloth.h
  22. 2 3
      panda/src/physx/physxClothDesc.I
  23. 2 3
      panda/src/physx/physxClothDesc.cxx
  24. 3 1
      panda/src/physx/physxClothDesc.h
  25. 0 1
      panda/src/physx/physxConvexForceFieldShape.I
  26. 2 0
      panda/src/physx/physxConvexForceFieldShape.cxx
  27. 2 1
      panda/src/physx/physxConvexForceFieldShapeDesc.I
  28. 0 1
      panda/src/physx/physxConvexShape.I
  29. 2 0
      panda/src/physx/physxConvexShape.cxx
  30. 1 1
      panda/src/physx/physxConvexShapeDesc.I
  31. 0 1
      panda/src/physx/physxCylindricalJoint.I
  32. 2 0
      panda/src/physx/physxCylindricalJoint.cxx
  33. 2 1
      panda/src/physx/physxCylindricalJointDesc.I
  34. 0 1
      panda/src/physx/physxD6Joint.I
  35. 2 0
      panda/src/physx/physxD6Joint.cxx
  36. 2 1
      panda/src/physx/physxD6JointDesc.I
  37. 0 1
      panda/src/physx/physxDistanceJoint.I
  38. 2 0
      panda/src/physx/physxDistanceJoint.cxx
  39. 2 1
      panda/src/physx/physxDistanceJointDesc.I
  40. 0 1
      panda/src/physx/physxFixedJoint.I
  41. 2 0
      panda/src/physx/physxFixedJoint.cxx
  42. 2 1
      panda/src/physx/physxFixedJointDesc.I
  43. 1 5
      panda/src/physx/physxForceField.I
  44. 6 5
      panda/src/physx/physxForceField.cxx
  45. 1 1
      panda/src/physx/physxForceField.h
  46. 1 2
      panda/src/physx/physxForceFieldDesc.I
  47. 2 3
      panda/src/physx/physxForceFieldDesc.cxx
  48. 2 1
      panda/src/physx/physxForceFieldDesc.h
  49. 1 4
      panda/src/physx/physxForceFieldShape.I
  50. 2 3
      panda/src/physx/physxForceFieldShape.cxx
  51. 2 1
      panda/src/physx/physxForceFieldShape.h
  52. 0 2
      panda/src/physx/physxForceFieldShapeDesc.I
  53. 2 3
      panda/src/physx/physxForceFieldShapeDesc.cxx
  54. 3 1
      panda/src/physx/physxForceFieldShapeDesc.h
  55. 1 5
      panda/src/physx/physxForceFieldShapeGroup.I
  56. 4 4
      panda/src/physx/physxForceFieldShapeGroup.cxx
  57. 1 1
      panda/src/physx/physxForceFieldShapeGroup.h
  58. 2 2
      panda/src/physx/physxForceFieldShapeGroupDesc.I
  59. 2 3
      panda/src/physx/physxForceFieldShapeGroupDesc.cxx
  60. 3 1
      panda/src/physx/physxForceFieldShapeGroupDesc.h
  61. 0 1
      panda/src/physx/physxHeightFieldShape.I
  62. 2 0
      panda/src/physx/physxHeightFieldShape.cxx
  63. 1 2
      panda/src/physx/physxHeightFieldShapeDesc.cxx
  64. 1 4
      panda/src/physx/physxJoint.I
  65. 2 3
      panda/src/physx/physxJoint.cxx
  66. 2 1
      panda/src/physx/physxJoint.h
  67. 0 2
      panda/src/physx/physxJointDesc.I
  68. 2 3
      panda/src/physx/physxJointDesc.cxx
  69. 3 1
      panda/src/physx/physxJointDesc.h
  70. 0 1
      panda/src/physx/physxPlaneShape.I
  71. 2 0
      panda/src/physx/physxPlaneShape.cxx
  72. 1 1
      panda/src/physx/physxPlaneShapeDesc.I
  73. 0 1
      panda/src/physx/physxPointInPlaneJoint.I
  74. 2 0
      panda/src/physx/physxPointInPlaneJoint.cxx
  75. 2 1
      panda/src/physx/physxPointInPlaneJointDesc.I
  76. 0 1
      panda/src/physx/physxPointOnLineJoint.I
  77. 2 0
      panda/src/physx/physxPointOnLineJoint.cxx
  78. 2 1
      panda/src/physx/physxPointOnLineJointDesc.I
  79. 0 1
      panda/src/physx/physxPrismaticJoint.I
  80. 2 0
      panda/src/physx/physxPrismaticJoint.cxx
  81. 2 1
      panda/src/physx/physxPrismaticJointDesc.I
  82. 0 1
      panda/src/physx/physxPulleyJoint.I
  83. 2 0
      panda/src/physx/physxPulleyJoint.cxx
  84. 2 1
      panda/src/physx/physxPulleyJointDesc.I
  85. 2 0
      panda/src/physx/physxRevoluteJoint.cxx
  86. 2 1
      panda/src/physx/physxRevoluteJointDesc.I
  87. 1 14
      panda/src/physx/physxScene.cxx
  88. 1 4
      panda/src/physx/physxShape.I
  89. 2 3
      panda/src/physx/physxShape.cxx
  90. 2 1
      panda/src/physx/physxShape.h
  91. 0 2
      panda/src/physx/physxShapeDesc.I
  92. 2 3
      panda/src/physx/physxShapeDesc.cxx
  93. 3 1
      panda/src/physx/physxShapeDesc.h
  94. 0 1
      panda/src/physx/physxSphereForceFieldShape.I
  95. 2 0
      panda/src/physx/physxSphereForceFieldShape.cxx
  96. 2 1
      panda/src/physx/physxSphereForceFieldShapeDesc.I
  97. 0 1
      panda/src/physx/physxSphereShape.I
  98. 2 0
      panda/src/physx/physxSphereShape.cxx
  99. 1 1
      panda/src/physx/physxSphereShapeDesc.I
  100. 0 1
      panda/src/physx/physxSphericalJoint.I

+ 1 - 5
panda/src/physx/physxActor.I

@@ -22,7 +22,6 @@
 INLINE PhysxActor::
 INLINE PhysxActor::
 PhysxActor() : PhysxObject() {
 PhysxActor() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +32,6 @@ PhysxActor() : PhysxObject() {
 INLINE PhysxActor::
 INLINE PhysxActor::
 ~PhysxActor() {
 ~PhysxActor() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -55,10 +53,8 @@ ls() const {
 INLINE void PhysxActor::
 INLINE void PhysxActor::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")";
                             << " (at 0x" << this << ")";
 
 
   if (!_np.is_empty()) {
   if (!_np.is_empty()) {

+ 4 - 4
panda/src/physx/physxActor.cxx

@@ -33,6 +33,8 @@ link(NxActor *actorPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(actorPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_actors.add(this);
   scene->_actors.add(this);
 
 
@@ -136,9 +138,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  _ptr->setName(_name);
+  _name = name ? name : "";
+  _ptr->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -401,7 +402,6 @@ create_shape(PhysxShapeDesc &desc) {
   nassertr(shapePtr, NULL);
   nassertr(shapePtr, NULL);
 
 
   shape->link(shapePtr);
   shape->link(shapePtr);
-  shape->set_name(desc.ptr()->name);
 
 
   return shape;
   return shape;
 }
 }

+ 1 - 1
panda/src/physx/physxActor.h

@@ -197,7 +197,7 @@ private:
   NxActor *_ptr;
   NxActor *_ptr;
   NodePath _np;
   NodePath _np;
   PT(PhysxController) _controller;
   PT(PhysxController) _controller;
-  char *_name;
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 2 - 3
panda/src/physx/physxActorDesc.I

@@ -22,8 +22,7 @@
 INLINE PhysxActorDesc::
 INLINE PhysxActorDesc::
 PhysxActorDesc() {
 PhysxActorDesc() {
 
 
-  _name = NULL;
-  _desc.name = _name;
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -34,7 +33,6 @@ PhysxActorDesc() {
 INLINE PhysxActorDesc::
 INLINE PhysxActorDesc::
 ~PhysxActorDesc() {
 ~PhysxActorDesc() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -46,6 +44,7 @@ INLINE void PhysxActorDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 3
panda/src/physx/physxActorDesc.cxx

@@ -36,9 +36,8 @@ add_shape(PhysxShapeDesc &desc) {
 void PhysxActorDesc::
 void PhysxActorDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  _desc.name = _name;
+  _name = name ? name : "";
+  _desc.name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxActorDesc.h

@@ -54,7 +54,9 @@ PUBLISHED:
 
 
 public:
 public:
   NxActorDesc _desc;
   NxActorDesc _desc;
-  char *_name;
+
+private:
+  string _name;
 };
 };
 
 
 #include "physxActorDesc.I"
 #include "physxActorDesc.I"

+ 0 - 1
panda/src/physx/physxBoxForceFieldShape.I

@@ -32,6 +32,5 @@ PhysxBoxForceFieldShape() : PhysxForceFieldShape() {
 INLINE PhysxBoxForceFieldShape::
 INLINE PhysxBoxForceFieldShape::
 ~PhysxBoxForceFieldShape() {
 ~PhysxBoxForceFieldShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxBoxForceFieldShape.cxx

@@ -30,6 +30,8 @@ link(NxForceFieldShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   group->_shapes.add(this);
   group->_shapes.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxBoxForceFieldShapeDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxBoxForceFieldShapeDesc::
 INLINE PhysxBoxForceFieldShapeDesc::
 PhysxBoxForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 PhysxBoxForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxBoxForceFieldShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxBoxShape.I

@@ -32,6 +32,5 @@ PhysxBoxShape() : PhysxShape() {
 INLINE PhysxBoxShape::
 INLINE PhysxBoxShape::
 ~PhysxBoxShape() {
 ~PhysxBoxShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxBoxShape.cxx

@@ -30,6 +30,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 1
panda/src/physx/physxBoxShapeDesc.I

@@ -44,7 +44,7 @@ INLINE void PhysxBoxShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-  _desc.name = _name;
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxCapsuleForceFieldShape.I

@@ -32,6 +32,5 @@ PhysxCapsuleForceFieldShape() : PhysxForceFieldShape() {
 INLINE PhysxCapsuleForceFieldShape::
 INLINE PhysxCapsuleForceFieldShape::
 ~PhysxCapsuleForceFieldShape() {
 ~PhysxCapsuleForceFieldShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxCapsuleForceFieldShape.cxx

@@ -29,6 +29,8 @@ link(NxForceFieldShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   group->_shapes.add(this);
   group->_shapes.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxCapsuleForceFieldShapeDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxCapsuleForceFieldShapeDesc::
 INLINE PhysxCapsuleForceFieldShapeDesc::
 PhysxCapsuleForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 PhysxCapsuleForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxCapsuleForceFieldShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxCapsuleShape.I

@@ -32,6 +32,5 @@ PhysxCapsuleShape() : PhysxShape() {
 INLINE PhysxCapsuleShape::
 INLINE PhysxCapsuleShape::
 ~PhysxCapsuleShape() {
 ~PhysxCapsuleShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxCapsuleShape.cxx

@@ -29,6 +29,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 1
panda/src/physx/physxCapsuleShapeDesc.I

@@ -44,7 +44,7 @@ INLINE void PhysxCapsuleShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-  _desc.name = _name;
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 4 - 8
panda/src/physx/physxCloth.I

@@ -22,7 +22,6 @@
 INLINE PhysxCloth::
 INLINE PhysxCloth::
 PhysxCloth() : PhysxObject() {
 PhysxCloth() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +32,6 @@ PhysxCloth() : PhysxObject() {
 INLINE PhysxCloth::
 INLINE PhysxCloth::
 ~PhysxCloth() {
 ~PhysxCloth() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -55,15 +53,13 @@ ls() const {
 INLINE void PhysxCloth::
 INLINE void PhysxCloth::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")";
                             << " (at 0x" << this << ")";
 
 
-  //if (_node) {
-  //  " N:0x" << _node;
-  //}
+  if (_node) {
+    out << " N:0x" << _node;
+  }
 
 
   out << "\n";
   out << "\n";
 }
 }

+ 6 - 5
panda/src/physx/physxCloth.cxx

@@ -29,13 +29,15 @@ TypeHandle PhysxCloth::_type_handle;
 //  Description: 
 //  Description: 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PhysxCloth::
 void PhysxCloth::
-link(NxCloth *ptr) {
+link(NxCloth *clothPtr) {
 
 
   // Link self
   // Link self
-  _ptr = ptr;
+  _ptr = clothPtr;
   _error_type = ET_ok;
   _error_type = ET_ok;
   _ptr->userData = this;
   _ptr->userData = this;
 
 
+  set_name(clothPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_cloths.add(this);
   scene->_cloths.add(this);
 }
 }
@@ -146,9 +148,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  _ptr->setName(_name);
+  _name = name ? name : "";
+  _ptr->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/physx/physxCloth.h

@@ -108,7 +108,7 @@ public:
 private:
 private:
   NxCloth *_ptr;
   NxCloth *_ptr;
   PT(PhysxClothNode) _node;
   PT(PhysxClothNode) _node;
-  char *_name;
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 2 - 3
panda/src/physx/physxClothDesc.I

@@ -22,8 +22,7 @@
 INLINE PhysxClothDesc::
 INLINE PhysxClothDesc::
 PhysxClothDesc() {
 PhysxClothDesc() {
 
 
-  _name = NULL;
-  _desc.name = _name;
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -34,7 +33,6 @@ PhysxClothDesc() {
 INLINE PhysxClothDesc::
 INLINE PhysxClothDesc::
 ~PhysxClothDesc() {
 ~PhysxClothDesc() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -46,6 +44,7 @@ INLINE void PhysxClothDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 3
panda/src/physx/physxClothDesc.cxx

@@ -24,9 +24,8 @@
 void PhysxClothDesc::
 void PhysxClothDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  _desc.name = _name;
+  _name = name ? name : "";
+  _desc.name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxClothDesc.h

@@ -70,7 +70,9 @@ PUBLISHED:
 
 
 public:
 public:
   NxClothDesc _desc;
   NxClothDesc _desc;
-  char *_name;  
+
+private:
+  string _name;  
 };
 };
 
 
 #include "physxClothDesc.I"
 #include "physxClothDesc.I"

+ 0 - 1
panda/src/physx/physxConvexForceFieldShape.I

@@ -32,6 +32,5 @@ PhysxConvexForceFieldShape() : PhysxForceFieldShape() {
 INLINE PhysxConvexForceFieldShape::
 INLINE PhysxConvexForceFieldShape::
 ~PhysxConvexForceFieldShape() {
 ~PhysxConvexForceFieldShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxConvexForceFieldShape.cxx

@@ -29,6 +29,8 @@ link(NxForceFieldShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   group->_shapes.add(this);
   group->_shapes.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxConvexForceFieldShapeDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxConvexForceFieldShapeDesc::
 INLINE PhysxConvexForceFieldShapeDesc::
 PhysxConvexForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 PhysxConvexForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxConvexForceFieldShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxConvexShape.I

@@ -32,6 +32,5 @@ PhysxConvexShape() : PhysxShape() {
 INLINE PhysxConvexShape::
 INLINE PhysxConvexShape::
 ~PhysxConvexShape() {
 ~PhysxConvexShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxConvexShape.cxx

@@ -29,6 +29,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 1
panda/src/physx/physxConvexShapeDesc.I

@@ -44,7 +44,7 @@ INLINE void PhysxConvexShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-  _desc.name = _name;
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxCylindricalJoint.I

@@ -32,6 +32,5 @@ PhysxCylindricalJoint() : PhysxJoint() {
 INLINE PhysxCylindricalJoint::
 INLINE PhysxCylindricalJoint::
 ~PhysxCylindricalJoint() {
 ~PhysxCylindricalJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxCylindricalJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxCylindricalJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxCylindricalJointDesc::
 INLINE PhysxCylindricalJointDesc::
 PhysxCylindricalJointDesc() : PhysxJointDesc() {
 PhysxCylindricalJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxCylindricalJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxD6Joint.I

@@ -32,6 +32,5 @@ PhysxD6Joint() : PhysxJoint() {
 INLINE PhysxD6Joint::
 INLINE PhysxD6Joint::
 ~PhysxD6Joint() {
 ~PhysxD6Joint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxD6Joint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxD6JointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxD6JointDesc::
 INLINE PhysxD6JointDesc::
 PhysxD6JointDesc() : PhysxJointDesc() {
 PhysxD6JointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxD6JointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxDistanceJoint.I

@@ -32,6 +32,5 @@ PhysxDistanceJoint() : PhysxJoint() {
 INLINE PhysxDistanceJoint::
 INLINE PhysxDistanceJoint::
 ~PhysxDistanceJoint() {
 ~PhysxDistanceJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxDistanceJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxDistanceJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxDistanceJointDesc::
 INLINE PhysxDistanceJointDesc::
 PhysxDistanceJointDesc() : PhysxJointDesc() {
 PhysxDistanceJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxDistanceJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxFixedJoint.I

@@ -32,6 +32,5 @@ PhysxFixedJoint() : PhysxJoint() {
 INLINE PhysxFixedJoint::
 INLINE PhysxFixedJoint::
 ~PhysxFixedJoint() {
 ~PhysxFixedJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxFixedJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxFixedJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxFixedJointDesc::
 INLINE PhysxFixedJointDesc::
 PhysxFixedJointDesc() : PhysxJointDesc() {
 PhysxFixedJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxFixedJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 5
panda/src/physx/physxForceField.I

@@ -22,7 +22,6 @@
 INLINE PhysxForceField::
 INLINE PhysxForceField::
 PhysxForceField() : PhysxObject() {
 PhysxForceField() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +32,6 @@ PhysxForceField() : PhysxObject() {
 INLINE PhysxForceField::
 INLINE PhysxForceField::
 ~PhysxForceField() {
 ~PhysxForceField() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -55,10 +53,8 @@ ls() const {
 INLINE void PhysxForceField::
 INLINE void PhysxForceField::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")\n";
                             << " (at 0x" << this << ")\n";
 }
 }
 
 

+ 6 - 5
panda/src/physx/physxForceField.cxx

@@ -25,13 +25,15 @@ TypeHandle PhysxForceField::_type_handle;
 //  Description: 
 //  Description: 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PhysxForceField::
 void PhysxForceField::
-link(NxForceField *materialPtr) {
+link(NxForceField *fieldPtr) {
 
 
   // Link self
   // Link self
-  _ptr = materialPtr;
+  _ptr = fieldPtr;
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(fieldPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_forcefields.add(this);
   scene->_forcefields.add(this);
 
 
@@ -85,9 +87,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  _ptr->setName(_name);
+  _name = name ? name : "";
+  _ptr->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/physx/physxForceField.h

@@ -68,7 +68,7 @@ public:
 
 
 private:
 private:
   NxForceField *_ptr;
   NxForceField *_ptr;
-  char *_name;
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 1 - 2
panda/src/physx/physxForceFieldDesc.I

@@ -22,7 +22,6 @@
 INLINE PhysxForceFieldDesc::
 INLINE PhysxForceFieldDesc::
 PhysxForceFieldDesc() {
 PhysxForceFieldDesc() {
 
 
-  _desc.name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +32,6 @@ PhysxForceFieldDesc() {
 INLINE PhysxForceFieldDesc::
 INLINE PhysxForceFieldDesc::
 ~PhysxForceFieldDesc() {
 ~PhysxForceFieldDesc() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -45,6 +43,7 @@ INLINE void PhysxForceFieldDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 3
panda/src/physx/physxForceFieldDesc.cxx

@@ -26,9 +26,8 @@
 void PhysxForceFieldDesc::
 void PhysxForceFieldDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  _desc.name = _name;
+  _name = name ? name : "";
+  _desc.name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/physx/physxForceFieldDesc.h

@@ -66,7 +66,8 @@ public:
   NxForceFieldDesc _desc;
   NxForceFieldDesc _desc;
   NxForceFieldLinearKernelDesc _kernel;
   NxForceFieldLinearKernelDesc _kernel;
 
 
-  char *_name;
+private:
+  string _name;
 };
 };
 
 
 #include "physxForceFieldDesc.I"
 #include "physxForceFieldDesc.I"

+ 1 - 4
panda/src/physx/physxForceFieldShape.I

@@ -22,7 +22,6 @@
 INLINE PhysxForceFieldShape::
 INLINE PhysxForceFieldShape::
 PhysxForceFieldShape() : PhysxObject() {
 PhysxForceFieldShape() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,10 +43,8 @@ ls() const {
 INLINE void PhysxForceFieldShape::
 INLINE void PhysxForceFieldShape::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")\n";
                             << " (at 0x" << this << ")\n";
 }
 }
 
 

+ 2 - 3
panda/src/physx/physxForceFieldShape.cxx

@@ -105,9 +105,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->setName(_name);
+  _name = name ? name : "";
+  ptr()->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/physx/physxForceFieldShape.h

@@ -62,7 +62,8 @@ public:
 protected:
 protected:
   INLINE PhysxForceFieldShape();
   INLINE PhysxForceFieldShape();
 
 
-  char *_name;
+private:
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 0 - 2
panda/src/physx/physxForceFieldShapeDesc.I

@@ -22,7 +22,6 @@
 INLINE PhysxForceFieldShapeDesc::
 INLINE PhysxForceFieldShapeDesc::
 PhysxForceFieldShapeDesc() {
 PhysxForceFieldShapeDesc() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,6 +32,5 @@ PhysxForceFieldShapeDesc() {
 INLINE PhysxForceFieldShapeDesc::
 INLINE PhysxForceFieldShapeDesc::
 ~PhysxForceFieldShapeDesc() {
 ~PhysxForceFieldShapeDesc() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 3
panda/src/physx/physxForceFieldShapeDesc.cxx

@@ -23,9 +23,8 @@
 void PhysxForceFieldShapeDesc::
 void PhysxForceFieldShapeDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->name = _name;
+  _name = name ? name : "";
+  ptr()->name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxForceFieldShapeDesc.h

@@ -43,7 +43,9 @@ PUBLISHED:
 
 
 public:
 public:
   virtual NxForceFieldShapeDesc *ptr() const = 0;
   virtual NxForceFieldShapeDesc *ptr() const = 0;
-  char *_name;
+
+private:
+  string _name;
 
 
 protected:
 protected:
   INLINE PhysxForceFieldShapeDesc();
   INLINE PhysxForceFieldShapeDesc();

+ 1 - 5
panda/src/physx/physxForceFieldShapeGroup.I

@@ -22,7 +22,6 @@
 INLINE PhysxForceFieldShapeGroup::
 INLINE PhysxForceFieldShapeGroup::
 PhysxForceFieldShapeGroup() : PhysxObject() {
 PhysxForceFieldShapeGroup() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +32,6 @@ PhysxForceFieldShapeGroup() : PhysxObject() {
 INLINE PhysxForceFieldShapeGroup::
 INLINE PhysxForceFieldShapeGroup::
 ~PhysxForceFieldShapeGroup() {
 ~PhysxForceFieldShapeGroup() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -55,10 +53,8 @@ ls() const {
 INLINE void PhysxForceFieldShapeGroup::
 INLINE void PhysxForceFieldShapeGroup::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")\n";
                             << " (at 0x" << this << ")\n";
 
 
   _shapes.ls(out, indent_level);
   _shapes.ls(out, indent_level);

+ 4 - 4
panda/src/physx/physxForceFieldShapeGroup.cxx

@@ -32,6 +32,8 @@ link(NxForceFieldShapeGroup *groupPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(groupPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_ffgroups.add(this);
   scene->_ffgroups.add(this);
 
 
@@ -143,9 +145,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  _ptr->setName(_name);
+  _name = name ? name : "";
+  _ptr->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -193,7 +194,6 @@ create_shape(PhysxForceFieldShapeDesc &desc) {
   nassertr(shapePtr, NULL);
   nassertr(shapePtr, NULL);
 
 
   shape->link(shapePtr);
   shape->link(shapePtr);
-  shape->set_name(desc.ptr()->name);
 
 
   return shape;
   return shape;
 }
 }

+ 1 - 1
panda/src/physx/physxForceFieldShapeGroup.h

@@ -69,7 +69,7 @@ public:
 
 
 private:
 private:
   NxForceFieldShapeGroup *_ptr;
   NxForceFieldShapeGroup *_ptr;
-  char *_name;
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 2 - 2
panda/src/physx/physxForceFieldShapeGroupDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxForceFieldShapeGroupDesc::
 INLINE PhysxForceFieldShapeGroupDesc::
 PhysxForceFieldShapeGroupDesc() {
 PhysxForceFieldShapeGroupDesc() {
 
 
-  _desc.name = NULL;
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,7 +33,6 @@ PhysxForceFieldShapeGroupDesc() {
 INLINE PhysxForceFieldShapeGroupDesc::
 INLINE PhysxForceFieldShapeGroupDesc::
 ~PhysxForceFieldShapeGroupDesc() {
 ~PhysxForceFieldShapeGroupDesc() {
 
 
-  free(_name);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -45,6 +44,7 @@ INLINE void PhysxForceFieldShapeGroupDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 3
panda/src/physx/physxForceFieldShapeGroupDesc.cxx

@@ -35,9 +35,8 @@ add_shape(PhysxForceFieldShapeDesc &desc) {
 void PhysxForceFieldShapeGroupDesc::
 void PhysxForceFieldShapeGroupDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  _desc.name = _name;
+  _name = name ? name : "";
+  _desc.name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxForceFieldShapeGroupDesc.h

@@ -45,7 +45,9 @@ PUBLISHED:
 
 
 public:
 public:
   NxForceFieldShapeGroupDesc _desc;
   NxForceFieldShapeGroupDesc _desc;
-  char *_name;
+
+private:
+  string _name;
 };
 };
 
 
 #include "physxForceFieldShapeGroupDesc.I"
 #include "physxForceFieldShapeGroupDesc.I"

+ 0 - 1
panda/src/physx/physxHeightFieldShape.I

@@ -32,6 +32,5 @@ PhysxHeightFieldShape() : PhysxShape() {
 INLINE PhysxHeightFieldShape::
 INLINE PhysxHeightFieldShape::
 ~PhysxHeightFieldShape() {
 ~PhysxHeightFieldShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxHeightFieldShape.cxx

@@ -29,6 +29,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 2
panda/src/physx/physxHeightFieldShapeDesc.cxx

@@ -24,8 +24,7 @@ void PhysxHeightFieldShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-
-  _desc.name = _name;
+  set_name("");
 
 
   _desc.shapeFlags = NX_SF_FEATURE_INDICES | NX_SF_VISUALIZATION;
   _desc.shapeFlags = NX_SF_FEATURE_INDICES | NX_SF_VISUALIZATION;
   _desc.meshFlags = NX_MESH_SMOOTH_SPHERE_COLLISIONS;
   _desc.meshFlags = NX_MESH_SMOOTH_SPHERE_COLLISIONS;

+ 1 - 4
panda/src/physx/physxJoint.I

@@ -22,7 +22,6 @@
 INLINE PhysxJoint::
 INLINE PhysxJoint::
 PhysxJoint() : PhysxObject() {
 PhysxJoint() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,10 +43,8 @@ ls() const {
 INLINE void PhysxJoint::
 INLINE void PhysxJoint::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")";
                             << " (at 0x" << this << ")";
 
 
   NxActor *actorPtr[2];
   NxActor *actorPtr[2];

+ 2 - 3
panda/src/physx/physxJoint.cxx

@@ -101,9 +101,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->setName(_name);
+  _name = name ? name : "";
+  ptr()->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/physx/physxJoint.h

@@ -72,7 +72,8 @@ public:
 protected:
 protected:
   INLINE PhysxJoint();
   INLINE PhysxJoint();
 
 
-  char *_name;
+private:
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 0 - 2
panda/src/physx/physxJointDesc.I

@@ -22,7 +22,6 @@
 INLINE PhysxJointDesc::
 INLINE PhysxJointDesc::
 PhysxJointDesc() {
 PhysxJointDesc() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,6 +32,5 @@ PhysxJointDesc() {
 INLINE PhysxJointDesc::
 INLINE PhysxJointDesc::
 ~PhysxJointDesc() {
 ~PhysxJointDesc() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 3
panda/src/physx/physxJointDesc.cxx

@@ -23,9 +23,8 @@
 void PhysxJointDesc::
 void PhysxJointDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->name = _name;
+  _name = name ? name : "";
+  ptr()->name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxJointDesc.h

@@ -58,7 +58,9 @@ PUBLISHED:
 
 
 public:
 public:
   virtual NxJointDesc *ptr() const = 0;
   virtual NxJointDesc *ptr() const = 0;
-  char *_name;
+
+private:
+  string _name;
 
 
 protected:
 protected:
   INLINE PhysxJointDesc();
   INLINE PhysxJointDesc();

+ 0 - 1
panda/src/physx/physxPlaneShape.I

@@ -32,6 +32,5 @@ PhysxPlaneShape() : PhysxShape() {
 INLINE PhysxPlaneShape::
 INLINE PhysxPlaneShape::
 ~PhysxPlaneShape() {
 ~PhysxPlaneShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxPlaneShape.cxx

@@ -30,6 +30,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 1
panda/src/physx/physxPlaneShapeDesc.I

@@ -44,7 +44,7 @@ INLINE void PhysxPlaneShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-  _desc.name = _name;
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxPointInPlaneJoint.I

@@ -32,6 +32,5 @@ PhysxPointInPlaneJoint() : PhysxJoint() {
 INLINE PhysxPointInPlaneJoint::
 INLINE PhysxPointInPlaneJoint::
 ~PhysxPointInPlaneJoint() {
 ~PhysxPointInPlaneJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxPointInPlaneJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxPointInPlaneJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxPointInPlaneJointDesc::
 INLINE PhysxPointInPlaneJointDesc::
 PhysxPointInPlaneJointDesc() : PhysxJointDesc() {
 PhysxPointInPlaneJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxPointInPlaneJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxPointOnLineJoint.I

@@ -32,6 +32,5 @@ PhysxPointOnLineJoint() : PhysxJoint() {
 INLINE PhysxPointOnLineJoint::
 INLINE PhysxPointOnLineJoint::
 ~PhysxPointOnLineJoint() {
 ~PhysxPointOnLineJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxPointOnLineJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxPointOnLineJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxPointOnLineJointDesc::
 INLINE PhysxPointOnLineJointDesc::
 PhysxPointOnLineJointDesc() : PhysxJointDesc() {
 PhysxPointOnLineJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxPointOnLineJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxPrismaticJoint.I

@@ -32,6 +32,5 @@ PhysxPrismaticJoint() : PhysxJoint() {
 INLINE PhysxPrismaticJoint::
 INLINE PhysxPrismaticJoint::
 ~PhysxPrismaticJoint() {
 ~PhysxPrismaticJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxPrismaticJoint.cxx

@@ -29,6 +29,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxPrismaticJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxPrismaticJointDesc::
 INLINE PhysxPrismaticJointDesc::
 PhysxPrismaticJointDesc() : PhysxJointDesc() {
 PhysxPrismaticJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxPrismaticJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxPulleyJoint.I

@@ -32,6 +32,5 @@ PhysxPulleyJoint() : PhysxJoint() {
 INLINE PhysxPulleyJoint::
 INLINE PhysxPulleyJoint::
 ~PhysxPulleyJoint() {
 ~PhysxPulleyJoint() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxPulleyJoint.cxx

@@ -30,6 +30,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxPulleyJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxPulleyJointDesc::
 INLINE PhysxPulleyJointDesc::
 PhysxPulleyJointDesc() : PhysxJointDesc() {
 PhysxPulleyJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxPulleyJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 0
panda/src/physx/physxRevoluteJoint.cxx

@@ -32,6 +32,8 @@ link(NxJoint *jointPtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(jointPtr->getName());
+
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData;
   scene->_joints.add(this);
   scene->_joints.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxRevoluteJointDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxRevoluteJointDesc::
 INLINE PhysxRevoluteJointDesc::
 PhysxRevoluteJointDesc() : PhysxJointDesc() {
 PhysxRevoluteJointDesc() : PhysxJointDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxRevoluteJointDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 14
panda/src/physx/physxScene.cxx

@@ -395,11 +395,6 @@ create_actor(PhysxActorDesc &desc) {
   nassertr(actorPtr, NULL);
   nassertr(actorPtr, NULL);
 
 
   actor->link(actorPtr);
   actor->link(actorPtr);
-  actor->set_name(desc._desc.name);
-
-  for (unsigned int i=0; i < actor->get_num_shapes(); i++) {
-    actor->get_shape(i)->set_name(desc._desc.shapes[i]->name);
-  }
 
 
   return actor;
   return actor;
 }
 }
@@ -710,7 +705,7 @@ create_controller(PhysxControllerDesc &desc) {
   nassertr(controllerPtr, NULL);
   nassertr(controllerPtr, NULL);
 
 
   controller->link(controllerPtr);
   controller->link(controllerPtr);
-  controllerPtr->getActor()->setName("");
+  controller->get_actor()->set_name("");
 
 
   return controller;
   return controller;
 }
 }
@@ -764,7 +759,6 @@ create_joint(PhysxJointDesc &desc) {
   nassertr(jointPtr, NULL);
   nassertr(jointPtr, NULL);
 
 
   joint->link(jointPtr);
   joint->link(jointPtr);
-  joint->set_name(desc.ptr()->name);
 
 
   return joint;
   return joint;
 }
 }
@@ -826,11 +820,6 @@ create_force_field(PhysxForceFieldDesc &desc) {
   nassertr(fieldPtr, NULL);
   nassertr(fieldPtr, NULL);
 
 
   field->link(fieldPtr);
   field->link(fieldPtr);
-  field->set_name(desc._desc.name);
-
-  for (unsigned int i=0; i < field->get_num_shape_groups(); i++) {
-    field->get_shape_group(i)->set_name(desc._desc.shapeGroups[i]->getName());
-  }
 
 
   return field;
   return field;
 }
 }
@@ -884,7 +873,6 @@ create_force_field_shape_group(PhysxForceFieldShapeGroupDesc &desc) {
   nassertr(groupPtr, NULL);
   nassertr(groupPtr, NULL);
 
 
   group->link(groupPtr);
   group->link(groupPtr);
-  group->set_name(strdup(desc._desc.name));
 
 
   return group;
   return group;
 }
 }
@@ -940,7 +928,6 @@ create_cloth(PhysxClothDesc &desc) {
   nassertr(clothPtr, NULL);
   nassertr(clothPtr, NULL);
 
 
   cloth->link(clothPtr);
   cloth->link(clothPtr);
-  cloth->set_name(desc._desc.name);
 
 
   return cloth;
   return cloth;
 }
 }

+ 1 - 4
panda/src/physx/physxShape.I

@@ -22,7 +22,6 @@
 INLINE PhysxShape::
 INLINE PhysxShape::
 PhysxShape() : PhysxObject() {
 PhysxShape() : PhysxObject() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,10 +43,8 @@ ls() const {
 INLINE void PhysxShape::
 INLINE void PhysxShape::
 ls(ostream &out, int indent_level) const {
 ls(ostream &out, int indent_level) const {
 
 
-  const char *name = _name ? _name : "";
-
   indent(out, indent_level) << get_type().get_name()
   indent(out, indent_level) << get_type().get_name()
-                            << " " << name
+                            << " " << _name
                             << " (at 0x" << this << ")\n";
                             << " (at 0x" << this << ")\n";
 }
 }
 
 

+ 2 - 3
panda/src/physx/physxShape.cxx

@@ -112,9 +112,8 @@ set_name(const char *name) {
 
 
   nassertv(_error_type == ET_ok);
   nassertv(_error_type == ET_ok);
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->setName(_name);
+  _name = name ? name : "";
+  ptr()->setName(_name.c_str());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/physx/physxShape.h

@@ -86,7 +86,8 @@ public:
 protected:
 protected:
   INLINE PhysxShape();
   INLINE PhysxShape();
 
 
-  char *_name;
+private:
+  string _name;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 public:
 public:

+ 0 - 2
panda/src/physx/physxShapeDesc.I

@@ -22,7 +22,6 @@
 INLINE PhysxShapeDesc::
 INLINE PhysxShapeDesc::
 PhysxShapeDesc() {
 PhysxShapeDesc() {
 
 
-  _name = NULL;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -33,6 +32,5 @@ PhysxShapeDesc() {
 INLINE PhysxShapeDesc::
 INLINE PhysxShapeDesc::
 ~PhysxShapeDesc() {
 ~PhysxShapeDesc() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 3
panda/src/physx/physxShapeDesc.cxx

@@ -24,9 +24,8 @@
 void PhysxShapeDesc::
 void PhysxShapeDesc::
 set_name(const char *name) {
 set_name(const char *name) {
 
 
-  free(_name);
-  _name = strdup(name);
-  ptr()->name = _name;
+  _name = name ? name : "";
+  ptr()->name = _name.c_str();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/physx/physxShapeDesc.h

@@ -61,7 +61,9 @@ PUBLISHED:
 
 
 public:
 public:
   virtual NxShapeDesc *ptr() const = 0;
   virtual NxShapeDesc *ptr() const = 0;
-  char *_name;
+
+private:
+  string _name;
 
 
 protected:
 protected:
   INLINE PhysxShapeDesc();
   INLINE PhysxShapeDesc();

+ 0 - 1
panda/src/physx/physxSphereForceFieldShape.I

@@ -32,6 +32,5 @@ PhysxSphereForceFieldShape() : PhysxForceFieldShape() {
 INLINE PhysxSphereForceFieldShape::
 INLINE PhysxSphereForceFieldShape::
 ~PhysxSphereForceFieldShape() {
 ~PhysxSphereForceFieldShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxSphereForceFieldShape.cxx

@@ -29,6 +29,8 @@ link(NxForceFieldShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   PhysxForceFieldShapeGroup *group = (PhysxForceFieldShapeGroup *)_ptr->getShapeGroup().userData;
   group->_shapes.add(this);
   group->_shapes.add(this);
 }
 }

+ 2 - 1
panda/src/physx/physxSphereForceFieldShapeDesc.I

@@ -22,7 +22,7 @@
 INLINE PhysxSphereForceFieldShapeDesc::
 INLINE PhysxSphereForceFieldShapeDesc::
 PhysxSphereForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 PhysxSphereForceFieldShapeDesc() : PhysxForceFieldShapeDesc() {
 
 
-  _desc.name = "";
+  set_to_default();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -44,6 +44,7 @@ INLINE void PhysxSphereForceFieldShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxSphereShape.I

@@ -32,6 +32,5 @@ PhysxSphereShape() : PhysxShape() {
 INLINE PhysxSphereShape::
 INLINE PhysxSphereShape::
 ~PhysxSphereShape() {
 ~PhysxSphereShape() {
 
 
-  free(_name);
 }
 }
 
 

+ 2 - 0
panda/src/physx/physxSphereShape.cxx

@@ -29,6 +29,8 @@ link(NxShape *shapePtr) {
   _ptr->userData = this;
   _ptr->userData = this;
   _error_type = ET_ok;
   _error_type = ET_ok;
 
 
+  set_name(shapePtr->getName());
+
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   PhysxActor *actor = (PhysxActor *)_ptr->getActor().userData;
   actor->_shapes.add(this);
   actor->_shapes.add(this);
 }
 }

+ 1 - 1
panda/src/physx/physxSphereShapeDesc.I

@@ -44,7 +44,7 @@ INLINE void PhysxSphereShapeDesc::
 set_to_default() {
 set_to_default() {
 
 
   _desc.setToDefault();
   _desc.setToDefault();
-  _desc.name = _name;
+  set_name("");
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physx/physxSphericalJoint.I

@@ -32,6 +32,5 @@ PhysxSphericalJoint() : PhysxJoint() {
 INLINE PhysxSphericalJoint::
 INLINE PhysxSphericalJoint::
 ~PhysxSphericalJoint() {
 ~PhysxSphericalJoint() {
 
 
-  free(_name);
 }
 }
 
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio