Skip to content

Collision API

messire edited this page Sep 26, 2026 · 3 revisions

Axiomata supplies collision math and runtime systems for structures whose solid shape comes from authored model geometry rather than one entity AABB.

Structure contract

Implement CollidableStructure on the owning entity.

Method Contract
collisionGroups() All authored groups used for picking and geometry queries
solidCollisionGroups() Subset that blocks movement; defaults to all groups
collisionTransform() Current world position and yaw
previousCollisionTransform() Previous-tick position and yaw
previousCollisionGroups() Previous pose for animated groups
previousSolidCollisionGroups() Previous solid pose
climbableGroups() Optional non-solid climbable regions

Use CollisionGroup.fixed for static groups. Use CollisionPose for synchronized translations or rotations of moving model parts. GeckoLib client-only animation state must not drive server collision.

Runtime systems

API Purpose
StructureCollisionSystem Registration, nearby lookup and entity movement collision
StructureMotionSystem.tickStructure Register a structure and carry/push entities when it moves
StructureCollisionResolver Sweeps, support tests, bounds, point/segment queries
StructureInteractionPicker Ray-pick authored geometry instead of the entity AABB
StructureClimbingSystem Climbable model regions and guided climbing state
StructurePathfindingSystem.blocked Mark solid geometry as blocked for path evaluators
StructureTerrainCollision Clamp structure movement against blocks and recover existing overlap

Call StructureMotionSystem.tickStructure(this) once per structure tick when moving geometry must carry nearby entities. Otherwise register and unregister through StructureCollisionSystem with the entity lifecycle.

Vanilla WalkNodeEvaluator integration is supplied by Axiomata. A mod with a custom path evaluator must call StructurePathfindingSystem.blocked(mob, x, y, z) from its own node test.

Use StructureTerrainCollision.clampMovement before moving a structure through terrain. canOccupy checks a proposed root transform, while unstick is intended for structures already intersecting newly placed or loaded blocks. The caller decides which authored groups should be excluded, such as wheels or animated parts that are not part of the rigid footprint.

Authored geometry

CollisionShape stores one model bone's parts in structure-local space. CollisionGroup combines that shape with its runtime pose. Generated shapes and model-export tooling belong to the consuming mod; Axiomata does not infer collision from a rendered model at runtime.

Local axes are:

  • positive X: right;
  • positive Y: up;
  • positive Z: structure forward.

For moving groups, current and previous lists must use stable group names so Axiomata can match poses across ticks.

Clone this wiki locally