fixes
parent
8d4f5b8b24
commit
8f217a0838
|
@ -57,7 +57,7 @@ this.kickDistance = 0;
|
||||||
|
|
||||||
this.raycaster = new THREE.Raycaster();
|
this.raycaster = new THREE.Raycaster();
|
||||||
|
|
||||||
this.debug = true;
|
this.debug = false;
|
||||||
|
|
||||||
this.gravity = -9.8;
|
this.gravity = -9.8;
|
||||||
|
|
||||||
|
@ -170,7 +170,6 @@ R3.CustomCode.prototype.render = function(delta) {
|
||||||
ball.mesh.position.z > -5
|
ball.mesh.position.z > -5
|
||||||
) {
|
) {
|
||||||
|
|
||||||
console.warn('check for collision');
|
|
||||||
this.raycaster.set(ball.mesh.position, direction);
|
this.raycaster.set(ball.mesh.position, direction);
|
||||||
this.raycaster.intersectObjects([
|
this.raycaster.intersectObjects([
|
||||||
this.goalWithHoles.instance
|
this.goalWithHoles.instance
|
||||||
|
@ -196,7 +195,6 @@ R3.CustomCode.prototype.render = function(delta) {
|
||||||
ball.upAngle *= ball.bounciness;
|
ball.upAngle *= ball.bounciness;
|
||||||
ball.speed *= ball.bounciness * 1.5;
|
ball.speed *= ball.bounciness * 1.5;
|
||||||
ball.t = 0;
|
ball.t = 0;
|
||||||
console.log('collision', reflect);
|
|
||||||
|
|
||||||
ball.v.copy(direction);
|
ball.v.copy(direction);
|
||||||
|
|
||||||
|
@ -227,10 +225,8 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
var x = data.x;
|
var x = data.x;
|
||||||
var y = data.y;
|
var y = data.y;
|
||||||
|
|
||||||
if (data.source === 'mouse' || 'touch') {
|
|
||||||
x *= 0.0025;
|
x *= 0.0025;
|
||||||
y *= 0.0075;
|
y *= 0.0075;
|
||||||
}
|
|
||||||
|
|
||||||
this.playerRotation.x += x;
|
this.playerRotation.x += x;
|
||||||
this.playerRotation.y += y;
|
this.playerRotation.y += y;
|
||||||
|
@ -288,8 +284,6 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
|
|
||||||
if (this.canKick && this.activeBall === null) {
|
if (this.canKick && this.activeBall === null) {
|
||||||
|
|
||||||
console.log('can kick - creating new ball');
|
|
||||||
|
|
||||||
this.activeBall = new THREE.Mesh(
|
this.activeBall = new THREE.Mesh(
|
||||||
this.ballGeometry.instance,
|
this.ballGeometry.instance,
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue