system

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitPhysicsSystem added in v0.17.0

type InitPhysicsSystem struct {
	// contains filtered or unexported fields
}

InitPhysicsSystem runs once at world init: FullRebuildFromECS from current ECS entities.

func NewInitPhysicsSystem

func NewInitPhysicsSystem(rt *internal.Runtime) *InitPhysicsSystem

NewInitPhysicsSystem returns the Init-hook system bound to rt. The system creates the singleton entity (if absent), then builds the Box2D world and bodies from ECS.

func (*InitPhysicsSystem) Run added in v0.17.0

func (s *InitPhysicsSystem) Run(w *cardinal.World)

type PhysicsPipelineSystem added in v0.17.0

type PhysicsPipelineSystem struct {
	// contains filtered or unexported fields
}

PhysicsPipelineSystem runs the full physics pipeline atomically: reconcile -> step -> writeback. Combining all three phases into a single system guarantees the scheduler cannot interleave game code between them.

func NewPhysicsPipelineSystem

func NewPhysicsPipelineSystem(rt *internal.Runtime) *PhysicsPipelineSystem

NewPhysicsPipelineSystem returns the full physics pipeline as one atomic unit, bound to rt. The plugin registers it on cardinal.PreUpdate so simulation and writeback finish before cardinal.Update game logic in the same tick, while contact/trigger system events remain visible until the tick ends.

Phases:

  1. Reconcile: sync ECS -> Box2D (create/update/destroy bodies from component changes)
  2. Step: advance physics simulation, buffer contact/trigger events
  3. Writeback: sync Box2D -> ECS (write post-step positions/velocities back to components)

func (*PhysicsPipelineSystem) Run added in v0.17.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL