Site
- remove cannon js from multionlinegame
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
|
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
|
||||||
/* Updated: 2024/09/30 02:12:33 by edbernar ### ########.fr */
|
/* Updated: 2024/09/30 14:01:36 by edbernar ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -430,7 +430,8 @@ function moveCamera()
|
|||||||
const distance = camera.position.distanceTo(screen.tv.position);
|
const distance = camera.position.distanceTo(screen.tv.position);
|
||||||
|
|
||||||
camera.position.copy(position);
|
camera.position.copy(position);
|
||||||
if (position.equals(targetPosition) || distance < 0.1)
|
console.log(distance);
|
||||||
|
if (position.equals(targetPosition) || distance < 0.15)
|
||||||
{
|
{
|
||||||
pageRenderer.changePage('lobbyPage');
|
pageRenderer.changePage('lobbyPage');
|
||||||
return ;
|
return ;
|
||||||
|
@ -6,22 +6,18 @@
|
|||||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
|
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
|
||||||
/* Updated: 2024/09/29 23:31:12 by edbernar ### ########.fr */
|
/* Updated: 2024/09/30 13:58:31 by edbernar ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
import * as THREE from '/static/javascript/three/build/three.module.js'
|
import * as THREE from '/static/javascript/three/build/three.module.js'
|
||||||
|
|
||||||
const timeStep = 1 / 60;
|
|
||||||
|
|
||||||
class Ball
|
class Ball
|
||||||
{
|
{
|
||||||
object = null;
|
object = null;
|
||||||
centerPos = {};
|
centerPos = {};
|
||||||
limits = {};
|
limits = {};
|
||||||
interval = null;
|
interval = null;
|
||||||
world = null;
|
|
||||||
ballBody = null;
|
|
||||||
lastTime = 0;
|
lastTime = 0;
|
||||||
velocity = [0, 0];
|
velocity = [0, 0];
|
||||||
lastPos = [0, 0, 0];
|
lastPos = [0, 0, 0];
|
||||||
@ -34,13 +30,6 @@ class Ball
|
|||||||
this.limits = map.playerLimits;
|
this.limits = map.playerLimits;
|
||||||
this.resetPosBall();
|
this.resetPosBall();
|
||||||
scene.add(this.object);
|
scene.add(this.object);
|
||||||
this.world = new CANNON.World();
|
|
||||||
this.ballBody = new CANNON.Body({
|
|
||||||
shape: new CANNON.Sphere(0.15),
|
|
||||||
mass: 10,
|
|
||||||
});
|
|
||||||
this.ballBody.position.copy(this.object.position);
|
|
||||||
this.world.addBody(this.ballBody);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#createBall()
|
#createBall()
|
||||||
|
Reference in New Issue
Block a user