-
- < DetailsPanel ballCount={ballCount} fps={fps} toggleSpawning={() => { spawnBalls = !spawnBalls; }} />
-
- );
-}
-
-export default MyThree;
diff --git a/fission/src/systems/World.ts b/fission/src/systems/World.ts
new file mode 100644
index 0000000000..68a2c6c52f
--- /dev/null
+++ b/fission/src/systems/World.ts
@@ -0,0 +1,47 @@
+import * as THREE from "three";
+
+import PhysicsSystem from "./physics/PhysicsSystem";
+import SceneRenderer from "./scene/SceneRenderer";
+
+class World {
+
+ private static _isAlive: boolean = false;
+ private static _clock: THREE.Clock;
+
+ private static _sceneRenderer: SceneRenderer;
+ private static _physicsSystem: PhysicsSystem;
+
+ public static get isAlive() { return World._isAlive; }
+
+ public static get SceneRenderer() { return World._sceneRenderer; }
+ public static get PhysicsSystem() { return World._physicsSystem; }
+
+ public static InitWorld() {
+ if (World._isAlive)
+ return;
+
+ World._clock = new THREE.Clock();
+ World._isAlive = true;
+
+ World._sceneRenderer = new SceneRenderer();
+ World._physicsSystem = new PhysicsSystem();
+ }
+
+ public static DestroyWorld() {
+ if (!World._isAlive)
+ return;
+
+ World._isAlive = false;
+
+ World._physicsSystem.Destroy();
+ World._sceneRenderer.Destroy();
+ }
+
+ public static UpdateWorld() {
+ const deltaT = World._clock.getDelta();
+ this._physicsSystem.Update(deltaT);
+ this._sceneRenderer.Update(deltaT);
+ }
+}
+
+export default World;
\ No newline at end of file
diff --git a/fission/src/systems/WorldSystem.ts b/fission/src/systems/WorldSystem.ts
new file mode 100644
index 0000000000..f45891980c
--- /dev/null
+++ b/fission/src/systems/WorldSystem.ts
@@ -0,0 +1,5 @@
+abstract class WorldSystem {
+ public abstract Update(deltaT: number): void;
+ public abstract Destroy(): void;
+}
+export default WorldSystem;
\ No newline at end of file
diff --git a/fission/src/systems/physics/PhysicsSystem.ts b/fission/src/systems/physics/PhysicsSystem.ts
index fcfc8a8cf8..2cfc967a5a 100644
--- a/fission/src/systems/physics/PhysicsSystem.ts
+++ b/fission/src/systems/physics/PhysicsSystem.ts
@@ -1,33 +1,36 @@
-import { MirabufVector3_JoltVec3, MirabufVector3_ThreeVector3, ThreeVector3_JoltVec3, _JoltQuat } from "../../util/TypeConversions";
+import { MirabufFloatArr_JoltVec3, ThreeMatrix4_JoltMat44, ThreeVector3_JoltVec3, _JoltQuat } from "../../util/TypeConversions";
import JOLT from "../../util/loading/JoltSyncLoader";
import Jolt from "@barclah/jolt-physics";
import * as THREE from 'three';
import { mirabuf } from '../../proto/mirabuf';
-import MirabufParser from "../../mirabuf/MirabufParser";
+import MirabufParser, { RigidNodeReadOnly } from "../../mirabuf/MirabufParser";
+import WorldSystem from "../WorldSystem";
const LAYER_NOT_MOVING = 0;
const LAYER_MOVING = 1;
const COUNT_OBJECT_LAYERS = 2;
-const STANDARD_TIME_STEP = 1.0 / 60.0;
-const STANDARD_SUB_STEPS = 1;
+const STANDARD_TIME_STEP = 1.0 / 120.0;
+const STANDARD_SUB_STEPS = 3;
/**
* The PhysicsSystem handles all Jolt Phyiscs interactions within Synthesis.
* This system can create physical representations of objects such as Robots,
* Fields, and Game pieces, and simulate them.
*/
-export class PhysicsSystem {
+class PhysicsSystem extends WorldSystem {
private _joltInterface: Jolt.JoltInterface;
private _joltPhysSystem: Jolt.PhysicsSystem;
private _joltBodyInterface: Jolt.BodyInterface;
- private _bodies: Array