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; package src;
import dts.TSDrawPrimitive;
import hxd.res.Sound; import hxd.res.Sound;
import h3d.col.Bounds; import h3d.col.Bounds;
import src.TimeState; import src.TimeState;

View file

@ -1293,8 +1293,6 @@ class Marble extends GameObject {
var distToContactPlane = tsi.point.distance(position); var distToContactPlane = tsi.point.distance(position);
if (radius - 0.005 - distToContactPlane > 0.0001) { if (radius - 0.005 - distToContactPlane > 0.0001) {
// Nudge to the surface of the contact plane // 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)); position = position.add(separatingDistance.multiply(radius - distToContactPlane - 0.005));
resolved++; resolved++;
} }

View file

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

View file

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