MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / applyLocalForceAtLocalPosition

Method applyLocalForceAtLocalPosition

src/body/RigidBody.cpp:151–157  ·  view source on GitHub ↗

Manually apply an external force (in local-space) to the body at a given point (in local-space). If the point is not at the center of mass of the body, it will also generate some torque and therefore, change the angular velocity of the body. If the body is sleeping, calling this method will wake it up. Note that the force will we added to the sum of the applied forces and that this sum will be res

Source from the content-addressed store, hash-verified

149 * @param point The point where the force is applied (in local-space of the body)
150 */
151void RigidBody::applyLocalForceAtLocalPosition(const Vector3& force, const Vector3& point) {
152
153 // Convert the local-space force to world-space
154 const Vector3 worldForce = mWorld.mTransformComponents.getTransform(mEntity).getOrientation() * force;
155
156 applyWorldForceAtLocalPosition(worldForce, point);
157}
158
159// Manually apply an external force (in world-space) to the body at a given point (in local-space).
160/// If the point is not at the center of mass of the body, it will also

Callers 1

Calls

no outgoing calls

Tested by 1