mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -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));
|
add_physical(new Physical(1, true));
|
||||||
_mass_center = get_physical(0)->get_phys_body();
|
_mass_center = get_physical(0)->get_phys_body();
|
||||||
_mass_center->set_active(true);
|
_mass_center->set_active(true);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
_mass_center->set_name(name);
|
||||||
|
#endif
|
||||||
_ok_to_callback = true;
|
_ok_to_callback = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ void PhysicsObject::
|
|||||||
write(ostream &out, unsigned int indent) const {
|
write(ostream &out, unsigned int indent) const {
|
||||||
#ifndef NDEBUG //[
|
#ifndef NDEBUG //[
|
||||||
out.width(indent);
|
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<<"_position "<<_position<<"\n";
|
||||||
out.width(indent+2); out<<""; out<<"_last_position "<<_last_position<<"\n";
|
out.width(indent+2); out<<""; out<<"_last_position "<<_last_position<<"\n";
|
||||||
out.width(indent+2); out<<""; out<<"_velocity "<<_velocity<<"\n";
|
out.width(indent+2); out<<""; out<<"_velocity "<<_velocity<<"\n";
|
||||||
|
@ -81,6 +81,15 @@ PUBLISHED:
|
|||||||
virtual LMatrix4f get_lcs() const;
|
virtual LMatrix4f get_lcs() const;
|
||||||
virtual PhysicsObject *make_copy() 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 output(ostream &out) const;
|
||||||
virtual void write(ostream &out, unsigned int indent=0) const;
|
virtual void write(ostream &out, unsigned int indent=0) const;
|
||||||
|
|
||||||
@ -100,6 +109,10 @@ private:
|
|||||||
bool _process_me;
|
bool _process_me;
|
||||||
bool _oriented;
|
bool _oriented;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
string _name;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static TypeHandle get_class_type() {
|
static TypeHandle get_class_type() {
|
||||||
return _type_handle;
|
return _type_handle;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user