spoint 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -29,12 +29,10 @@ function encodeEntity(e) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function entityKey(encoded) {
|
|
32
|
-
let k =
|
|
33
|
-
for (let i =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
k += '|'
|
|
37
|
-
}
|
|
32
|
+
let k = encoded[1]
|
|
33
|
+
for (let i = 2; i < 10; i++) k += '|' + encoded[i]
|
|
34
|
+
k += '|' + encoded[9]
|
|
35
|
+
if (encoded[10] !== null && encoded[10] !== undefined) k += '|' + JSON.stringify(encoded[10])
|
|
38
36
|
return k
|
|
39
37
|
}
|
|
40
38
|
|
package/src/physics/World.js
CHANGED
|
@@ -11,6 +11,7 @@ export class PhysicsWorld {
|
|
|
11
11
|
this.bodies = new Map(); this.bodyMeta = new Map()
|
|
12
12
|
this._objFilter = null; this._ovbp = null
|
|
13
13
|
this._charShapes = new Map()
|
|
14
|
+
this._tmpVec3 = null; this._tmpRVec3 = null
|
|
14
15
|
}
|
|
15
16
|
async init() {
|
|
16
17
|
const J = await getJolt()
|
|
@@ -27,6 +28,7 @@ export class PhysicsWorld {
|
|
|
27
28
|
this._objFilter = objFilter; this._ovbp = ovbp
|
|
28
29
|
this.jolt = new J.JoltInterface(settings); J.destroy(settings)
|
|
29
30
|
this.physicsSystem = this.jolt.GetPhysicsSystem(); this.bodyInterface = this.physicsSystem.GetBodyInterface()
|
|
31
|
+
this._tmpVec3 = new J.Vec3(0, 0, 0); this._tmpRVec3 = new J.RVec3(0, 0, 0)
|
|
30
32
|
const [gx, gy, gz] = this.gravity
|
|
31
33
|
this.physicsSystem.SetGravity(new J.Vec3(gx, gy, gz))
|
|
32
34
|
return this
|