Class PhysicsWorld
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
Counters
Returns Box2D's current world counters.
public B2Counters Counters { get; }
Property Value
- B2Counters
Gravity
public Vector2 Gravity { get; set; }
Property Value
PixelsPerMeter
public float PixelsPerMeter { get; set; }
Property Value
SubStepCount
public int SubStepCount { get; set; }
Property Value
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
worldPixelsVector2
Returns
ToWorld(B2Vec2)
public Vector2 ToWorld(B2Vec2 physicsPosition)
Parameters
physicsPositionB2Vec2
Returns
Events
ContactBegan
public event Action<PhysicsContact>? ContactBegan
Event Type
ContactEnded
public event Action<PhysicsContact>? ContactEnded