Class BreakableBody
- Namespace
- Alis.Core.Physic.Common.PhysicsLogic
- Assembly
- Alis.dll
A type of body that supports multiple fixtures that can break apart.
public class BreakableBodyInheritance
Inherited Members
Constructors
BreakableBody(World)
Initializes a new instance of the Alis.Core.Physic.Common.PhysicsLogic.BreakableBody class
private BreakableBody(World world)Parameters
worldWorld-
The world
BreakableBody(World, IEnumerable<Vertices>, float, Vector2, float)
Initializes a new instance of the Alis.Core.Physic.Common.PhysicsLogic.BreakableBody class
public BreakableBody(World world, IEnumerable<Vertices> vertices, float density, Vector2 position = default, float rotation = 0)Parameters
worldWorld-
The world
verticesIEnumerable<Vertices>-
The vertices
densityfloat-
The density
positionVector2-
The position
rotationfloat-
The rotation
BreakableBody(World, IEnumerable<Shape>, Vector2, float)
Initializes a new instance of the Alis.Core.Physic.Common.PhysicsLogic.BreakableBody class
public BreakableBody(World world, IEnumerable<Shape> shapes, Vector2 position = default, float rotation = 0)Parameters
worldWorld-
The world
shapesIEnumerable<Shape>-
The shapes
positionVector2-
The position
rotationfloat-
The rotation
BreakableBody(World, Vertices, float, Vector2, float)
Initializes a new instance of the Alis.Core.Physic.Common.PhysicsLogic.BreakableBody class
public BreakableBody(World world, Vertices vertices, float density, Vector2 position = default, float rotation = 0)Parameters
worldWorld-
The world
verticesVertices-
The vertices
densityfloat-
The density
positionVector2-
The position
rotationfloat-
The rotation
Fields
Parts
The fixture
public List<Fixture> PartsField Value
Strength
The force needed to break the body apart. Default: 500
public float StrengthField Value
_angularVelocitiesCache
The angular velocities cache
private float[] _angularVelocitiesCacheField Value
- float[]
_velocitiesCache
The vector
private Vector2[] _velocitiesCacheField Value
- Vector2[]
Properties
MainBody
Gets the value of the main body
public Body MainBody { get; }Property Value
State
Gets or sets the value of the state
public BreakableBody.BreakableBodyState State { get; private set; }Property Value
World
Gets the value of the world
public World World { get; }Property Value
Methods
CacheVelocities()
Caches the velocities
private void CacheVelocities()Decompose()
Decomposes this instance
private void Decompose()Exceptions
- InvalidOperationException
-
BreakableBody is allready broken
PostSolve(Contact, ContactVelocityConstraint)
Posts the solve using the specified contact
private void PostSolve(Contact contact, ContactVelocityConstraint impulse)Parameters
contactContact-
The contact
impulseContactVelocityConstraint-
The impulse
Update()
Updates this instance
public void Update()