fix backport

This commit is contained in:
RandomityGuy 2023-02-20 14:11:35 +05:30
parent 402e7a9893
commit 5d511d2bd9
4 changed files with 15 additions and 4 deletions

View file

@ -1,5 +1,6 @@
package src;
import dts.TSDrawPrimitive;
import hxd.res.Sound;
import h3d.col.Bounds;
import src.TimeState;

View file

@ -1293,8 +1293,6 @@ class Marble extends GameObject {
var distToContactPlane = tsi.point.distance(position);
if (radius - 0.005 - distToContactPlane > 0.0001) {
// Nudge to the surface of the contact plane
Debug.drawTriangle(testTri.v[0], testTri.v[1], testTri.v[2]);
Debug.drawSphere(position, radius);
position = position.add(separatingDistance.multiply(radius - distToContactPlane - 0.005));
resolved++;
}

View file

@ -163,7 +163,6 @@ class MarbleGame {
world = null;
return;
}
Debug.update();
if (Util.isTouchDevice()) {
touchInput.update();
}

View file

@ -77,6 +77,7 @@ import src.Resource;
import src.ProfilerUI;
import src.ResourceLoaderWorker;
import src.Gamepad;
import src.ResourceLoader;
class MarbleWorld extends Scheduler {
public var collisionWorld:CollisionWorld;
@ -102,6 +103,7 @@ class MarbleWorld extends Scheduler {
var endPadElement:MissionElementStaticShape;
var endPad:EndPad;
var skyElement:MissionElementSky;
public var scene:Scene;
public var scene2d:h2d.Scene;
@ -176,7 +178,8 @@ class MarbleWorld extends Scheduler {
MissionElementType.Item,
MissionElementType.PathedInterior,
MissionElementType.StaticShape,
MissionElementType.TSStatic
MissionElementType.TSStatic,
MissionElementType.Sky
].contains(element._type)) {
// this.loadingState.total++;
@ -186,6 +189,10 @@ class MarbleWorld extends Scheduler {
if (so.datablock.toLowerCase() == 'endpad')
this.endPadElement = so;
}
if (element._type == Sky) {
this.skyElement = cast element;
}
} else if (element._type == MissionElementType.SimGroup) {
scanMission(cast element);
}
@ -779,6 +786,12 @@ class MarbleWorld extends Scheduler {
if (index == -1)
return;
var dtsPath = 'data/' + shapeName.substring(index + 'data/'.length);
if (ResourceLoader.getProperFilepath(dtsPath) == "") {
onFinish();
return;
}
var tsShape = new DtsObject();
tsShape.useInstancing = true;
tsShape.dtsPath = dtsPath;