ditch THREE raycasting for SAT again
This commit is contained in:
+1
-6
@@ -1,5 +1,4 @@
|
||||
import * as THREE from 'three'
|
||||
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'
|
||||
|
||||
const global = (0,eval)("this")
|
||||
const scene = new THREE.Scene()
|
||||
@@ -23,16 +22,12 @@ directionalLight.position.set(-0.3, 0.1, 1)
|
||||
directionalLight.power = 3000
|
||||
scene.add(directionalLight)
|
||||
|
||||
// const loader = new GLTFLoader()
|
||||
// loader.load('player.gltf', (gltf) => scene.add(gltf.scene), undefined, (err) => console.log(err))
|
||||
|
||||
global.THREE = THREE
|
||||
global.renderer = renderer
|
||||
global.camera = camera
|
||||
global.scene = scene
|
||||
camera.position.set(3, -12, 10)
|
||||
camera.rotation.set((60 / 180) * Math.PI, 0, 0)
|
||||
// camera.lookAt(0, 0, 0)
|
||||
|
||||
function animate() {
|
||||
renderer.render(scene, camera)
|
||||
@@ -81,7 +76,7 @@ function connectWebSocket() {
|
||||
entities[e.id] = entity
|
||||
}
|
||||
|
||||
entity.position.set(e.pos.x / 100, e.pos.y / 100, e.radius / 100)
|
||||
entity.position.set(e.position.x / 100, e.position.y / 100, e.radius / 100)
|
||||
}
|
||||
|
||||
document.getElementById('state').innerHTML = JSON.stringify(state, null, 2)
|
||||
|
||||
Reference in New Issue
Block a user