Extend collision bounds calculation and add water contact patch collection
This commit is contained in:
@@ -2752,7 +2752,30 @@ export class RuntimeHost {
|
|||||||
z: feetPosition.z - playerShape.size.z * 0.5
|
z: feetPosition.z - playerShape.size.z * 0.5
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
x: feetPosition.x + pla({
|
x: feetPosition.x + playerShape.size.x * 0.5,
|
||||||
|
y: feetPosition.y + playerShape.size.y,
|
||||||
|
z: feetPosition.z + playerShape.size.z * 0.5
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private collectRuntimeStaticWaterContactPatches(
|
||||||
|
brush: RuntimeBoxBrushInstance
|
||||||
|
) {
|
||||||
|
const contactBounds: Parameters<typeof collectWaterContactPatches>[1] = [];
|
||||||
|
|
||||||
|
if (this.runtimeScene === null) {
|
||||||
|
return contactBounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const collider of this.runtimeScene.colliders) {
|
||||||
|
if (collider.kind === "trimesh" && collider.source === "brush") {
|
||||||
|
if (collider.brushId === brush.id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
contactBounds.push({
|
||||||
kind: "triangleMesh",
|
kind: "triangleMesh",
|
||||||
vertices: collider.vertices,
|
vertices: collider.vertices,
|
||||||
indices: collider.indices,
|
indices: collider.indices,
|
||||||
|
|||||||
Reference in New Issue
Block a user