public interface ITerrainCollidersWhat rebuilds a terrain's collision when its ground moves.
Remarks
An interface for the reason IMeshBaker is one: this assembly does not reference Vixen.Physics, and should not. Nothing in the editor does — physics is a leaf of the graph, reached by the runtime and by the play session rather than by the tools — so the editor says which tiles moved and whatever holds a physics world turns that into shapes. The pieces on the other side already exist: TerrainSamples.FillCollisionSamples fills a tile's heights in metres with holes written as the caller's sentinel, and PhysicsShapes.HeightField takes exactly that.
⚠ Per tile, and that is [§ D2]'s whole argument rather than an optimisation. A tile is one Jolt height-field shape; a stroke touches one or two of them out of sixteen, and rebuilding the terrain's collision because somebody smoothed a ridge is a pause an artist feels every time they let go of the mouse.
⚠ Null is a terrain with no collision, not an error. A scene being sculpted before anybody has pressed play has no physics world, and a mode that refused to work without one would be a mode that cannot be used until the game runs.
Methods (2)
void Rebuild(Terrain terrain, int tileX, int tileZ)Rebuilds one tile's collision shape.
void Rebuild(Terrain terrain, TerrainRect rect)Rebuilds every tile a rectangle of samples touches.
Used by (2)
- RecordingCollidersVixen.Editor.Terrain.Tests
- TerrainEditVixen.Editor.Terrain