Fix time travel hitboxes being too small

This commit is contained in:
RandomityGuy 2023-02-16 22:21:01 +05:30
parent 21c5ecfeb9
commit 06239378fb

View file

@ -342,6 +342,12 @@ class DtsObject extends GameObject {
if (this.level != null && this.isBoundingBoxCollideable) {
var boundthing = new Bounds();
for (mesh in this.dts.meshes) {
if (mesh == null)
continue;
for (pt in mesh.vertices)
boundthing.addPoint(new h3d.col.Point(-pt.x, pt.y, pt.z));
}
boundthing.addPoint(new h3d.col.Point(this.dts.bounds.minX, this.dts.bounds.minY, this.dts.bounds.minZ));
boundthing.addPoint(new h3d.col.Point(this.dts.bounds.maxX, this.dts.bounds.maxY, this.dts.bounds.maxZ));
this.boundingCollider = new BoxCollisionEntity(boundthing, cast this);