diff --git a/build/yuka.js b/build/yuka.js index aa487622..7239c812 100644 --- a/build/yuka.js +++ b/build/yuka.js @@ -3125,7 +3125,11 @@ * * @return {GameEntity} A reference to this game entity. */ - start() {} + start() { + + return this; + + } /** * Updates the internal state of this game entity. Normally called by {@link EntityManager#update} @@ -3134,7 +3138,11 @@ * @param {Number} delta - The time delta. * @return {GameEntity} A reference to this game entity. */ - update( /* delta */ ) {} + update( /* delta */ ) { + + return this; + + } /** diff --git a/build/yuka.min.js b/build/yuka.min.js index cec875b8..5326b381 100644 --- a/build/yuka.min.js +++ b/build/yuka.min.js @@ -107,8 +107,8 @@ e*J*b)*X;c[2]=(m*M*g-C*n*g+C*f*r-e*M*r-m*f*b+e*n*b)*X;c[3]=(D*n*g-m*J*g-D*f*r+e* D*f-z*m*f+z*e*n-d*D*n-k*e*J+d*m*J)*X;return a};R.prototype.getMaxScale=function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))};R.prototype.fromQuaternion=function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,k=d+d,m=e+e;a=c*g;var n=c*k;c*=m;var r=d*k;d*=m;e*=m;g*=f;k*=f;f*=m;b[0]=1-(r+e);b[4]=n-f;b[8]=c+k;b[1]=n+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-k;b[6]=d+g;b[10]=1-(a+r);b[3]=0;b[7]=0;b[11]=0;b[12]= 0;b[13]=0;b[14]=0;b[15]=1;return this};R.prototype.fromMatrix3=function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=0;b[4]=a[3];b[5]=a[4];b[6]=a[5];b[7]=0;b[8]=a[6];b[9]=a[7];b[10]=a[8];b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this};R.prototype.fromArray=function(a,b){b=void 0===b?0:b;for(var c=this.elements,d=0;16>d;d++)c[d]=a[d+b];return this};R.prototype.toArray=function(a,b){b=void 0===b?0:b;var c=this.elements;a[b+0]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+ 4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a};R.prototype.equals=function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0};var rc=new Q,Ta=new l,sc=new l,sb=new Q,P=function(){this.name="";this.active=!0;this.children=[];this.parent=null;this.neighbors=[];this.neighborhoodRadius=1;this.updateNeighborhood=!1;this.position=new l;this.rotation= -new Q;this.scale=new l(1,1,1);this.forward=new l(0,0,1);this.up=new l(0,1,0);this.boundingRadius=0;this.maxTurnRate=Math.PI;this.canActivateTrigger=!0;this.manager=null;this._localMatrix=new R;this._worldMatrix=new R;this._cache={position:new l,rotation:new Q,scale:new l(1,1,1)};this._renderComponentCallback=this._renderComponent=null;this._started=!1;this._uuid=null;this._worldMatrixDirty=!1};P.prototype.start=function(){};P.prototype.update=function(){};P.prototype.add=function(a){null!==a.parent&& -a.parent.remove(a);this.children.push(a);a.parent=this;return this};P.prototype.remove=function(a){var b=this.children.indexOf(a);this.children.splice(b,1);a.parent=null;return this};P.prototype.getDirection=function(a){return a.copy(this.forward).applyRotation(this.rotation).normalize()};P.prototype.lookAt=function(a){var b=this.parent;null!==b?(this.getWorldPosition(sc),Ta.subVectors(a,sc).normalize(),this.rotation.lookAt(this.forward,Ta,this.up),sb.extractRotationFromMatrix(b.worldMatrix).inverse(), +new Q;this.scale=new l(1,1,1);this.forward=new l(0,0,1);this.up=new l(0,1,0);this.boundingRadius=0;this.maxTurnRate=Math.PI;this.canActivateTrigger=!0;this.manager=null;this._localMatrix=new R;this._worldMatrix=new R;this._cache={position:new l,rotation:new Q,scale:new l(1,1,1)};this._renderComponentCallback=this._renderComponent=null;this._started=!1;this._uuid=null;this._worldMatrixDirty=!1};P.prototype.start=function(){return this};P.prototype.update=function(){return this};P.prototype.add=function(a){null!== +a.parent&&a.parent.remove(a);this.children.push(a);a.parent=this;return this};P.prototype.remove=function(a){var b=this.children.indexOf(a);this.children.splice(b,1);a.parent=null;return this};P.prototype.getDirection=function(a){return a.copy(this.forward).applyRotation(this.rotation).normalize()};P.prototype.lookAt=function(a){var b=this.parent;null!==b?(this.getWorldPosition(sc),Ta.subVectors(a,sc).normalize(),this.rotation.lookAt(this.forward,Ta,this.up),sb.extractRotationFromMatrix(b.worldMatrix).inverse(), this.rotation.premultiply(sb)):(Ta.subVectors(a,this.position).normalize(),this.rotation.lookAt(this.forward,Ta,this.up));return this};P.prototype.rotateTo=function(a,b,c){c=void 0===c?1E-4:c;var d=this.parent;null!==d?(this.getWorldPosition(sc),Ta.subVectors(a,sc).normalize(),rc.lookAt(this.forward,Ta,this.up),sb.extractRotationFromMatrix(d.worldMatrix).inverse(),rc.premultiply(sb)):(Ta.subVectors(a,this.position).normalize(),rc.lookAt(this.forward,Ta,this.up));return this.rotation.rotateTo(rc,this.maxTurnRate* b,c)};P.prototype.getWorldDirection=function(a){sb.extractRotationFromMatrix(this.worldMatrix);return a.copy(this.forward).applyRotation(sb).normalize()};P.prototype.getWorldPosition=function(a){return a.extractPositionFromMatrix(this.worldMatrix)};P.prototype.setRenderComponent=function(a,b){this._renderComponent=a;this._renderComponentCallback=b;return this};P.prototype.handleMessage=function(){return!1};P.prototype.lineOfSightTest=function(){return null};P.prototype.sendMessage=function(a,b,c, d){null!==this.manager?this.manager.sendMessage(this,a,b,void 0===c?0:c,void 0===d?null:d):E.error("YUKA.GameEntity: The game entity must be added to a manager in order to send a message.");return this};P.prototype.toJSON=function(){return{type:this.constructor.name,uuid:this.uuid,name:this.name,active:this.active,children:q(this.children),parent:null!==this.parent?this.parent.uuid:null,neighbors:q(this.neighbors),neighborhoodRadius:this.neighborhoodRadius,updateNeighborhood:this.updateNeighborhood, diff --git a/build/yuka.module.js b/build/yuka.module.js index 3394e7f3..69410b48 100644 --- a/build/yuka.module.js +++ b/build/yuka.module.js @@ -3119,7 +3119,11 @@ class GameEntity { * * @return {GameEntity} A reference to this game entity. */ - start() {} + start() { + + return this; + + } /** * Updates the internal state of this game entity. Normally called by {@link EntityManager#update} @@ -3128,7 +3132,11 @@ class GameEntity { * @param {Number} delta - The time delta. * @return {GameEntity} A reference to this game entity. */ - update( /* delta */ ) {} + update( /* delta */ ) { + + return this; + + } /** diff --git a/package.json b/package.json index bd11a247..05e53180 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yuka", - "version": "0.7.3", + "version": "0.7.4", "description": "JavaScript Game AI library", "repository": "Mugen87/yuka", "main": "build/yuka.js",