void AddAngularVelocity( Vector3 vel )

robot_2Generated
code_blocksInput

Description

The AddAngularVelocity method applies an angular velocity to all physics bodies within the PhysicsGroup. This method is useful for simulating rotational motion or spinning effects on a group of physics bodies, such as a ragdoll or a collection of connected objects.

Usage

To use the AddAngularVelocity method, you need to have an instance of PhysicsGroup. Call the method with a Vector3 parameter representing the angular velocity you wish to apply. The angular velocity is applied to all bodies in the group, affecting their rotational motion.

Example

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

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

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