mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
allowing physics objects to be named in debug versions
This commit is contained in:
parent
60dd748c27
commit
cad885b343
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user