Add concealment meter and skinned collider baker; reorganize assets
- ConcealmentMeter: standalone component measuring the percentage of the character volume embedded inside environment geometry (bake -> voxelize via column ray-stabbing parity -> classify interior voxels against box/sphere/ capsule/convex colliders and terrain). Always-on, throttled, gizmo debug. - SkinnedColliderBaker: sole per-frame collider bake owner for skinned rigs. MeshPainter now delegates baking and only borrows BakedMesh for the GPU raster and cache refresh, so the collider stays fresh outside paint mode. - Move pose assets to Assets/Poses, retire unused Insect scripts to Assets/Unused, restore Paintman.controller; mode scripts and scene updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
def10541ab
commit
dcfd668422
29 files changed
+2160
-1656
No files matched your search
@@ -10,13 +10,22 @@ public partial class MeshPainter
|
||||
if (!_collider) _collider = gameObject.AddComponent<MeshCollider>();
|
||||
_collider.convex = false; // non-convex provides triangleIndex / textureCoord
|
||||
|
||||
_bakedMesh = new Mesh { name = "MeshPainter_Baked" };
|
||||
// An always-on SkinnedColliderBaker (skinned rigs only) owns the bake even outside paint
|
||||
// mode; we delegate to it and only borrow its mesh. Without one we keep our own legacy bake.
|
||||
_baker = _skinned ? GetComponent<SkinnedColliderBaker>() : null;
|
||||
if (!_baker) _bakedMesh = new Mesh { name = "MeshPainter_Baked" };
|
||||
BakeColliderMesh();
|
||||
}
|
||||
|
||||
private void BakeColliderMesh()
|
||||
{
|
||||
if (_skinned)
|
||||
if (_baker)
|
||||
{
|
||||
// Baker already baked (negative execution order) and keeps _collider.sharedMesh fresh;
|
||||
// we only track its mesh for the GPU raster path. No bake here - that's the whole point.
|
||||
_bakedMesh = _baker.BakedMesh;
|
||||
}
|
||||
else if (_skinned)
|
||||
{
|
||||
// Static skinned mesh: bake into local coordinates (scale = 1).
|
||||
_skinned.BakeMesh(_bakedMesh);
|
||||
|
||||
Reference in new issue
Block a user