Repair (?) annoying gravity/loading quirk
This commit is contained in:
parent
fba65e3ec0
commit
b82fdea3c4
|
@ -1,6 +1,6 @@
|
|||
? <Scene ?name ?scene> [
|
||||
$scene [
|
||||
? <Exit ?spriteName ?roomName> <Exit $spriteName $roomName <v 0.0 1.6 0.0>>
|
||||
? <Exit ?spriteName ?roomName> <Exit $spriteName $roomName <v 0.0 0.0 0.0>>
|
||||
? <Exit ?spriteName ?roomName ?initialPos> [
|
||||
$config ? <Scene $roomName ?ds> [
|
||||
$scene <portal $spriteName $ds $initialPos>
|
||||
|
|
21
src/index.ts
21
src/index.ts
|
@ -44,6 +44,15 @@ function spriteMain(spriteName: string, runningEngine: RunningEngine, rootMesh:
|
|||
currentShape = currentShape.reconcile(spriteName, spriteName, shape);
|
||||
currentShape.node.parent = rootMesh;
|
||||
}
|
||||
|
||||
during SceneProtocol.Gravity($direction: Shapes.Vector3) => {
|
||||
runningEngine.camera.applyGravity = true;
|
||||
on stop runningEngine.camera.applyGravity = false;
|
||||
const frameRate = 60;
|
||||
runningEngine.scene.gravity = new Vector3(direction.x / frameRate,
|
||||
direction.y / frameRate,
|
||||
direction.z / frameRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,15 +122,6 @@ async function enterScene(
|
|||
}
|
||||
|
||||
at sceneDs {
|
||||
during SceneProtocol.Gravity($direction: Shapes.Vector3) => {
|
||||
camera.applyGravity = true;
|
||||
on stop camera.applyGravity = false;
|
||||
const frameRate = 60;
|
||||
runningEngine.scene.gravity = new Vector3(direction.x / frameRate,
|
||||
direction.y / frameRate,
|
||||
direction.z / frameRate);
|
||||
}
|
||||
|
||||
on message SceneProtocol.Touch({ "subject": id, "object": $o }) => {
|
||||
console.log('touched', o);
|
||||
react {
|
||||
|
@ -133,7 +133,8 @@ async function enterScene(
|
|||
}) => {
|
||||
const newPos = new Vector3(targetPosition.x,
|
||||
targetPosition.y,
|
||||
targetPosition.z);
|
||||
targetPosition.z)
|
||||
.add(runningEngine.options.initialPos);
|
||||
needStop = false;
|
||||
switch (dest._variant) {
|
||||
case "local":
|
||||
|
|
Loading…
Reference in New Issue