collision callbacks
scripts can do collision things now….!!!
script collision callbacks
ObSL scripts can now define collision hooks:
on_collision_enter(other)on_collision_stay(other)on_collision_exit(other)on_trigger_enter(other)on_trigger_stay(other)on_trigger_exit(other)
the other argument is a normal EngineLib entity wrapper, scripts can do stuff like check its name, components, etc.
collision events get collected by the CollisionWorld, then dispatched to the relevant script instances afterwards. they’re also run through the existing script command buffer ofc
2D collider shapes are back too…
added explicit 2D shapes alongside the 3D ones:
RectangleCircle
so the full set is now:
- Box
- Sphere
- Cylinder
- Rectangle
- Circle
rectangle / circle are flat shapes. which is nicer for sprites and other 2d things
movement actually respects colliders
hex movement now checks whether an entity can actually occupy its next tile before moving there.
added a CanOccupy() collision query which builds the entity’s collider at the target position, it blocks the move if something solid is in the way.
triggers don’t block movement.
collision robustness stuff
also did a bunch of smaller fixes around the collision
- added a shared collision tolerance instead of random
1e-6s in different places - AABB overlap now uses that tolerance too
- improved collider validation depending on the actual shape
- fixed gizmo world-to-local conversion to use the proper inverse transform
- more finite-value / clipping checks in the collider gizmo
- GJK
Indeterminateresults preserve the previous collision state instead of automatically counting as a collision
p.s, heres a lil photo of my attempt at making syntax highlighting for obsl using textmate grammar… :D
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.