Description
The Surface
property of the PhysicsShape
class represents the surface characteristics of the shape. It is used to define the physical properties and interactions of the shape's surface, such as friction and restitution. This property is of type Sandbox.Surface
, which encapsulates various surface-related attributes.
Usage
To access or modify the surface properties of a PhysicsShape
, use the Surface
property. This can be useful for customizing how the shape interacts with other objects in the physics simulation, such as adjusting friction or bounce characteristics.
Example
// Example of accessing and modifying the Surface property of a PhysicsShape
PhysicsShape shape = new PhysicsShape();
// Access the current surface
Surface currentSurface = shape.Surface;
// Modify the surface properties
currentSurface.Friction = 0.5f;
currentSurface.Restitution = 0.3f;
// Apply the modified surface back to the shape
shape.Surface = currentSurface;