DarkString
DarkString
Back to Pico Dev
03
PICO SPATIAL SDK · 0.10.7Emulator verified

Physics

A domino chain through the complete collision pipeline

The sample joins mesh colliders, physics materials, dynamic rigid bodies, initial velocity, and collision events into one observable loop.

Capability
Rigid bodies, colliders, and event subscriptions
Environment
PICO Emulator 0.10
Result
Scene and start control rendered
RUN EVIDENCE

Emulator capture

Domino physics scene in the PICO emulator
Captured from the local PICO Emulator 0.10 run; no mockup is used as test evidence.
01

What the run proved

Fourteen dominoes load on the table; the first receives velocity only after Start. Separating initialization from triggering makes scene and physics debugging much clearer.

02

Core code: static table, dynamic dominoes

Table and dominoes use convex shapes, but only dominoes get dynamic rigid bodies. Mass, center of mass, friction, and restitution shape the chain; velocity starts it.

Core code · kotlinPhysicsManager.kt
RigidBodyComponent().apply {
  massProperties = MassProperties(
    mass = 0.04f,
    centerOfMass = Vector3(0f, 0f, 0.02f)
  )
  rigidBodyMode = RigidBodyMode.DYNAMIC
  isAffectedByGravity = true
}

Tune physics parameters as a set; mass alone rarely explains behavior.

03

Core code: collisions drive visual feedback

EventManager retains a cancellable subscription. On collision enter, a custom DominoComponent index selects the PBR feedback color.

Core code · kotlinEventManager.kt / PhysicsManager.kt
subscription = content.subscribe(CollisionEvents.Enter::class.java) {
  collisionEnterCallback?.invoke(it)
}
val index = entityA.components[DominoComponent::class.java]?.index
changeMaterial(entityA, dominoColors[index - 1])

Subscriptions must end with the container lifecycle to avoid duplicate callbacks.