Table of Contents

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 BreakableBody

Inheritance

Inherited Members

Constructors

BreakableBody(World)

Initializes a new instance of the Alis.Core.Physic.Common.PhysicsLogic.BreakableBody class

private BreakableBody(World world)

Parameters

world World

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

world World

The world

vertices IEnumerable<Vertices>

The vertices

density float

The density

position Vector2

The position

rotation float

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

world World

The world

shapes IEnumerable<Shape>

The shapes

position Vector2

The position

rotation float

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

world World

The world

vertices Vertices

The vertices

density float

The density

position Vector2

The position

rotation float

The rotation

Fields

Parts

The fixture

public List<Fixture> Parts

Field Value

List<Fixture>

Strength

The force needed to break the body apart. Default: 500

public float Strength

Field Value

float

_angularVelocitiesCache

The angular velocities cache

private float[] _angularVelocitiesCache

Field Value

float[]

_velocitiesCache

The vector

private Vector2[] _velocitiesCache

Field Value

Vector2[]

Properties

MainBody

Gets the value of the main body

public Body MainBody { get; }

Property Value

Body

State

Gets or sets the value of the state

public BreakableBody.BreakableBodyState State { get; private set; }

Property Value

BreakableBody.BreakableBodyState

World

Gets the value of the world

public World World { get; }

Property Value

World

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

contact Contact

The contact

impulse ContactVelocityConstraint

The impulse

Update()

Updates this instance

public void Update()