瀏覽代碼

Some additional output for ls().

enn0x 14 年之前
父節點
當前提交
24acb72bb4

+ 16 - 0
panda/src/bullet/bulletBodyNode.cxx

@@ -146,6 +146,22 @@ safe_to_flatten_below() const {
   return false;
   return false;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletBodyNode::output
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+void BulletBodyNode::
+output(ostream &out) const {
+
+  PandaNode::output(out);
+
+  out << " (" << get_num_shapes() << " shapes)";
+
+  if (is_static()) out << " static";
+  if (is_kinematic()) out << " kinematic";
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletBodyNode::transform_changed
 //     Function: BulletBodyNode::transform_changed
 //       Access: Protected
 //       Access: Protected

+ 2 - 0
panda/src/bullet/bulletBodyNode.h

@@ -110,6 +110,8 @@ public:
   virtual bool safe_to_combine_children() const;
   virtual bool safe_to_combine_children() const;
   virtual bool safe_to_flatten_below() const;
   virtual bool safe_to_flatten_below() const;
 
 
+  virtual void output(ostream &out) const;
+
 protected:
 protected:
   INLINE void set_collision_flag(int flag, bool value);
   INLINE void set_collision_flag(int flag, bool value);
   INLINE bool get_collision_flag(int flag) const;
   INLINE bool get_collision_flag(int flag) const;

+ 13 - 0
panda/src/bullet/bulletRigidBodyNode.cxx

@@ -48,6 +48,19 @@ BulletRigidBodyNode(const char *name) : BulletBodyNode(name) {
   _body->setUserPointer(this);
   _body->setUserPointer(this);
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletRigidBodyNode::output
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+void BulletRigidBodyNode::
+output(ostream &out) const {
+
+  BulletBodyNode::output(out);
+
+  out << " mass=" << get_mass();
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletRigidBodyNode::get_object
 //     Function: BulletRigidBodyNode::get_object
 //       Access: Public
 //       Access: Public

+ 2 - 0
panda/src/bullet/bulletRigidBodyNode.h

@@ -80,6 +80,8 @@ PUBLISHED:
 public:
 public:
   virtual btCollisionObject *get_object() const;
   virtual btCollisionObject *get_object() const;
 
 
+  virtual void output(ostream &out) const;
+
 protected:
 protected:
   virtual void parents_changed();
   virtual void parents_changed();
   virtual void transform_changed();
   virtual void transform_changed();