Description
The DragEnabled
property of the PhysicsBody
class indicates whether air drag forces are applied to the physics body. When enabled, the body will experience resistance proportional to its velocity, simulating the effect of air resistance. This property works in conjunction with LinearDrag
and AngularDrag
to determine the extent of the drag forces applied.
Usage
To enable or disable air drag forces on a PhysicsBody
, set the DragEnabled
property to true
or false
respectively. This can be useful for simulating different environmental conditions or for specific gameplay mechanics where air resistance is a factor.
Example
// Example of enabling drag on a PhysicsBody
PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.DragEnabled = true;
// Example of disabling drag on a PhysicsBody
myPhysicsBody.DragEnabled = false;