fix trapdoor collision

This commit is contained in:
RandomityGuy 2025-03-18 18:51:34 +05:30
parent e72e28def5
commit b112004949
2 changed files with 7 additions and 2 deletions

View file

@ -532,6 +532,10 @@ class DtsObject extends GameObject {
postProcessMaterial(matName, material);
if (Debug.wireFrame) {
material.mainPass.wireframe = true;
}
this.materials.push(material);
}

View file

@ -1349,8 +1349,9 @@ class Marble extends GameObject {
var surfaceNormal = new Vector(verts.nx, verts.ny,
verts.nz); // surface.normals[surface.indices[i]].transformed3x3(obj.transform).normalized();
if (obj is DtsObject)
surfaceNormal.multiply(-1);
if (obj.correctNormals) {
surfaceNormal.load(v.sub(v0).cross(v2.sub(v0)).normalized().multiply(-1));
}
var surfaceD = -surfaceNormal.dot(v0);
// If we're going the wrong direction or not going to touch the plane, ignore...