beta.r3js.org
-=yb4f310 2018-05-21 14:53:17 +02:00
parent 8d4f5b8b24
commit 8f217a0838
1 changed files with 3 additions and 9 deletions

View File

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