mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
remove old hacks, expose PandaNode output() methods
This commit is contained in:
parent
bcb8f039d8
commit
aafc570976
@ -108,19 +108,6 @@ transform_changed() {
|
||||
_mass_center->set_position(transform->get_pos());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : output
|
||||
// Access : Public
|
||||
// Description : Write a string representation of this instance to
|
||||
// <out>.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ActorNode::
|
||||
output(ostream &out) const {
|
||||
#ifndef NDEBUG //[
|
||||
out<<"ActorNode";
|
||||
#endif //] NDEBUG
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : write
|
||||
// Access : Public
|
||||
|
@ -46,7 +46,6 @@ PUBLISHED:
|
||||
// i.e. copy from PhysicsObject to PandaNode
|
||||
void update_transform();
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out, unsigned int indent=0) const;
|
||||
|
||||
private:
|
||||
|
@ -116,10 +116,8 @@ remove_force(int index) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ForceNode::
|
||||
output(ostream &out) const {
|
||||
#ifndef NDEBUG //[
|
||||
PandaNode::output(out);
|
||||
out<<" ("<<_forces.size()<<" forces)";
|
||||
#endif //] NDEBUG
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -108,19 +108,6 @@ remove_physical(int index) {
|
||||
_physicals.erase(remove);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : output
|
||||
// Access : Public
|
||||
// Description : Write a string representation of this instance to
|
||||
// <out>.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PhysicalNode::
|
||||
output(ostream &out) const {
|
||||
#ifndef NDEBUG //[
|
||||
out<<"PhysicalNode";
|
||||
#endif //] NDEBUG
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : write
|
||||
// Access : Public
|
||||
|
@ -44,7 +44,6 @@ PUBLISHED:
|
||||
void remove_physical(Physical *physical);
|
||||
void remove_physical(int index);
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out, unsigned int indent=0) const;
|
||||
|
||||
public:
|
||||
|
@ -58,11 +58,7 @@ apply_friction(ColliderDef &def, LVector3f& vel, const LVector3f& force, float a
|
||||
if (vel!=LVector3f::zero()) {
|
||||
float friction_coefficient=0.0f;
|
||||
// Determine the friction:
|
||||
if (fabs(force.dot(LVector3f::unit_z()))<0.5f) {
|
||||
// ...The force is nearly horizontal, it is probably a wall.
|
||||
physics_debug(" wall friction");
|
||||
friction_coefficient=0.0f;
|
||||
} else if (vel.length()<_almost_stationary_speed) {
|
||||
if (vel.length()<_almost_stationary_speed) {
|
||||
physics_debug(" static friction");
|
||||
friction_coefficient=_static_friction_coef;
|
||||
} else {
|
||||
@ -149,13 +145,10 @@ apply_net_shove(ColliderDef &def, const LVector3f& net_shove, const LVector3f &f
|
||||
|
||||
// This adjustment to our velocity will not reflect us off the surface,
|
||||
// but will deflect us parallel (or tangent) to the surface:
|
||||
if (normalize(net_shove).dot(LVector3f::unit_z())>0.5) {
|
||||
vel=LVector3f::zero();
|
||||
}
|
||||
//vel+=adjustment;
|
||||
vel+=adjustment;
|
||||
physics_debug(" vel+adj "<<vel<<" len "<<vel.length());
|
||||
|
||||
//apply_friction(def, vel, force, angle);
|
||||
apply_friction(def, vel, force, angle);
|
||||
} else if (adjustmentLength==0.0f) {
|
||||
physics_debug(" brushing contact");
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user