Table of Contents

Namespace Stride.CommunityToolkit.Box2D

Classes

BodyForces

Force, impulse, and velocity helpers applied to bodies by id.

Box2DBodyComponent

Component that ties a Stride entity to a Box2D body: creation-time configuration plus live velocity, force and impulse access once BodyId refers to a created body.

Box2DCollisionMatrix

Simple symmetric collision matrix for filtering collisions between group pairs. Pairs default to colliding until configured otherwise.

Box2DDebugDraw

Box2D's own debug drawing, rendered through a ShapeBatch: every shape, joint, contact point, force, bounding box, island and body name the testbed can show, from one call a frame, with the testbed's toggles as properties.

Box2DEntityInstancing

An EntityInstancing for Box2D bodies that stops working entirely once the bodies fall asleep, mirroring BepuEntityInstancing from Stride.CommunityToolkit.Bepu.

Box2DSimulation

High-level integration facade between Box2D.NET and Stride entities. Wraps a reusable PhysicsWorld2D plus an entity/body bridge and exposes a simplified stepping, query and event API, mirroring the role BepuSimulation plays for Bepu physics in Stride.

Box2DStrideBridge

Bridge responsible for mapping Box2D bodies to Stride entities and synchronizing transforms. This isolates engine-specific concerns away from the engine-agnostic PhysicsWorld2D.

CharacterMover2D

A platformer character that is not a rigid body: a capsule the game moves itself, Quake style, with Box2D asked only what it touches. Ported from the Box2D.NET samples' Mover (MIT, (c) 2022 Erin Catto, (c) 2025 Choi Ikpil).

DistanceJointOptions

A rod or a rope: keeps two anchors a set distance apart, or within a range, optionally sprung or driven along its length.

Grabber2DScript

Pick up any dynamic Box2D body with the mouse, drag it about, and let go - with whatever velocity it had, so a flick throws it. Put it on the camera entity and give it the simulation.

JointOptionsBase

The settings every Box2D joint shares. A property left null keeps Box2D's default for that joint type, so an empty options object is the same as passing none.

Joints2D

Box2D's seven joint types with world-space anchors: say where the pivot is and which way the axis points, and the local frames each body needs are worked out here.

MotorJointOptions

Drives body B relative to body A: a velocity to chase with capped force and torque, and a spring toward the frames' alignment. The mouse drag idiom, and the way to move a body without making it kinematic.

MoverShapeResponse

How a shape pushes a CharacterMover2D that runs into it. Stored in the shape's Box2D user data by SetResponse(B2ShapeId, float, bool); a shape without one is rigid and clips the mover's velocity, the sample's default.

PhysicsQueries2D

Stateless helper methods for common Box2D query patterns. These wrappers avoid any Stride engine types and operate directly on world ids and primitive math structs only.

PhysicsStepSettings

Configuration for fixed-timestep simulation stepping used by PhysicsWorld2D.

PhysicsWorld2D

Engine-agnostic 2D physics world wrapper around Box2D.NET: owns the native world and advances it on a fixed timestep. It deliberately avoids any dependency on Stride Entity types; pairing bodies with entities is Box2DStrideBridge's job.

PrismaticJointOptions

A slider: body B moves along an axis fixed in body A, without turning relative to it.

RevoluteJointOptions

A hinge: the bodies share a pivot and turn about it. Optionally sprung toward a target angle, limited to an angular range, or driven by a motor.

ShapeFixtureBuilder

Builds Box2D shapes (fixtures) matching the toolkit's 2D primitive types, so a body's collision shape lines up with the rendered Primitive2DModelType mesh of the same size.

SimulationJoints2D

Joints2D for a Box2DSimulation: the same factories with the world id filled in, and overloads that take the entities the simulation created bodies for. Reached through Joints.

SvgPath2D

Reads the straight-line commands of an SVG path into a list of points, so a level outline drawn in Inkscape can become a chain shape. Ported from the Box2D.NET samples' SvgParser (MIT, (c) 2025 Erin Catto, (c) 2025 Choi Ikpil).

WeldJointOptions

Glues two bodies together. Zero hertz is rigid; a positive value makes the weld springy on that axis, which is how breakable or soft assemblies are built.

WheelJointOptions

A wheel on a suspension: the wheel turns freely about the pivot and slides along the axis, usually sprung and limited, with a motor to drive it.

Structs

QueryRaycastHit

A raw 2D raycast hit returned by PhysicsQueries2D. Engine-agnostic: contains only Box2D identifiers and value types; see RaycastHit for the entity-resolved variant.

RaycastHit

A 2D raycast hit with the owning Stride entity resolved, as returned by Raycast(Vector2, Vector2, float) and RaycastAll(Vector2, Vector2, float). See QueryRaycastHit for the raw engine-agnostic variant.

ShapeCastHit

The closest hit of a shape cast from PhysicsQueries2D: the shape and body struck, where, the surface normal there, and how far along the sweep it happened.

Interfaces

IBox2DSimulationUpdate

Implemented by objects that want to run logic before and after each simulation update, mirroring the ISimulationUpdate pattern of Stride's Bepu physics integration.

Enums

PogoShape

The shape a CharacterMover2D casts downward to find the ground under its feet.