diff --git a/panda/src/physics/physicsObject.cxx b/panda/src/physics/physicsObject.cxx index 0cfa67e1a3..21cfe85cb1 100644 --- a/panda/src/physics/physicsObject.cxx +++ b/panda/src/physics/physicsObject.cxx @@ -91,6 +91,29 @@ make_copy() const { return new PhysicsObject(*this); } +//////////////////////////////////////////////////////////////////// +// Function : add_impact +// Access : Public +// Description : Adds an impulse and/or torque (i.e. an instantanious +// change in velocity) based on how well the offset and +// impulse align with the center of mass (aka position). +// If you wanted to immitate this function you could +// work out the impulse and torque and call add_impulse +// and add_torque respectively. +//////////////////////////////////////////////////////////////////// +void PhysicsObject:: +add_impact(const LPoint3f &offset_from_center_of_mass, + const LVector3f &force) { + nassertv(!offset_from_center_of_mass.is_nan()); + nassertv(!force.is_nan()); + LRotationf torque; + LVector3f impulse; + torque = LRotationf::ident_quat(); // place holder + impulse = LVector3f::zero(); // place holder + add_torque(torque); + add_impulse(impulse); +} + //////////////////////////////////////////////////////////////////// // Function : get_lcs // Access : Public