Table of Contents

Class PhysicsWorld

Namespace
Axolotl2D.Physics
Assembly
Axolotl2D.dll

A Box2D world owned by one scene DI scope.

public sealed class PhysicsWorld : IDisposable
Inheritance
PhysicsWorld
Implements
Inherited Members

Constructors

PhysicsWorld()

public PhysicsWorld()

Properties

Bodies

public IReadOnlyCollection<PhysicsBody> Bodies { get; }

Property Value

IReadOnlyCollection<PhysicsBody>

Counters

Returns Box2D's current world counters.

public B2Counters Counters { get; }

Property Value

B2Counters

Gravity

public Vector2 Gravity { get; set; }

Property Value

Vector2

PixelsPerMeter

public float PixelsPerMeter { get; set; }

Property Value

float

SubStepCount

public int SubStepCount { get; set; }

Property Value

int

WorldId

public B2WorldId WorldId { get; }

Property Value

B2WorldId

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ToPhysics(Vector2)

public Vector2 ToPhysics(Vector2 worldPixels)

Parameters

worldPixels Vector2

Returns

Vector2

ToWorld(B2Vec2)

public Vector2 ToWorld(B2Vec2 physicsPosition)

Parameters

physicsPosition B2Vec2

Returns

Vector2

Events

ContactBegan

public event Action<PhysicsContact>? ContactBegan

Event Type

Action<PhysicsContact>

ContactEnded

public event Action<PhysicsContact>? ContactEnded

Event Type

Action<PhysicsContact>