fix projectile colliders in movement
This commit is contained in:
+10
-10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user