allowing physics objects to be named in debug versions

This commit is contained in:
Dave Schuyler 2004-09-01 03:28:09 +00:00
parent 60dd748c27
commit cad885b343
3 changed files with 17 additions and 1 deletions

View File

@ -36,6 +36,9 @@ ActorNode(const string &name) :
add_physical(new Physical(1, true));
_mass_center = get_physical(0)->get_phys_body();
_mass_center->set_active(true);
#ifndef NDEBUG
_mass_center->set_name(name);
#endif
_ok_to_callback = true;
}

View File

@ -137,7 +137,7 @@ void PhysicsObject::
write(ostream &out, unsigned int indent) const {
#ifndef NDEBUG //[
out.width(indent);
out<<""<<"PhysicsObject:\n";
out<<""<<"PhysicsObject "<<_name<<"\n";
out.width(indent+2); out<<""; out<<"_position "<<_position<<"\n";
out.width(indent+2); out<<""; out<<"_last_position "<<_last_position<<"\n";
out.width(indent+2); out<<""; out<<"_velocity "<<_velocity<<"\n";

View File

@ -81,6 +81,15 @@ PUBLISHED:
virtual LMatrix4f get_lcs() const;
virtual PhysicsObject *make_copy() const;
#ifndef NDEBUG
void set_name(const string &name) {
_name = name;
}
const string& get_name() {
return _name;
}
#endif
virtual void output(ostream &out) const;
virtual void write(ostream &out, unsigned int indent=0) const;
@ -99,6 +108,10 @@ private:
bool _process_me;
bool _oriented;
#ifndef NDEBUG
string _name;
#endif
public:
static TypeHandle get_class_type() {