fix(world): allow walking through la fabrik door
Strip the 'porte' mesh from the cloned scene used to build the la fabrik collision octree. The wall geometry already has a doorway cutout, so removing the door slab leaves the opening passable. The visual model is rendered separately by MergedStaticMapModel and is unaffected. Drops the stop-gap LA_FABRIK_COLLISION_Y_OFFSET added during debugging.
This commit is contained in:
@@ -223,6 +223,22 @@ function CollisionModelInstance({
|
|||||||
scale: normalizedScale,
|
scale: normalizedScale,
|
||||||
});
|
});
|
||||||
const sceneInstance = useClonedObject(scene);
|
const sceneInstance = useClonedObject(scene);
|
||||||
|
useEffect(() => {
|
||||||
|
// Strip the door slab from the la fabrik collision octree so the player
|
||||||
|
// can walk through the doorway. The visual model is rendered separately
|
||||||
|
// by MergedStaticMapModel and is unaffected.
|
||||||
|
if (node.name !== "lafabrik") return;
|
||||||
|
|
||||||
|
const removed: THREE.Object3D[] = [];
|
||||||
|
sceneInstance.traverse((child) => {
|
||||||
|
if (child.name === "porte") {
|
||||||
|
removed.push(child);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
for (const child of removed) {
|
||||||
|
child.removeFromParent();
|
||||||
|
}
|
||||||
|
}, [node.name, sceneInstance]);
|
||||||
const collisionPosition = useMemo(() => {
|
const collisionPosition = useMemo(() => {
|
||||||
if (node.name === "terrain") return position;
|
if (node.name === "terrain") return position;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user