void ApplyImpulseAt( Vector3 position, Vector3 velocity )

book_4_sparkGenerated
code_blocksInput

Description

The ApplyImpulseAt method applies an impulse to a PhysicsBody at a specified position, with a given velocity. This method is useful for simulating forces that act at a specific point on a body, such as a hit or a push, which can cause both linear and angular motion.

Usage

To use the ApplyImpulseAt method, you need to provide two parameters:

  • position: A Vector3 representing the world position where the impulse is applied.
  • velocity: A Vector3 representing the velocity of the impulse.

This method does not return a value.

Example

// Example of using ApplyImpulseAt
PhysicsBody body = new PhysicsBody();
Vector3 impulsePosition = new Vector3(1.0f, 2.0f, 3.0f);
Vector3 impulseVelocity = new Vector3(0.0f, 10.0f, 0.0f);

// Apply an impulse at the specified position with the given velocity
body.ApplyImpulseAt(impulsePosition, impulseVelocity);