From 24acb72bb4e5a8d961ca27d6336961b19ffd825b Mon Sep 17 00:00:00 2001 From: enn0x Date: Mon, 25 Jul 2011 20:40:04 +0000 Subject: [PATCH] Some additional output for ls(). --- panda/src/bullet/bulletBodyNode.cxx | 16 ++++++++++++++++ panda/src/bullet/bulletBodyNode.h | 2 ++ panda/src/bullet/bulletRigidBodyNode.cxx | 13 +++++++++++++ panda/src/bullet/bulletRigidBodyNode.h | 2 ++ 4 files changed, 33 insertions(+) diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index 16749733f5..43da97f9e7 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -146,6 +146,22 @@ safe_to_flatten_below() const { 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 // Access: Protected diff --git a/panda/src/bullet/bulletBodyNode.h b/panda/src/bullet/bulletBodyNode.h index b125754cb9..8d659c8436 100644 --- a/panda/src/bullet/bulletBodyNode.h +++ b/panda/src/bullet/bulletBodyNode.h @@ -110,6 +110,8 @@ public: virtual bool safe_to_combine_children() const; virtual bool safe_to_flatten_below() const; + virtual void output(ostream &out) const; + protected: INLINE void set_collision_flag(int flag, bool value); INLINE bool get_collision_flag(int flag) const; diff --git a/panda/src/bullet/bulletRigidBodyNode.cxx b/panda/src/bullet/bulletRigidBodyNode.cxx index 6f46478f09..df7dbfac5c 100644 --- a/panda/src/bullet/bulletRigidBodyNode.cxx +++ b/panda/src/bullet/bulletRigidBodyNode.cxx @@ -48,6 +48,19 @@ BulletRigidBodyNode(const char *name) : BulletBodyNode(name) { _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 // Access: Public diff --git a/panda/src/bullet/bulletRigidBodyNode.h b/panda/src/bullet/bulletRigidBodyNode.h index 4375035eeb..5dc2699940 100644 --- a/panda/src/bullet/bulletRigidBodyNode.h +++ b/panda/src/bullet/bulletRigidBodyNode.h @@ -80,6 +80,8 @@ PUBLISHED: public: virtual btCollisionObject *get_object() const; + virtual void output(ostream &out) const; + protected: virtual void parents_changed(); virtual void transform_changed();