spoint 0.1.71 → 0.1.73

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.
@@ -246,7 +246,7 @@ function findSpawnPoints(ctx) {
246
246
  if (hit.hit && hit.position[1] > -3) valid.push([x, hit.position[1] + 2, z])
247
247
  }
248
248
  }
249
- if (valid.length < 4) valid.push([0, 5, 0], [-35, 3, -65], [20, 5, -20], [-20, 5, 20])
249
+ if (valid.length < 4) valid.push([0, 25, 0], [-35, 25, -65], [20, 25, -20], [-20, 25, 20])
250
250
  return valid
251
251
  }
252
252
 
@@ -58,7 +58,7 @@ export default {
58
58
  fadeTime: 0.15
59
59
  },
60
60
  entities: [
61
- { id: 'environment', model: './apps/tps-game/schwust.glb', position: [0, 5, 0], app: 'environment' },
61
+ { id: 'environment', model: './apps/tps-game/schwust.glb', position: [0, 20, 0], app: 'environment' },
62
62
  { id: 'game', position: [0, 0, 0], app: 'tps-game' },
63
63
  { id: 'power-crates', position: [0, 0, 0], app: 'power-crate' },
64
64
  { id: 'interact-box', position: [-100, 3, -100], app: 'interactable' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoint",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "description": "Physics and netcode SDK for multiplayer game servers",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -67,21 +67,16 @@ export class PhysicsIntegration {
67
67
  return state
68
68
  }
69
69
 
70
- _fallbackPhysics(playerId, state, deltaTime) {
71
- state.velocity[1] += this.config.gravity[1] * deltaTime
72
- state.position[0] += state.velocity[0] * deltaTime
73
- state.position[1] += state.velocity[1] * deltaTime
74
- state.position[2] += state.velocity[2] * deltaTime
75
- if (state.position[1] <= 0) {
76
- state.position[1] = 0
77
- state.velocity[1] = 0
78
- state.onGround = true
79
- } else {
80
- state.onGround = false
81
- }
82
- return state
83
- }
84
-
70
+ _fallbackPhysics(playerId, state, deltaTime) {
71
+ state.velocity[1] += this.config.gravity[1] * deltaTime
72
+ state.position[0] += state.velocity[0] * deltaTime
73
+ state.position[1] += state.velocity[1] * deltaTime
74
+ state.position[2] += state.velocity[2] * deltaTime
75
+ state.position[1] = Math.max(state.position[1], -100)
76
+ state.onGround = false
77
+ return state
78
+ }
79
+
85
80
  setPlayerPosition(playerId, position) {
86
81
  const data = this.playerBodies.get(playerId)
87
82
  if (data?.charId && this.physicsWorld) {