void AddAngularVelocity( Vector3 vel )

book_4_sparkGenerated
code_blocksInput

Description

The AddAngularVelocity method is used to apply an additional angular velocity to all physics bodies within a PhysicsGroup. This method modifies the rotational speed of the bodies, causing them to spin around their center of mass.

Usage

To use the AddAngularVelocity method, you need to have an instance of a PhysicsGroup. Call the method with a Vector3 parameter that represents the angular velocity you want to add. The vector's direction determines the axis of rotation, and its magnitude determines the speed of rotation.

Example

// Create a new PhysicsGroup instance
PhysicsGroup physicsGroup = new PhysicsGroup();

// Define the angular velocity to add
Vector3 angularVelocity = new Vector3(0, 1, 0); // Rotates around the Y-axis

// Add the angular velocity to the physics group
physicsGroup.AddAngularVelocity(angularVelocity);