fix projectile colliders in movement

This commit is contained in:
2025-01-19 20:55:16 +09:00
parent 072204b902
commit e4f1fe19f4
6 changed files with 30 additions and 21 deletions
+10 -10
View File
@@ -415,17 +415,17 @@ function connectWebSocket() {
scene.add(terrain)
terrains[t.id] = terrain
// TODO: bboxes aren't tracked and can leak memory
const bboxValues = Object.values(t.bbox)
if (bboxValues.length >= 4) {
const width = (bboxValues[1] - bboxValues[3]) / 100
const height = (bboxValues[0] - bboxValues[2]) / 100
// // TODO: bboxes aren't tracked and can leak memory
// const bboxValues = Object.values(t.bbox)
// if (bboxValues.length >= 4) {
// const width = (bboxValues[1] - bboxValues[3]) / 100
// const height = (bboxValues[0] - bboxValues[2]) / 100
const bbox = new THREE.Mesh(new THREE.BoxGeometry(width, height, 0.2), bboxMaterial)
bbox.position.set((bboxValues[3] / 100) + (width / 2), (bboxValues[2] / 100) + (height / 2), 0)
bbox.layers.set(1)
scene.add(bbox)
}
// const bbox = new THREE.Mesh(new THREE.BoxGeometry(width, height, 0.2), bboxMaterial)
// bbox.position.set((bboxValues[3] / 100) + (width / 2), (bboxValues[2] / 100) + (height / 2), 0)
// bbox.layers.set(1)
// scene.add(bbox)
// }
}
terrain.position.set(t.position.x / 100, t.position.y / 100, 0)