Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 129 bytes modified

beta.r3js.org
Theunis Johannes Botha 2018-05-21 14:44:03 +02:00
parent bfcbfd04ab
commit d202e28005
1 changed files with 3 additions and 5 deletions

View File

@ -61,6 +61,8 @@ this.debug = true;
this.gravity = -9.8; this.gravity = -9.8;
this.initialSpeed = 10;
if (this.debug) { if (this.debug) {
this.arrowHelper = new THREE.ArrowHelper( this.arrowHelper = new THREE.ArrowHelper(
new THREE.Vector3(0,0,-1), new THREE.Vector3(0,0,-1),
@ -168,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
@ -194,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);
@ -286,8 +286,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,
[ [
@ -361,7 +359,7 @@ R3.CustomCode.prototype.move = function(data) {
this.balls.push( this.balls.push(
{ {
mesh : this.activeBall, mesh : this.activeBall,
speed : 8, speed : this.initialSpeed,
mouseYTravelDistance : this.kick.distance, mouseYTravelDistance : this.kick.distance,
directionAngle : this.playerRotation.x + Math.PI, directionAngle : this.playerRotation.x + Math.PI,
kickDuration : this.kickDuration, kickDuration : this.kickDuration,