collision system round 2 i guess
ended up pretty much reworking most of the collision system…..
the first version was still basically 2D, with separate box vs box / circle vs circle / box vs circle functions. that worked as a starting point, but it was gonna get annoying …
so… it is 3D now.
colliders
ColliderComponent now supports:
- boxes
- spheres
- cylinders
- 3D offsets / dimensions
- triggers
- entity-space or billboard orientation
billboard colliders follow the same camera-facing basis as billboard rendering, which means billboard sprites can still have colliders that actually line up with how they appear on screen.
GJK
got rid of all the individual boxVBox, boxVCircle, etc. collision functions and replaced them with support-mapped collision detection using GJK.
each collider shape just provides a support point now, the intersection test doesn’t care what combination of shapes it’s checking.
i dont fully understand the math completely yet.. but it kinda makes sense :D
still no collision response / physics yet. this is just detection + events, i think ill prolly get it into EngineLib.. soon…
events
the CollisionWorld still tracks collisions between frames and generates:
EnterStayExit
trigger state is kept with the collision too.
this is for EngineLib integration.
scripts should be able to react to collisions / triggers like unity
I have not gotten around to this yet though…
collider gizmos
also had to redo the collider gizmos now that colliders aren’t just flat 2D shapes anymore…
its a lil janky
but it works..
billboard cleanup
while doing the billboard collider stuff I also cleaned up billboard rendering a bit
billboards used to have their world transform temporarily modified by SpriteBillboardSystem before rendering. now the billboard matrix is generated when the entity is submitted to the renderer instead, so the actual ECS transform can stay as the real entity transform
there’s now one shared billboard matrix helper used by both rendering and collision, which is considerably less cursed.
um
scripting integration next i guess.. if something dosent explode ! :D
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.