diff --git a/README.md b/README.md index 4538d17..6bc1e90 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -OimoPhysics 1.2.4 +OimoPhysics 1.2.5 --- A lightweight 3D physics engine. @@ -55,7 +55,7 @@ A lightweight 3D physics engine. * Convex casting ## Compilations -Haxe 4.2.0 or later is required. (recommended: Haxe 4.2.4 or later) +Haxe 4.3.4 or later is required. * Use `build-js.hxml` to compile for JavaScript library. * Use `build-js-demos.hxml` to compile JavaScript demos. * Use `build-doc.hxml` to generate API documentation. [dox](https://github.com/HaxeFoundation/dox) is required. diff --git a/bin/js/OimoPhysics.js b/bin/js/OimoPhysics.js index 655920c..b215185 100644 --- a/bin/js/OimoPhysics.js +++ b/bin/js/OimoPhysics.js @@ -1,4 +1,4 @@ -/* OimoPhysics 1.2.4 (c) 2022 saharan, The MIT License */ +/* OimoPhysics 1.2.5 (c) 2024 saharan, The MIT License */ (function ($global) { "use strict"; class HxOverrides { static now() { @@ -1025,14 +1025,11 @@ class oimo_collision_broadphase_bruteforce_BruteForceBroadPhase extends oimo_col collectPairs() { let p = this._proxyPairList; if(p != null) { - while(true) { + do { p._p1 = null; p._p2 = null; p = p._next; - if(!(p != null)) { - break; - } - } + } while(p != null); this._proxyPairList._next = this._proxyPairPool; this._proxyPairPool = this._proxyPairList; this._proxyPairList = null; @@ -1905,14 +1902,11 @@ class oimo_collision_broadphase_bvh_BvhBroadPhase extends oimo_collision_broadph collectPairs() { let p = this._proxyPairList; if(p != null) { - while(true) { + do { p._p1 = null; p._p2 = null; p = p._next; - if(!(p != null)) { - break; - } - } + } while(p != null); this._proxyPairList._next = this._proxyPairPool; this._proxyPairPool = this._proxyPairList; this._proxyPairList = null; @@ -3414,7 +3408,6 @@ class oimo_collision_geometry_CapsuleGeometry extends oimo_collision_geometry_Co return false; } tminxz = 0; - tmaxxz = 1; } let crossY = beginY + (endY - beginY) * tminxz; let min; @@ -5335,27 +5328,15 @@ class oimo_collision_narrowphase_detector_BoxBoxDetector extends oimo_collision_ c12X = -c12X; c12Y = -c12Y; c12Z = -c12Z; - let tmp = b1; - b1 = b2; - b2 = tmp; - let tmp1 = w1; w1 = w2; - w2 = tmp1; - let tmp2 = h1; h1 = h2; - h2 = tmp2; - let tmp3 = d1; d1 = d2; - d2 = tmp3; tmpX = c1X; tmpY = c1Y; tmpZ = c1Z; c1X = c2X; c1Y = c2Y; c1Z = c2Z; - c2X = tmpX; - c2Y = tmpY; - c2Z = tmpZ; tmpX = x1X; tmpY = x1Y; tmpZ = x1Z; @@ -5527,7 +5508,6 @@ class oimo_collision_narrowphase_detector_BoxBoxDetector extends oimo_collision_ incId = 4; } if(-incDot < minIncDot) { - minIncDot = -incDot; incId = 5; } let incV1X; @@ -7046,7 +7026,7 @@ class oimo_collision_narrowphase_detector_gjkepa_EpaPolyhedron { let v = v1; let prevT = null; let firstT = null; - while(true) { + do { if(v._tmpEdgeLoopNext == null) { this._dumpAsObjModel(); this._status = 4; @@ -7092,10 +7072,7 @@ class oimo_collision_narrowphase_detector_gjkepa_EpaPolyhedron { } prevT = t; v = v._tmpEdgeLoopNext; - if(!(v != v1)) { - break; - } - } + } while(v != v1); if(!prevT.setAdjacentTriangle(firstT)) { this._status = 1; } @@ -12176,7 +12153,7 @@ class oimo_collision_narrowphase_detector_gjkepa_GjkEpa { oldDirX = v.x; oldDirY = v.y; oldDirZ = v.z; - while(true) { + do { let s0X; let s0Y; let s0Z; @@ -12256,8 +12233,7 @@ class oimo_collision_narrowphase_detector_gjkepa_GjkEpa { break; } this.simplexSize--; - break; - } + } while(false); let v1 = this.dir; v1.x = oldDirX; v1.y = oldDirY; @@ -15901,7 +15877,7 @@ class oimo_dynamics_ContactManager { let pp = this._broadPhase._proxyPairList; while(pp != null) { let n = pp._next; - while(true) { + do { let s1; let s2; if(pp._p1._id < pp._p2._id) { @@ -15990,8 +15966,7 @@ class oimo_dynamics_ContactManager { _this._tf2 = _this._b2._transform; this._numContacts++; } - break; - } + } while(false); pp = n; } } @@ -16000,7 +15975,7 @@ class oimo_dynamics_ContactManager { let c = this._contactList; while(c != null) { let n = c._next; - while(true) { + do { if(c._latest) { c._latest = false; c._shouldBeSkipped = false; @@ -16195,8 +16170,7 @@ class oimo_dynamics_ContactManager { break; } c._shouldBeSkipped = !(aabb1._minX < aabb2._maxX && aabb1._maxX > aabb2._minX && aabb1._minY < aabb2._maxY && aabb1._maxY > aabb2._minY && aabb1._minZ < aabb2._maxZ && aabb1._maxZ > aabb2._minZ); - break; - } + } while(false); c = n; } } @@ -16348,9 +16322,9 @@ class oimo_dynamics_Island { rb._angularContactImpulseX = 0; rb._angularContactImpulseY = 0; rb._angularContactImpulseZ = 0; - if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < oimo_common_Setting.sleepingVelocityThreshold * oimo_common_Setting.sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < oimo_common_Setting.sleepingAngularVelocityThreshold * oimo_common_Setting.sleepingAngularVelocityThreshold) { + if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < rb._sleepingVelocityThreshold * rb._sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < rb._sleepingAngularVelocityThreshold * rb._sleepingAngularVelocityThreshold) { rb._sleepTime += dt; - if(rb._sleepTime > oimo_common_Setting.sleepingTimeThreshold) { + if(rb._sleepTime >= rb._sleepingTimeThreshold) { rb._sleeping = true; rb._sleepTime = 0; } @@ -16552,12 +16526,12 @@ class oimo_dynamics_Island { rb._angularContactImpulseY = 0; rb._angularContactImpulseZ = 0; rb._sleeping = false; - if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < oimo_common_Setting.sleepingVelocityThreshold * oimo_common_Setting.sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < oimo_common_Setting.sleepingAngularVelocityThreshold * oimo_common_Setting.sleepingAngularVelocityThreshold) { + if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < rb._sleepingVelocityThreshold * rb._sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < rb._sleepingAngularVelocityThreshold * rb._sleepingAngularVelocityThreshold) { rb._sleepTime += dt; } else { rb._sleepTime = 0; } - if(rb._sleepTime < oimo_common_Setting.sleepingTimeThreshold) { + if(rb._sleepTime < rb._sleepingTimeThreshold) { sleepIsland = false; } if(rb._type == 0) { @@ -19741,8 +19715,7 @@ class oimo_dynamics_common_DebugDraw { let i = _g1++; let v2 = this.tmpCircleVerts2[i]; let v3 = this.tmpCircleVerts2[(i + 1) % 8]; - let n1 = this.tmpCircleVerts1[i]; - this.triangle(_this7,v2,v3,n1,this.tmpCircleNorms[i],this.tmpCircleNorms[(i + 1) % 8],color); + this.triangle(_this7,v2,v3,this.tmpCircleVerts1[i],this.tmpCircleNorms[i],this.tmpCircleNorms[(i + 1) % 8],color); v2 = this.tmpCircleVerts2[(i + 1) % 8]; v3 = this.tmpCircleVerts2[i]; let _this = this.p; @@ -19754,7 +19727,6 @@ class oimo_dynamics_common_DebugDraw { _this2.x = -_this2.x; _this2.y = -_this2.y; _this2.z = -_this2.z; - n1 = _this2; this.triangle(_this10,v2,v3,_this2,_this2,_this2,color); let _this3 = this.p; if(_this2 != null) { @@ -22317,7 +22289,6 @@ class oimo_dynamics_constraint_contact_ManifoldUpdater { maxDepthIndex = 2; } if(p4._depth > maxDepth) { - maxDepth = p4._depth; maxDepthIndex = 3; } let rp1X; @@ -22596,7 +22567,6 @@ class oimo_dynamics_constraint_contact_ManifoldUpdater { let a13 = cross1X3 * cross1X3 + cross1Y3 * cross1Y3 + cross1Z3 * cross1Z3; let a24 = cross2X3 * cross2X3 + cross2Y3 * cross2Y3 + cross2Z3 * cross2Z3; let a34 = cross3X3 * cross3X3 + cross3Y3 * cross3Y3 + cross3Z3 * cross3Z3; - let a4 = a13 > a24 ? a13 > a34 ? a13 : a34 : a24 > a34 ? a24 : a34; let max = a1 > a2 ? a1 > a3 ? a1 : a3 : a2 > a3 ? a2 : a3; let target = 0; if(a22 > max && maxDepthIndex != 1 || maxDepthIndex == 0) { @@ -22607,8 +22577,7 @@ class oimo_dynamics_constraint_contact_ManifoldUpdater { max = a33; target = 2; } - if(a4 > max && maxDepthIndex != 3) { - max = a4; + if((a13 > a24 ? a13 > a34 ? a13 : a34 : a24 > a34 ? a24 : a34) > max && maxDepthIndex != 3) { target = 3; } return target; @@ -27107,13 +27076,10 @@ class oimo_dynamics_constraint_joint_RagdollJoint extends oimo_dynamics_constrai swingVX *= invLen * this._swingAngle; swingVY *= invLen * this._swingAngle; swingVZ *= invLen * this._swingAngle; - let __tmp__X1; let __tmp__Y1; let __tmp__Z1; - __tmp__X1 = basis1Mat00 * swingVX + basis1Mat10 * swingVY + basis1Mat20 * swingVZ; __tmp__Y1 = basis1Mat01 * swingVX + basis1Mat11 * swingVY + basis1Mat21 * swingVZ; __tmp__Z1 = basis1Mat02 * swingVX + basis1Mat12 * swingVY + basis1Mat22 * swingVZ; - swingVX = __tmp__X1; swingVY = __tmp__Y1; swingVZ = __tmp__Z1; let x1 = swingVY; @@ -33341,6 +33307,9 @@ class oimo_dynamics_rigidbody_RigidBody { this._sleepTime = 0; this._sleeping = false; this._autoSleep = config.autoSleep; + this._sleepingVelocityThreshold = config.sleepingVelocityThreshold; + this._sleepingAngularVelocityThreshold = config.sleepingAngularVelocityThreshold; + this._sleepingTimeThreshold = config.sleepingTimeThreshold; this._mass = 0; this._invMass = 0; this._localInertia00 = 0; @@ -37132,9 +37101,12 @@ class oimo_dynamics_rigidbody_RigidBodyConfig { this.linearVelocity = new oimo_common_Vec3(); this.angularVelocity = new oimo_common_Vec3(); this.type = 0; - this.autoSleep = true; this.linearDamping = 0; this.angularDamping = 0; + this.autoSleep = true; + this.sleepingVelocityThreshold = oimo_common_Setting.sleepingVelocityThreshold; + this.sleepingAngularVelocityThreshold = oimo_common_Setting.sleepingAngularVelocityThreshold; + this.sleepingTimeThreshold = oimo_common_Setting.sleepingTimeThreshold; } } class oimo_dynamics_rigidbody_RigidBodyType { diff --git a/bin/js/OimoPhysics.min.js b/bin/js/OimoPhysics.min.js index e6e98e4..7cd9f4c 100644 --- a/bin/js/OimoPhysics.min.js +++ b/bin/js/OimoPhysics.min.js @@ -1,839 +1,838 @@ -/* OimoPhysics 1.2.4 (c) 2022 saharan, The MIT License */var pc="function"==typeof Object.create?Object.create:function($e){function Ab(){}Ab.prototype=$e;return new Ab},yk;if("function"==typeof Object.setPrototypeOf)yk=Object.setPrototypeOf;else{var zk;a:{var Tk={a:!0},Uk={};try{Uk.__proto__=Tk;zk=Uk.a;break a}catch($e){}zk=!1}yk=zk?function($e,Ab){$e.__proto__=Ab;if($e.__proto__!==Ab)throw new TypeError($e+" is not extensible");return $e}:null}var ql=yk; -function rl($e,Ab){$e.prototype=pc(Ab.prototype);$e.prototype.constructor=$e;if(ql)ql($e,Ab);else for(var Eh in Ab)if("prototype"!=Eh)if(Object.defineProperties){var qk=Object.getOwnPropertyDescriptor(Ab,Eh);qk&&Object.defineProperty($e,Eh,qk)}else $e[Eh]=Ab[Eh];$e.Si=Ab.prototype} -(function(){function $e(){this.position=new z;this.rotation=new ia;this.friction=ra.defaultFriction;this.restitution=ra.defaultRestitution;this.density=ra.defaultDensity;this.collisionGroup=ra.defaultCollisionGroup;this.collisionMask=ra.defaultCollisionMask;this.contactCallback=this.geometry=null}function Ab(a){this.uc=-1;this.ra=new Ob;this.za=new Ob;this.g=new Ob;var b=a.position;this.ra.F=b.x;this.ra.G=b.y;this.ra.H=b.z;b=a.rotation;this.ra.A=b.e00;this.ra.j=b.e01;this.ra.m=b.e02;this.ra.o=b.e10; -this.ra.v=b.e11;this.ra.s=b.e12;this.ra.u=b.e20;this.ra.l=b.e21;this.ra.B=b.e22;b=this.za;var e=this.ra;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;b=this.g;e=this.ra;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;this.kh=a.restitution;this.dh=a.friction;this.Qh=a.density;this.Tb=a.geometry;this.$g=a.collisionGroup;this.ah=a.collisionMask;this.ld=a.contactCallback;this.D=new Pb;this.Eb=null;this.qc= -new z}function Eh(){}function qk(){this.position=new z;this.rotation=new ia;this.linearVelocity=new z;this.angularVelocity=new z;this.type=0;this.autoSleep=!0;this.angularDamping=this.linearDamping=0}function J(a){this.Jb=this.vc=this.sa=this.U=null;this.nf=0;this.oc=this.Zb=null;this.Pd=0;this.fe=this.Od=null;this.Mf=0;var b=a.linearVelocity;this.ub=b.x;this.vb=b.y;this.wb=b.z;b=a.angularVelocity;this.xb=b.x;this.yb=b.y;this.zb=b.z;this.Lc=this.Kc=this.Jc=this.Rc=this.Qc=this.Pc=0;this.za=new Ob; -this.g=new Ob;b=a.position;this.za.F=b.x;this.za.G=b.y;this.za.H=b.z;b=a.rotation;this.za.A=b.e00;this.za.j=b.e01;this.za.m=b.e02;this.za.o=b.e10;this.za.v=b.e11;this.za.s=b.e12;this.za.u=b.e20;this.za.l=b.e21;this.za.B=b.e22;b=this.g;var e=this.za;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;this.Xb=a.type;this.Kb=0;this.Ob=!1;this.Oh=a.autoSleep;this.ja=this.ia=this.ha=this.ga=this.fa=this.ea=this.da=this.ca=this.ba=this.Ib=this.ob=this.nb=this.Ya= -this.Wa=this.Sa=this.Oa=this.Ma=this.qa=this.kb=this.jb=this.ib=this.hb=this.gb=this.fb=this.eb=this.cb=this.bb=this.aa=this.Y=this.W=this.V=this.M=this.I=this.C=this.i=this.h=this.Ab=this.Ce=0;this.gh=a.linearDamping;this.Xg=a.angularDamping;this.Gf=this.Ff=this.Ef=this.Kf=this.Jf=this.If=this.Fe=this.Ee=this.De=this.ag=this.$f=this.Zf=0;this.X=new z(1,1,1);this.Ke=!1;this.Hf=1;this.pc=null}function Vk(){this.mass=0;this.localInertia=new ia}function xd(a){var b=bd.call(this)||this;b.h=a;b.info=new Wk; -b.i=Array(ra.maxJacobianRows);a=0;for(var e=b.i.length;a>1&85);d=(d&51)+(d>>2&51);d=(d&15)+(d>>4&15);c=Array(d);for(f=0;fe.e00* -(e.e11*e.e22-e.e12*e.e21)-e.e01*(e.e10*e.e22-e.e12*e.e20)+e.e02*(e.e10*e.e21-e.e11*e.e20)?e=!0:(e=a.localBasis2,e=0>e.e00*(e.e11*e.e22-e.e12*e.e21)-e.e01*(e.e10*e.e22-e.e12*e.e20)+e.e02*(e.e10*e.e21-e.e11*e.e20));e&&console.log("src/oimo/dynamics/constraint/joint/GenericJoint.hx:50:","[warning] joint basis must be right handed");var d=a.localBasis1;e=d.e00;var c=d.e01;var f=d.e02;var h=d.e10;var k=d.e11;var g=d.e12;var l=d.e20;var m=d.e21;d=d.e22;var n=a.localBasis2;var q=n.e00;var p=n.e01;var r= -n.e02;var t=n.e10;var x=n.e11;var v=n.e12;var B=n.e20;var H=n.e21;n=n.e22;b.i=e;b.C=h;b.I=l;b.Ya=c;b.nb=k;b.ob=m;b.Ib=f;b.Jb=g;b.Pb=d;b.V=q;b.W=t;b.Y=B;b.je=p;b.He=x;b.Ie=H;b.Rb=r;b.Sb=v;b.Wb=n;b.qe=0;b.Df=0;b.re=0;b.tc=0;b.vd=0;b.yc=0;b.hd=!1;b.jd=!1;b.wd=!1;b.Oe=Array(3);b.bc=Array(3);b.Ne=Array(3);b.ac=Array(3);b.Oe[0]=a.translationalLimitMotors[0].clone();b.Oe[1]=a.translationalLimitMotors[1].clone();b.Oe[2]=a.translationalLimitMotors[2].clone();b.bc[0]=a.translationalSpringDampers[0].clone(); -b.bc[1]=a.translationalSpringDampers[1].clone();b.bc[2]=a.translationalSpringDampers[2].clone();b.Ne[0]=a.rotationalLimitMotors[0].clone();b.Ne[1]=a.rotationalLimitMotors[1].clone();b.Ne[2]=a.rotationalLimitMotors[2].clone();b.ac[0]=a.rotationalSpringDampers[0].clone();b.ac[1]=a.rotationalSpringDampers[1].clone();b.ac[2]=a.rotationalSpringDampers[2].clone();return b}function Yj(){var a=qf.call(this)||this;a.localAxis1=new z(1,0,0);a.localAxis2=new z(1,0,0);a.translationalLimitMotor=new rf;a.translationalSpringDamper= -new Fd;a.rotationalLimitMotor=new te;a.rotationalSpringDamper=new Fd;return a}function qf(){this.rigidBody2=this.rigidBody1=null;this.localAnchor1=new z;this.localAnchor2=new z;this.allowCollision=!1;this.solverType=ra.defaultJointConstraintSolverType;this.positionCorrectionAlgorithm=ra.defaultJointPositionCorrectionAlgorithm;this.breakTorque=this.breakForce=0}function dc(a){var b=za.call(this,a,2)||this;var e=a.localAxis1;b.i=e.x;b.C=e.y;b.I=e.z;e=a.localAxis2;b.V=e.x;b.W=e.y;b.Y=e.z;b.mg();b.Va= -0;b.tc=0;b.vd=0;b.Xa=0;b.ac=0;b.bc=0;b.h=new Dk(b);b.Fb=a.translationalSpringDamper.clone();b.Yh=a.translationalLimitMotor.clone();b.tb=a.rotationalSpringDamper.clone();b.Vh=a.rotationalLimitMotor.clone();return b}function za(a,b){this.Bb=new Gf(this);this.Cb=new Gf(this);this.pf=ra.defaultJointPositionCorrectionAlgorithm;this.Xb=b;this.pc=null;this.J=a.rigidBody1;this.K=a.rigidBody2;this.Nh=a.allowCollision;this.rf=a.breakForce;this.sf=a.breakTorque;switch(a.solverType){case 0:this.mh=new xd(this); -break;case 1:this.mh=new yd(this)}b=a.localAnchor1;this.tf=b.x;this.uf=b.y;this.vf=b.z;a=a.localAnchor2;this.wf=a.x;this.yf=a.y;this.zf=a.z;this.Wb=this.Sb=this.Rb=this.Ie=this.He=this.je=this.Y=this.W=this.V=this.Pb=this.Jb=this.Ib=this.ob=this.nb=this.Ya=this.I=this.C=this.i=this.pe=this.oe=this.ne=this.me=this.le=this.ke=this.Wa=this.Sa=this.Oa=this.Ma=this.qa=this.aa=0;this.M=Array(ra.maxJacobianRows);a=0;for(b=ra.maxJacobianRows;aa;){var b=a++,e=0==b||4==b?1:8;this.W[b]=Array(e);this.M[b]=Array(e);this.Y[b]=Array(e);for(e=0;8>e;){var d=e++,c=.7853981633974475*b,f=.7853981633974475*d;this.W[b][d]=new z(Math.sin(c)*Math.cos(f),Math.cos(c),-Math.sin(c)*Math.sin(f));this.M[b][d]=new z;this.Y[b][d]=new z}}this.V=Array(8);this.aa=Array(8);this.C=Array(8); -this.i=Array(8);this.I=Array(8);for(a=0;8>a;)b=a++,this.V[b]=new z(Math.cos(.7853981633974475*b),0,-Math.sin(.7853981633974475*b)),this.aa[b]=new z(Math.cos(.7853981633974475*(b+.5)),0,-Math.sin(.7853981633974475*(b+.5))),this.C[b]=new z,this.i[b]=new z,this.I[b]=new z;this.style=new al}function aj(){this.position=new z;this.normal=new z;this.shape=null;this.fraction=1;this.position.$();this.normal.$();this.hit=!1;return this}function Ek(){}function ak(){}function bl(){}function Fk(){this.D=new Pb; -this.h=null;return this}function Gk(){this.C=new rk;this.h=new Ob;this.I=new z;this.$=new z;this.M=this.i=null;return this}function Hk(){this.C=new rk;this.h=new z;this.end=new z;this.i=null;return this}function tb(a,b){null==a&&(a=2);switch(a){case 1:this.nc=new Od;break;case 2:this.nc=new cd}this.Xf=new rg(this.nc);null==b&&(b=new z(0,-9.80665,0));this.Jb=new z(b.x,b.y,b.z);this.Ma=this.Y=this.Oa=this.I=null;this.Ya=this.Pb=this.nf=this.Wa=0;this.Sb=10;this.Rb=5;this.nb=new Hk;this.Sa=new Gk;this.ob= -new Fk;this.M=new Mj;this.i=Array(ra.islandInitialConstraintArraySize);this.W=Array(ra.islandInitialRigidBodyArraySize);this.aa=new cl;this.h=new jd;this.Ci=0}function cl(){this.invDt=this.dt=0;this.dtRatio=1}function Mj(){this.C=Array(ra.islandInitialRigidBodyArraySize);this.I=Array(ra.islandInitialConstraintArraySize);this.Y=Array(ra.islandInitialConstraintArraySize);this.W=Array(ra.islandInitialConstraintArraySize);this.M=this.V=this.i=this.h=0}function rg(a){this.nc=a;this.C=new bk;this.pg=0} -function Hf(){this.Fc=this.zd=this.U=this.sa=null}function Jd(){this.sa=this.U=null;this.Bb=new Hf;this.Cb=new Hf;this.Yf=this.K=this.J=this.jc=this.ic=null;this.Eg=new dl;this.W=new bj;this.lh=this.fh=!1;this.Ra=new nd;this.h=new $i(this.Ra);this.ee=new af(this.Ra);this.xd=!1}function Gb(a,b,e,d){null==d&&(d=1);null==e&&(e=0);null==b&&(b=0);null==a&&(a=0);this.x=a;this.y=b;this.z=e;this.w=d;Gb.numCreations++}function jd(){this.i=Array(256);this.h=0;this.C=Array(256);this.I=0;this.W=Array(256);this.Y= -0;this.M=Array(256);this.V=0}function Sb(){}function Ha(a,b,e,d,c,f,h,k,g,l,m,n,q,p,r,t){null==t&&(t=1);null==r&&(r=0);null==p&&(p=0);null==q&&(q=0);null==n&&(n=0);null==m&&(m=1);null==l&&(l=0);null==g&&(g=0);null==k&&(k=0);null==h&&(h=0);null==f&&(f=1);null==c&&(c=0);null==d&&(d=0);null==e&&(e=0);null==b&&(b=0);null==a&&(a=1);this.e00=a;this.e01=b;this.e02=e;this.e03=d;this.e10=c;this.e11=f;this.e12=h;this.e13=k;this.e20=g;this.e21=l;this.e22=m;this.e23=n;this.e30=q;this.e31=p;this.e32=r;this.e33= -t;Ha.numCreations++}function ia(a,b,e,d,c,f,h,k,g){null==g&&(g=1);null==k&&(k=0);null==h&&(h=0);null==f&&(f=0);null==c&&(c=1);null==d&&(d=0);null==e&&(e=0);null==b&&(b=0);null==a&&(a=1);this.e00=a;this.e01=b;this.e02=e;this.e10=d;this.e11=c;this.e12=f;this.e20=h;this.e21=k;this.e22=g;ia.numCreations++}function Gh(){}function Xg(){}function yc(){this.i=Array(4);this.mb=Array(4);this.sb=Array(4);this.qa=Array(3);this.qa[0]=new z(1,0,0);this.qa[1]=new z(0,1,0);this.qa[2]=new z(0,0,1);this.bc=new z;this.Sc= -new z;this.Fb=new z;this.tb=new z;this.ac=new Ob;this.i[0]=new z;this.mb[0]=new z;this.sb[0]=new z;this.i[1]=new z;this.mb[1]=new z;this.sb[1]=new z;this.i[2]=new z;this.mb[2]=new z;this.sb[2]=new z;this.i[3]=new z;this.mb[3]=new z;this.sb[3]=new z;this.C=new z;this.aa=new z;this.closestPoint1=new z;this.closestPoint2=new z;this.Y=new ck}function ra(){}function Ob(){this.H=this.G=this.F=0;this.A=1;this.o=this.m=this.j=0;this.v=1;this.l=this.u=this.s=0;this.B=1}function z(a,b,e){null==e&&(e=0);null== -b&&(b=0);null==a&&(a=0);this.x=a;this.y=b;this.z=e;z.numCreations++}function el(){this.vi=new z}function Aj(){this.kd=new z;this.mb=new z;this.sb=new z}function Hh(){this.id=++Hh.h;this.sa=this.U=null;this.jh=new z;this.Xh=this.bh=0;this.Lg=!1;this.Ja=Array(3);this.Ub=Array(3);this.Vb=Array(3);this.ng=new z;this.Ac=Array(3);this.Ac[0]=1;this.Ac[1]=2;this.Ac[2]=0}function ck(){this.Ja=Array(ra.maxEPAVertices);this.W=new z;this.Vd=0;this.i=this.C=null;this.V=0;this.M=this.I=null}function sk(){this.C= -!1;return this}function dk(a){this.C=a;return this}function ek(a){this.C=a;return this}function tk(){this.C=!1;return this}function uk(){this.C=!1;return this}function dl(){}function Ik(){this.C=this.I=this.M=this.w=0;this.i=Array(8);this.h=Array(8);this.i[0]=new sf;this.h[0]=new sf;this.i[1]=new sf;this.h[1]=new sf;this.i[2]=new sf;this.h[2]=new sf;this.i[3]=new sf;this.h[3]=new sf;this.i[4]=new sf;this.h[4]=new sf;this.i[5]=new sf;this.h[5]=new sf;this.i[6]=new sf;this.h[6]=new sf;this.i[7]=new sf; -this.h[7]=new sf}function sf(){this.ab=this.$a=this.Za=this.y=this.x=0}function vk(){this.C=!1;this.i=new Ik;return this}function sg(a){this.C=a}function fl(){this.position1=new z;this.position2=new z;this.id=this.depth=0}function bj(){this.numPoints=0;this.normal=new z;this.points=Array(ra.maxManifoldPoints);this.incremental=!1;for(var a=0,b=ra.maxManifoldPoints;a.2*a&&(b.fc=.2*a);return b}function Pb(){this.va=this.ua= -this.ta=this.ya=this.xa=this.wa=0}function Jk(){this.$b=null;this.M=0;this.I=new gl;this.i=this.C=this.h=null;this.ng=Array(1024)}function gl(){this.Yg=!1}function hl(a,b){a=tg.call(this,a,b)||this;a.bg=null;a.Lf=!1;return a}function wk(){this.Le=this.Me=this.U=null;this.L=Array(2);this.Ta=0;this.Ka=null;this.Z=0;this.Eb=null;this.P=this.O=this.N=this.T=this.S=this.R=0}function cd(){var a=tc.call(this,2)||this;a.eh=!0;a.h=new Jk;a.I=Array(1024);a.M=0;return a}function Od(){var a=tc.call(this,1)|| -this;a.eh=!1;return a}function Yg(){this.Of=this.Nf=null}function tg(a,b){this.userData=a;this.uc=b;this.U=this.sa=null;this.P=this.O=this.N=this.T=this.S=this.R=0}function Kk(){}function Cj(){}function Lk(){var a=kd.call(this,-1)||this;a.min=new z;a.max=new z;return a}function xk(){return kd.call(this,-1)||this}function kd(a){a=tf.call(this,a)||this;a.fc=ra.defaultGJKMargin;a.Ma=!1;return a}function tf(a){this.Xb=a;this.Ge=0}function tc(a){this.Xb=a;this.qa=0;this.Cd=this.C=this.i=null;this.eh=!1; -this.Ma=0;this.V=null;this.ob=0;this.Oa=new xk;this.D=new Lk;this.nb=new Ob;this.$=new z;new rk}function il(){}function Jh(){}Jh.h=function(){return Date.now()};il.h=function(){window.OIMO={};window.OIMO.BroadPhase=tc;tc.prototype.createProxy=tc.prototype.eg;tc.prototype.destroyProxy=tc.prototype.fg;tc.prototype.moveProxy=tc.prototype.fd;tc.prototype.isOverlapping=tc.prototype.Sb;tc.prototype.collectPairs=tc.prototype.qg;tc.prototype.getProxyPairList=tc.prototype.Ib;tc.prototype.isIncremental=tc.prototype.Rb; -tc.prototype.getTestCount=tc.prototype.Jb;tc.prototype.rayCast=tc.prototype.yd;tc.prototype.convexCast=tc.prototype.aa;tc.prototype.aabbTest=tc.prototype.Y;window.OIMO.Geometry=tf;tf.prototype.getType=tf.prototype.Oa;tf.prototype.getVolume=tf.prototype.nb;tf.prototype.rayCast=tf.prototype.yd;window.OIMO.ConvexGeometry=kd;kd.prototype.getGjkMergin=kd.prototype.Sa;kd.prototype.setGjkMergin=kd.prototype.ob;kd.prototype.computeLocalSupportingVertex=kd.prototype.ud;kd.prototype.rayCast=kd.prototype.yd; -window.OIMO.BroadPhaseProxyCallback=Cj;Cj.prototype.process=Cj.prototype.process;window.OIMO.BroadPhaseType=Kk;window.OIMO.Proxy=tg;tg.prototype.getId=tg.prototype.C;tg.prototype.getFatAabb=tg.prototype.h;tg.prototype.getFatAabbTo=tg.prototype.i;window.OIMO.ProxyPair=Yg;Yg.prototype.getProxy1=Yg.prototype.i;Yg.prototype.getProxy2=Yg.prototype.C;Yg.prototype.getNext=Yg.prototype.h;window.OIMO.BruteForceBroadPhase=Od;Od.prototype.createProxy=Od.prototype.eg;Od.prototype.destroyProxy=Od.prototype.fg; -Od.prototype.moveProxy=Od.prototype.fd;Od.prototype.collectPairs=Od.prototype.qg;Od.prototype.rayCast=Od.prototype.yd;Od.prototype.convexCast=Od.prototype.aa;Od.prototype.aabbTest=Od.prototype.Y;window.OIMO.BvhBroadPhase=cd;cd.prototype.createProxy=cd.prototype.eg;cd.prototype.destroyProxy=cd.prototype.fg;cd.prototype.moveProxy=cd.prototype.fd;cd.prototype.collectPairs=cd.prototype.qg;cd.prototype.rayCast=cd.prototype.yd;cd.prototype.convexCast=cd.prototype.aa;cd.prototype.aabbTest=cd.prototype.Y; -cd.prototype.getTreeBalance=cd.prototype.Pb;window.OIMO.Aabb=Pb;Pb.prototype.init=Pb.prototype.Ia;Pb.prototype.getMin=Pb.prototype.Ma;Pb.prototype.getMinTo=Pb.prototype.Oa;Pb.prototype.setMin=Pb.prototype.Ya;Pb.prototype.getMax=Pb.prototype.aa;Pb.prototype.getMaxTo=Pb.prototype.qa;Pb.prototype.setMax=Pb.prototype.Wa;Pb.prototype.getCenter=Pb.prototype.C;Pb.prototype.getCenterTo=Pb.prototype.I;Pb.prototype.getExtents=Pb.prototype.M;Pb.prototype.getExtentsTo=Pb.prototype.V;Pb.prototype.combine=Pb.prototype.h; -Pb.prototype.combined=Pb.prototype.i;Pb.prototype.overlap=Pb.prototype.Sa;Pb.prototype.getIntersection=Pb.prototype.W;Pb.prototype.getIntersectionTo=Pb.prototype.Y;Pb.prototype.copyFrom=Pb.prototype.Dd;Pb.prototype.clone=Pb.prototype.clone;window.OIMO.BoxGeometry=cg;cg.prototype.getHalfExtents=cg.prototype.Wa;cg.prototype.getHalfExtentsTo=cg.prototype.Ya;cg.prototype.computeLocalSupportingVertex=cg.prototype.ud;window.OIMO.CapsuleGeometry=bg;bg.prototype.getRadius=bg.prototype.C;bg.prototype.getHalfHeight= -bg.prototype.i;bg.prototype.computeLocalSupportingVertex=bg.prototype.ud;window.OIMO.ConeGeometry=ag;ag.prototype.getRadius=ag.prototype.M;ag.prototype.getHalfHeight=ag.prototype.I;ag.prototype.computeLocalSupportingVertex=ag.prototype.ud;window.OIMO.ConvexHullGeometry=Ih;Ih.prototype.getVertices=Ih.prototype.i;Ih.prototype.computeLocalSupportingVertex=Ih.prototype.ud;window.OIMO.CylinderGeometry=$f;$f.prototype.getRadius=$f.prototype.C;$f.prototype.getHalfHeight=$f.prototype.i;$f.prototype.computeLocalSupportingVertex= -$f.prototype.ud;window.OIMO.GeometryType=Bj;window.OIMO.RayCastHit=rk;window.OIMO.SphereGeometry=kh;kh.prototype.getRadius=kh.prototype.i;kh.prototype.computeLocalSupportingVertex=kh.prototype.ud;window.OIMO.CollisionMatrix=bk;bk.prototype.getDetector=bk.prototype.i;window.OIMO.DetectorResult=bj;bj.prototype.getMaxDepth=bj.prototype.h;bj.prototype.clear=bj.prototype.clear;window.OIMO.DetectorResultPoint=fl;window.OIMO.Detector=sg;sg.prototype.detect=sg.prototype.Ei;window.OIMO.BoxBoxDetector=vk;window.OIMO.CapsuleCapsuleDetector= -uk;window.OIMO.GjkEpaDetector=tk;window.OIMO.SphereBoxDetector=ek;window.OIMO.SphereCapsuleDetector=dk;window.OIMO.SphereSphereDetector=sk;window.OIMO.Vec3=z;z.prototype.init=z.prototype.Ia;z.prototype.zero=z.prototype.$;z.prototype.add=z.prototype.add;z.prototype.add3=z.prototype.aa;z.prototype.addScaled=z.prototype.Ma;z.prototype.sub=z.prototype.sub;z.prototype.sub3=z.prototype.Xa;z.prototype.scale=z.prototype.V;z.prototype.scale3=z.prototype.Wb;z.prototype.dot=z.prototype.i;z.prototype.cross=z.prototype.Sa; -z.prototype.addEq=z.prototype.h;z.prototype.add3Eq=z.prototype.qa;z.prototype.addScaledEq=z.prototype.Oa;z.prototype.subEq=z.prototype.Y;z.prototype.sub3Eq=z.prototype.tb;z.prototype.scaleEq=z.prototype.W;z.prototype.scale3Eq=z.prototype.Va;z.prototype.crossEq=z.prototype.Wa;z.prototype.mulMat3=z.prototype.Ya;z.prototype.mulMat4=z.prototype.ob;z.prototype.mulTransform=z.prototype.Jb;z.prototype.mulMat3Eq=z.prototype.nb;z.prototype.mulMat4Eq=z.prototype.Ib;z.prototype.mulTransformEq=z.prototype.Pb; -z.prototype.length=z.prototype.length;z.prototype.lengthSq=z.prototype.C;z.prototype.normalized=z.prototype.M;z.prototype.normalize=z.prototype.I;z.prototype.negate=z.prototype.Rb;z.prototype.negateEq=z.prototype.Sb;z.prototype.copyFrom=z.prototype.Dd;z.prototype.clone=z.prototype.clone;z.prototype.toString=z.prototype.toString;window.OIMO.Transform=Ob;Ob.prototype.identity=Ob.prototype.W;Ob.prototype.getPosition=Ob.prototype.C;Ob.prototype.getPositionTo=Ob.prototype.I;Ob.prototype.setPosition=Ob.prototype.Ma; -Ob.prototype.translate=Ob.prototype.Wa;Ob.prototype.getRotation=Ob.prototype.M;Ob.prototype.getRotationTo=Ob.prototype.V;Ob.prototype.setRotation=Ob.prototype.Oa;Ob.prototype.setRotationXyz=Ob.prototype.Sa;Ob.prototype.rotate=Ob.prototype.Y;Ob.prototype.rotateXyz=Ob.prototype.aa;Ob.prototype.getOrientation=Ob.prototype.h;Ob.prototype.getOrientationTo=Ob.prototype.i;Ob.prototype.setOrientation=Ob.prototype.qa;Ob.prototype.clone=Ob.prototype.clone;Ob.prototype.copyFrom=Ob.prototype.Dd;window.OIMO.Setting= -ra;window.OIMO.GjkEpa=yc;yc.prototype.computeClosestPoints=yc.prototype.Rb;yc.prototype.computeDistance=yc.prototype.Wb;yc.prototype.convexCast=yc.prototype.nb;yc.prototype.rayCast=yc.prototype.yd;yc.getInstance=yc.h;window.OIMO.GjkEpaResultState=Xg;window.OIMO.SimplexUtil=Gh;Gh.projectOrigin2=Gh.h;Gh.projectOrigin3=Gh.i;Gh.projectOrigin4=Gh.C;window.OIMO.Mat3=ia;ia.prototype.init=ia.prototype.Ia;ia.prototype.identity=ia.prototype.W;ia.prototype.add=ia.prototype.add;ia.prototype.sub=ia.prototype.sub; -ia.prototype.scale=ia.prototype.nb;ia.prototype.mul=ia.prototype.qa;ia.prototype.addEq=ia.prototype.h;ia.prototype.subEq=ia.prototype.Ib;ia.prototype.scaleEq=ia.prototype.ob;ia.prototype.mulEq=ia.prototype.Ma;ia.prototype.prependScale=ia.prototype.Wa;ia.prototype.appendScale=ia.prototype.I;ia.prototype.prependRotation=ia.prototype.Oa;ia.prototype.appendRotation=ia.prototype.i;ia.prototype.prependScaleEq=ia.prototype.Ya;ia.prototype.appendScaleEq=ia.prototype.M;ia.prototype.prependRotationEq=ia.prototype.Sa; -ia.prototype.appendRotationEq=ia.prototype.C;ia.prototype.transpose=ia.prototype.Rb;ia.prototype.transposeEq=ia.prototype.Sb;ia.prototype.determinant=ia.prototype.V;ia.prototype.trace=ia.prototype.Pb;ia.prototype.inverse=ia.prototype.Y;ia.prototype.inverseEq=ia.prototype.aa;ia.prototype.toArray=ia.prototype.Jb;ia.prototype.copyFrom=ia.prototype.Dd;ia.prototype.clone=ia.prototype.clone;ia.prototype.fromQuat=ia.prototype.Xa;ia.prototype.toQuat=ia.prototype.Ed;ia.prototype.fromEulerXyz=ia.prototype.Va; -ia.prototype.toEulerXyz=ia.prototype.Sc;ia.prototype.getRow=ia.prototype.ac;ia.prototype.getCol=ia.prototype.Fb;ia.prototype.getRowTo=ia.prototype.bc;ia.prototype.getColTo=ia.prototype.Gb;ia.prototype.fromRows=ia.prototype.tb;ia.prototype.fromCols=ia.prototype.Wb;ia.prototype.toString=ia.prototype.toString;window.OIMO.Mat4=Ha;Ha.prototype.init=Ha.prototype.Ia;Ha.prototype.identity=Ha.prototype.Y;Ha.prototype.add=Ha.prototype.add;Ha.prototype.sub=Ha.prototype.sub;Ha.prototype.scale=Ha.prototype.Ib; -Ha.prototype.mul=Ha.prototype.Ma;Ha.prototype.addEq=Ha.prototype.h;Ha.prototype.subEq=Ha.prototype.Pb;Ha.prototype.scaleEq=Ha.prototype.Jb;Ha.prototype.mulEq=Ha.prototype.Oa;Ha.prototype.prependScale=Ha.prototype.nb;Ha.prototype.appendScale=Ha.prototype.I;Ha.prototype.prependRotation=Ha.prototype.Wa;Ha.prototype.appendRotation=Ha.prototype.i;Ha.prototype.prependTranslation=Ha.prototype.bc;Ha.prototype.appendTranslation=Ha.prototype.Xa;Ha.prototype.prependScaleEq=Ha.prototype.ob;Ha.prototype.appendScaleEq= -Ha.prototype.M;Ha.prototype.prependRotationEq=Ha.prototype.Ya;Ha.prototype.appendRotationEq=Ha.prototype.C;Ha.prototype.prependTranslationEq=Ha.prototype.Sc;Ha.prototype.appendTranslationEq=Ha.prototype.tb;Ha.prototype.transpose=Ha.prototype.Wb;Ha.prototype.transposeEq=Ha.prototype.Va;Ha.prototype.determinant=Ha.prototype.V;Ha.prototype.trace=Ha.prototype.Sb;Ha.prototype.inverse=Ha.prototype.aa;Ha.prototype.inverseEq=Ha.prototype.qa;Ha.prototype.lookAt=Ha.prototype.Gb;Ha.prototype.perspective=Ha.prototype.Sa; -Ha.prototype.ortho=Ha.prototype.ac;Ha.prototype.toArray=Ha.prototype.Rb;Ha.prototype.copyFrom=Ha.prototype.Dd;Ha.prototype.fromMat3=Ha.prototype.W;Ha.prototype.fromTransform=Ha.prototype.Fb;Ha.prototype.clone=Ha.prototype.clone;Ha.prototype.toString=Ha.prototype.toString;window.OIMO.MathUtil=Sb;Sb.abs=Sb.abs;Sb.sin=Sb.sin;Sb.cos=Sb.cos;Sb.tan=Sb.tan;Sb.asin=Sb.asin;Sb.acos=Sb.acos;Sb.atan=Sb.atan;Sb.safeAsin=Sb.W;Sb.safeAcos=Sb.V;Sb.atan2=Sb.atan2;Sb.sqrt=Sb.sqrt;Sb.clamp=Sb.h;Sb.rand=Sb.i;Sb.randIn= -Sb.C;Sb.randVec3In=Sb.M;Sb.randVec3=Sb.I;window.OIMO.Pool=jd;jd.prototype.vec3=jd.prototype.ob;jd.prototype.mat3=jd.prototype.Wa;jd.prototype.mat4=jd.prototype.Ya;jd.prototype.quat=jd.prototype.nb;jd.prototype.dispose=jd.prototype.aa;jd.prototype.disposeVec3=jd.prototype.Sa;jd.prototype.disposeMat3=jd.prototype.qa;jd.prototype.disposeMat4=jd.prototype.Ma;jd.prototype.disposeQuat=jd.prototype.Oa;window.OIMO.Quat=Gb;Gb.prototype.identity=Gb.prototype.I;Gb.prototype.init=Gb.prototype.Ia;Gb.prototype.add= -Gb.prototype.add;Gb.prototype.sub=Gb.prototype.sub;Gb.prototype.scale=Gb.prototype.Y;Gb.prototype.addEq=Gb.prototype.h;Gb.prototype.subEq=Gb.prototype.qa;Gb.prototype.scaleEq=Gb.prototype.aa;Gb.prototype.length=Gb.prototype.length;Gb.prototype.lengthSq=Gb.prototype.M;Gb.prototype.dot=Gb.prototype.i;Gb.prototype.normalized=Gb.prototype.W;Gb.prototype.normalize=Gb.prototype.V;Gb.prototype.setArc=Gb.prototype.Ma;Gb.prototype.slerp=Gb.prototype.Oa;Gb.prototype.copyFrom=Gb.prototype.Dd;Gb.prototype.clone= -Gb.prototype.clone;Gb.prototype.fromMat3=Gb.prototype.C;Gb.prototype.toMat3=Gb.prototype.Sa;Gb.prototype.toString=Gb.prototype.toString;window.OIMO.Contact=Jd;Jd.prototype.getShape1=Jd.prototype.M;Jd.prototype.getShape2=Jd.prototype.V;Jd.prototype.isTouching=Jd.prototype.th;Jd.prototype.getManifold=Jd.prototype.i;Jd.prototype.getContactConstraint=Jd.prototype.Y;Jd.prototype.getPrev=Jd.prototype.I;Jd.prototype.getNext=Jd.prototype.C;window.OIMO.ContactLink=Hf;Hf.prototype.getContact=Hf.prototype.h; -Hf.prototype.getOther=Hf.prototype.C;Hf.prototype.getPrev=Hf.prototype.I;Hf.prototype.getNext=Hf.prototype.i;window.OIMO.ContactManager=rg;rg.prototype.getNumContacts=rg.prototype.W;rg.prototype.getContactList=rg.prototype.V;window.OIMO.TimeStep=cl;window.OIMO.World=tb;tb.prototype.step=tb.prototype.Gb;tb.prototype.addRigidBody=tb.prototype.Ie;tb.prototype.removeRigidBody=tb.prototype.hd;tb.prototype.addJoint=tb.prototype.He;tb.prototype.removeJoint=tb.prototype.wi;tb.prototype.setDebugDraw=tb.prototype.mg; -tb.prototype.getDebugDraw=tb.prototype.vf;tb.prototype.debugDraw=tb.prototype.sf;tb.prototype.rayCast=tb.prototype.yd;tb.prototype.convexCast=tb.prototype.tb;tb.prototype.aabbTest=tb.prototype.Xa;tb.prototype.getRigidBodyList=tb.prototype.gd;tb.prototype.getJointList=tb.prototype.yf;tb.prototype.getBroadPhase=tb.prototype.tf;tb.prototype.getContactManager=tb.prototype.uf;tb.prototype.getNumRigidBodies=tb.prototype.Af;tb.prototype.getNumJoints=tb.prototype.tc;tb.prototype.getNumShapes=tb.prototype.Fb; -tb.prototype.getNumIslands=tb.prototype.zf;tb.prototype.getNumVelocityIterations=tb.prototype.yc;tb.prototype.setNumVelocityIterations=tb.prototype.Vg;tb.prototype.getNumPositionIterations=tb.prototype.vd;tb.prototype.setNumPositionIterations=tb.prototype.wd;tb.prototype.getGravity=tb.prototype.wf;tb.prototype.setGravity=tb.prototype.jd;window.OIMO.AabbTestCallback=bl;window.OIMO.ContactCallback=ak;window.OIMO.RayCastCallback=Ek;window.OIMO.RayCastClosest=aj;aj.prototype.clear=aj.prototype.clear; -aj.prototype.process=aj.prototype.process;window.OIMO.DebugDraw=Zf;window.OIMO.DebugDrawStyle=al;window.OIMO.Performance=ii;window.OIMO.ConstraintSolver=bd;bd.prototype.preSolveVelocity=bd.prototype.Rf;bd.prototype.warmStart=bd.prototype.Wf;bd.prototype.solveVelocity=bd.prototype.Vf;bd.prototype.postSolveVelocity=bd.prototype.rg;bd.prototype.preSolvePosition=bd.prototype.Bf;bd.prototype.solvePositionSplitImpulse=bd.prototype.Uf;bd.prototype.solvePositionNgs=bd.prototype.Tf;bd.prototype.postSolve= -bd.prototype.postSolve;window.OIMO.PositionCorrectionAlgorithm=Fh;window.OIMO.ContactConstraint=af;af.prototype.getShape1=af.prototype.i;af.prototype.getShape2=af.prototype.C;af.prototype.getManifold=af.prototype.h;af.prototype.isTouching=af.prototype.th;window.OIMO.Manifold=nd;nd.prototype.getNormal=nd.prototype.I;nd.prototype.getNormalTo=nd.prototype.M;nd.prototype.getTangent=nd.prototype.Y;nd.prototype.getTangentTo=nd.prototype.aa;nd.prototype.getBinormal=nd.prototype.i;nd.prototype.getBinormalTo= -nd.prototype.C;nd.prototype.getPoints=nd.prototype.W;nd.prototype.getNumPoints=nd.prototype.V;window.OIMO.ManifoldPoint=Qc;Qc.prototype.getPosition1=Qc.prototype.M;Qc.prototype.getPosition1To=Qc.prototype.V;Qc.prototype.getPosition2=Qc.prototype.W;Qc.prototype.getPosition2To=Qc.prototype.Y;Qc.prototype.getDepth=Qc.prototype.C;Qc.prototype.isWarmStarted=Qc.prototype.qa;Qc.prototype.getNormalImpulse=Qc.prototype.I;Qc.prototype.getTangentImpulse=Qc.prototype.aa;Qc.prototype.getBinormalImpulse=Qc.prototype.i; -Qc.prototype.isEnabled=Qc.prototype.h;window.OIMO.Joint=za;za.prototype.getRigidBody1=za.prototype.ei;za.prototype.getRigidBody2=za.prototype.fi;za.prototype.getType=za.prototype.yi;za.prototype.getAnchor1=za.prototype.zh;za.prototype.getAnchor2=za.prototype.Bh;za.prototype.getAnchor1To=za.prototype.Ah;za.prototype.getAnchor2To=za.prototype.Ch;za.prototype.getLocalAnchor1=za.prototype.vh;za.prototype.getLocalAnchor2=za.prototype.ai;za.prototype.getLocalAnchor1To=za.prototype.$h;za.prototype.getLocalAnchor2To= -za.prototype.bi;za.prototype.getBasis1=za.prototype.Hh;za.prototype.getBasis2=za.prototype.Jh;za.prototype.getBasis1To=za.prototype.Ih;za.prototype.getBasis2To=za.prototype.Kh;za.prototype.getAllowCollision=za.prototype.yh;za.prototype.setAllowCollision=za.prototype.Oi;za.prototype.getBreakForce=za.prototype.Lh;za.prototype.setBreakForce=za.prototype.Pi;za.prototype.getBreakTorque=za.prototype.Mh;za.prototype.setBreakTorque=za.prototype.Qi;za.prototype.getPositionCorrectionAlgorithm=za.prototype.di; -za.prototype.setPositionCorrectionAlgorithm=za.prototype.Ri;za.prototype.getAppliedForce=za.prototype.Dh;za.prototype.getAppliedForceTo=za.prototype.Eh;za.prototype.getAppliedTorque=za.prototype.Fh;za.prototype.getAppliedTorqueTo=za.prototype.Gh;za.prototype.getPrev=za.prototype.xi;za.prototype.getNext=za.prototype.Vg;window.OIMO.CylindricalJoint=dc;dc.prototype.getAxis1=dc.prototype.gd;dc.prototype.getAxis2=dc.prototype.jd;dc.prototype.getAxis1To=dc.prototype.hd;dc.prototype.getAxis2To=dc.prototype.wd; -dc.prototype.getLocalAxis1=dc.prototype.$d;dc.prototype.getLocalAxis2=dc.prototype.be;dc.prototype.getLocalAxis1To=dc.prototype.ae;dc.prototype.getLocalAxis2To=dc.prototype.Qd;dc.prototype.getTranslationalSpringDamper=dc.prototype.Ze;dc.prototype.getRotationalSpringDamper=dc.prototype.Xe;dc.prototype.getTranslationalLimitMotor=dc.prototype.Ye;dc.prototype.getRotationalLimitMotor=dc.prototype.We;dc.prototype.getAngle=dc.prototype.yc;dc.prototype.getTranslation=dc.prototype.Rd;window.OIMO.JointConfig= -qf;window.OIMO.CylindricalJointConfig=Yj;Yj.prototype.init=Yj.prototype.Ia;window.OIMO.GenericJoint=Pc;Pc.prototype.getAxisX=Pc.prototype.ae;Pc.prototype.getAxisY=Pc.prototype.be;Pc.prototype.getAxisZ=Pc.prototype.Qd;Pc.prototype.getTranslationalSpringDampers=Pc.prototype.Ye;Pc.prototype.getRotationalSpringDampers=Pc.prototype.We;Pc.prototype.getTranslationalLimitMotors=Pc.prototype.Xe;Pc.prototype.getRotationalLimitMotors=Pc.prototype.Rd;Pc.prototype.getAngles=Pc.prototype.$d;Pc.prototype.getTranslations= -Pc.prototype.Ze;window.OIMO.GenericJointConfig=Xj;Xj.prototype.init=Xj.prototype.Ia;window.OIMO.JointLink=Gf;Gf.prototype.getContact=Gf.prototype.h;Gf.prototype.getOther=Gf.prototype.C;Gf.prototype.getPrev=Gf.prototype.I;Gf.prototype.getNext=Gf.prototype.i;window.OIMO.JointType=Wg;window.OIMO.PrismaticJoint=rc;rc.prototype.getAxis1=rc.prototype.vd;rc.prototype.getAxis2=rc.prototype.gd;rc.prototype.getAxis1To=rc.prototype.yc;rc.prototype.getAxis2To=rc.prototype.hd;rc.prototype.getLocalAxis1=rc.prototype.wd; -rc.prototype.getLocalAxis2=rc.prototype.ae;rc.prototype.getLocalAxis1To=rc.prototype.$d;rc.prototype.getLocalAxis2To=rc.prototype.be;rc.prototype.getSpringDamper=rc.prototype.Qd;rc.prototype.getLimitMotor=rc.prototype.jd;rc.prototype.getTranslation=rc.prototype.Rd;window.OIMO.PrismaticJointConfig=Wj;Wj.prototype.init=Wj.prototype.Ia;window.OIMO.RagdollJoint=Yb;Yb.prototype.getAxis1=Yb.prototype.$d;Yb.prototype.getAxis2=Yb.prototype.be;Yb.prototype.getAxis1To=Yb.prototype.ae;Yb.prototype.getAxis2To= -Yb.prototype.Qd;Yb.prototype.getLocalAxis1=Yb.prototype.Rd;Yb.prototype.getLocalAxis2=Yb.prototype.Xe;Yb.prototype.getLocalAxis1To=Yb.prototype.We;Yb.prototype.getLocalAxis2To=Yb.prototype.Ye;Yb.prototype.getTwistSpringDamper=Yb.prototype.Ni;Yb.prototype.getTwistLimitMotor=Yb.prototype.hi;Yb.prototype.getSwingSpringDamper=Yb.prototype.ug;Yb.prototype.getSwingAxis=Yb.prototype.sg;Yb.prototype.getSwingAxisTo=Yb.prototype.tg;Yb.prototype.getSwingAngle=Yb.prototype.Ze;Yb.prototype.getTwistAngle=Yb.prototype.gi; +/* OimoPhysics 1.2.5 (c) 2024 saharan, The MIT License */var pc="function"==typeof Object.create?Object.create:function(Ue){function zb(){}zb.prototype=Ue;return new zb},yk;if("function"==typeof Object.setPrototypeOf)yk=Object.setPrototypeOf;else{var zk;a:{var Tk={a:!0},Uk={};try{Uk.__proto__=Tk;zk=Uk.a;break a}catch(Ue){}zk=!1}yk=zk?function(Ue,zb){Ue.__proto__=zb;if(Ue.__proto__!==zb)throw new TypeError(Ue+" is not extensible");return Ue}:null}var ql=yk; +function rl(Ue,zb){Ue.prototype=pc(zb.prototype);Ue.prototype.constructor=Ue;if(ql)ql(Ue,zb);else for(var Ih in zb)if("prototype"!=Ih)if(Object.defineProperties){var qk=Object.getOwnPropertyDescriptor(zb,Ih);qk&&Object.defineProperty(Ue,Ih,qk)}else Ue[Ih]=zb[Ih];Ue.Vi=zb.prototype} +(function(){function Ue(){this.position=new z;this.rotation=new ha;this.friction=Ba.defaultFriction;this.restitution=Ba.defaultRestitution;this.density=Ba.defaultDensity;this.collisionGroup=Ba.defaultCollisionGroup;this.collisionMask=Ba.defaultCollisionMask;this.contactCallback=this.geometry=null}function zb(a){this.uc=-1;this.ra=new Ob;this.za=new Ob;this.g=new Ob;var b=a.position;this.ra.F=b.x;this.ra.G=b.y;this.ra.H=b.z;b=a.rotation;this.ra.A=b.e00;this.ra.j=b.e01;this.ra.m=b.e02;this.ra.o=b.e10; +this.ra.v=b.e11;this.ra.s=b.e12;this.ra.u=b.e20;this.ra.l=b.e21;this.ra.B=b.e22;b=this.za;var e=this.ra;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;b=this.g;e=this.ra;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;this.kh=a.restitution;this.dh=a.friction;this.Sh=a.density;this.Tb=a.geometry;this.$g=a.collisionGroup;this.ah=a.collisionMask;this.ld=a.contactCallback;this.D=new Pb;this.Eb=null;this.qc= +new z}function Ih(){}function qk(){this.position=new z;this.rotation=new ha;this.linearVelocity=new z;this.angularVelocity=new z;this.angularDamping=this.linearDamping=this.type=0;this.autoSleep=!0;this.sleepingVelocityThreshold=Ba.sleepingVelocityThreshold;this.sleepingAngularVelocityThreshold=Ba.sleepingAngularVelocityThreshold;this.sleepingTimeThreshold=Ba.sleepingTimeThreshold}function J(a){this.Jb=this.vc=this.sa=this.U=null;this.nf=0;this.oc=this.Zb=null;this.Pd=0;this.fe=this.Od=null;this.Mf= +0;var b=a.linearVelocity;this.ub=b.x;this.vb=b.y;this.wb=b.z;b=a.angularVelocity;this.xb=b.x;this.yb=b.y;this.zb=b.z;this.Lc=this.Kc=this.Jc=this.Rc=this.Qc=this.Pc=0;this.za=new Ob;this.g=new Ob;b=a.position;this.za.F=b.x;this.za.G=b.y;this.za.H=b.z;b=a.rotation;this.za.A=b.e00;this.za.j=b.e01;this.za.m=b.e02;this.za.o=b.e10;this.za.v=b.e11;this.za.s=b.e12;this.za.u=b.e20;this.za.l=b.e21;this.za.B=b.e22;b=this.g;var e=this.za;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s; +b.u=e.u;b.l=e.l;b.B=e.B;this.Xb=a.type;this.Kb=0;this.Ob=!1;this.Qh=a.autoSleep;this.nh=a.sleepingVelocityThreshold;this.mh=a.sleepingAngularVelocityThreshold;this.Fi=a.sleepingTimeThreshold;this.ja=this.ia=this.ha=this.ga=this.fa=this.ea=this.da=this.ca=this.ba=this.Ib=this.ob=this.nb=this.Ya=this.Wa=this.Sa=this.Oa=this.Ma=this.qa=this.kb=this.jb=this.ib=this.hb=this.gb=this.fb=this.eb=this.cb=this.bb=this.aa=this.Y=this.W=this.V=this.M=this.I=this.C=this.i=this.h=this.Ab=this.Ce=0;this.gh=a.linearDamping; +this.Xg=a.angularDamping;this.Gf=this.Ff=this.Ef=this.Kf=this.Jf=this.If=this.Fe=this.Ee=this.De=this.ag=this.$f=this.Zf=0;this.X=new z(1,1,1);this.Ke=!1;this.Hf=1;this.pc=null}function Vk(){this.mass=0;this.localInertia=new ha}function xd(a){var b=cd.call(this)||this;b.h=a;b.info=new Wk;b.i=Array(Ba.maxJacobianRows);a=0;for(var e=b.i.length;a>1&85);d=(d&51)+(d>>2&51);d=(d&15)+(d>>4&15);c=Array(d);for(f=0;fe.e00*(e.e11*e.e22-e.e12*e.e21)-e.e01*(e.e10*e.e22-e.e12*e.e20)+e.e02*(e.e10*e.e21-e.e11*e.e20)?e=!0:(e=a.localBasis2,e=0>e.e00*(e.e11*e.e22-e.e12*e.e21)-e.e01*(e.e10*e.e22-e.e12*e.e20)+e.e02*(e.e10*e.e21-e.e11*e.e20));e&&console.log("src/oimo/dynamics/constraint/joint/GenericJoint.hx:50:", +"[warning] joint basis must be right handed");var d=a.localBasis1;e=d.e00;var c=d.e01;var f=d.e02;var h=d.e10;var k=d.e11;var g=d.e12;var l=d.e20;var m=d.e21;d=d.e22;var n=a.localBasis2;var q=n.e00;var p=n.e01;var r=n.e02;var t=n.e10;var x=n.e11;var v=n.e12;var B=n.e20;var H=n.e21;n=n.e22;b.i=e;b.C=h;b.I=l;b.Ya=c;b.nb=k;b.ob=m;b.Ib=f;b.Jb=g;b.Pb=d;b.V=q;b.W=t;b.Y=B;b.je=p;b.He=x;b.Ie=H;b.Rb=r;b.Sb=v;b.Wb=n;b.qe=0;b.Df=0;b.re=0;b.tc=0;b.vd=0;b.yc=0;b.hd=!1;b.jd=!1;b.wd=!1;b.Oe=Array(3);b.bc=Array(3); +b.Ne=Array(3);b.ac=Array(3);b.Oe[0]=a.translationalLimitMotors[0].clone();b.Oe[1]=a.translationalLimitMotors[1].clone();b.Oe[2]=a.translationalLimitMotors[2].clone();b.bc[0]=a.translationalSpringDampers[0].clone();b.bc[1]=a.translationalSpringDampers[1].clone();b.bc[2]=a.translationalSpringDampers[2].clone();b.Ne[0]=a.rotationalLimitMotors[0].clone();b.Ne[1]=a.rotationalLimitMotors[1].clone();b.Ne[2]=a.rotationalLimitMotors[2].clone();b.ac[0]=a.rotationalSpringDampers[0].clone();b.ac[1]=a.rotationalSpringDampers[1].clone(); +b.ac[2]=a.rotationalSpringDampers[2].clone();return b}function Yj(){var a=jf.call(this)||this;a.localAxis1=new z(1,0,0);a.localAxis2=new z(1,0,0);a.translationalLimitMotor=new kf;a.translationalSpringDamper=new Ed;a.rotationalLimitMotor=new ne;a.rotationalSpringDamper=new Ed;return a}function jf(){this.rigidBody2=this.rigidBody1=null;this.localAnchor1=new z;this.localAnchor2=new z;this.allowCollision=!1;this.solverType=Ba.defaultJointConstraintSolverType;this.positionCorrectionAlgorithm=Ba.defaultJointPositionCorrectionAlgorithm; +this.breakTorque=this.breakForce=0}function ec(a){var b=ya.call(this,a,2)||this;var e=a.localAxis1;b.i=e.x;b.C=e.y;b.I=e.z;e=a.localAxis2;b.V=e.x;b.W=e.y;b.Y=e.z;b.mg();b.Va=0;b.tc=0;b.vd=0;b.Xa=0;b.ac=0;b.bc=0;b.h=new Dk(b);b.Fb=a.translationalSpringDamper.clone();b.$h=a.translationalLimitMotor.clone();b.tb=a.rotationalSpringDamper.clone();b.Xh=a.rotationalLimitMotor.clone();return b}function ya(a,b){this.Bb=new Df(this);this.Cb=new Df(this);this.pf=Ba.defaultJointPositionCorrectionAlgorithm;this.Xb= +b;this.pc=null;this.J=a.rigidBody1;this.K=a.rigidBody2;this.Ph=a.allowCollision;this.rf=a.breakForce;this.sf=a.breakTorque;switch(a.solverType){case 0:this.oh=new xd(this);break;case 1:this.oh=new yd(this)}b=a.localAnchor1;this.tf=b.x;this.uf=b.y;this.vf=b.z;a=a.localAnchor2;this.wf=a.x;this.yf=a.y;this.zf=a.z;this.Wb=this.Sb=this.Rb=this.Ie=this.He=this.je=this.Y=this.W=this.V=this.Pb=this.Jb=this.Ib=this.ob=this.nb=this.Ya=this.I=this.C=this.i=this.pe=this.oe=this.ne=this.me=this.le=this.ke=this.Wa= +this.Sa=this.Oa=this.Ma=this.qa=this.aa=0;this.M=Array(Ba.maxJacobianRows);a=0;for(b=Ba.maxJacobianRows;aa;){var b=a++,e=0==b||4==b?1:8;this.W[b]=Array(e);this.M[b]=Array(e);this.Y[b]=Array(e);for(e=0;8>e;){var d=e++,c=.7853981633974475* +b,f=.7853981633974475*d;this.W[b][d]=new z(Math.sin(c)*Math.cos(f),Math.cos(c),-Math.sin(c)*Math.sin(f));this.M[b][d]=new z;this.Y[b][d]=new z}}this.V=Array(8);this.aa=Array(8);this.C=Array(8);this.i=Array(8);this.I=Array(8);for(a=0;8>a;)b=a++,this.V[b]=new z(Math.cos(.7853981633974475*b),0,-Math.sin(.7853981633974475*b)),this.aa[b]=new z(Math.cos(.7853981633974475*(b+.5)),0,-Math.sin(.7853981633974475*(b+.5))),this.C[b]=new z,this.i[b]=new z,this.I[b]=new z;this.style=new al}function aj(){this.position= +new z;this.normal=new z;this.shape=null;this.fraction=1;this.position.$();this.normal.$();this.hit=!1;return this}function Ek(){}function ak(){}function bl(){}function Fk(){this.D=new Pb;this.h=null;return this}function Gk(){this.C=new rk;this.h=new Ob;this.I=new z;this.$=new z;this.M=this.i=null;return this}function Hk(){this.C=new rk;this.h=new z;this.end=new z;this.i=null;return this}function sb(a,b){null==a&&(a=2);switch(a){case 1:this.nc=new Od;break;case 2:this.nc=new dd}this.Xf=new ug(this.nc); +null==b&&(b=new z(0,-9.80665,0));this.Jb=new z(b.x,b.y,b.z);this.Ma=this.Y=this.Oa=this.I=null;this.Ya=this.Pb=this.nf=this.Wa=0;this.Sb=10;this.Rb=5;this.nb=new Hk;this.Sa=new Gk;this.ob=new Fk;this.M=new Mj;this.i=Array(Ba.islandInitialConstraintArraySize);this.W=Array(Ba.islandInitialRigidBodyArraySize);this.aa=new cl;this.h=new ld;this.Ei=0}function cl(){this.invDt=this.dt=0;this.dtRatio=1}function Mj(){this.C=Array(Ba.islandInitialRigidBodyArraySize);this.I=Array(Ba.islandInitialConstraintArraySize); +this.Y=Array(Ba.islandInitialConstraintArraySize);this.W=Array(Ba.islandInitialConstraintArraySize);this.M=this.V=this.i=this.h=0}function ug(a){this.nc=a;this.C=new bk;this.pg=0}function Ef(){this.Fc=this.zd=this.U=this.sa=null}function Hd(){this.sa=this.U=null;this.Bb=new Ef;this.Cb=new Ef;this.Yf=this.K=this.J=this.jc=this.ic=null;this.Eg=new dl;this.W=new bj;this.lh=this.fh=!1;this.Ra=new qd;this.h=new $i(this.Ra);this.ee=new Ve(this.Ra);this.xd=!1}function Hb(a,b,e,d){null==d&&(d=1);null==e&& +(e=0);null==b&&(b=0);null==a&&(a=0);this.x=a;this.y=b;this.z=e;this.w=d;Hb.numCreations++}function ld(){this.i=Array(256);this.h=0;this.C=Array(256);this.I=0;this.W=Array(256);this.Y=0;this.M=Array(256);this.V=0}function Sb(){}function Ea(a,b,e,d,c,f,h,k,g,l,m,n,q,p,r,t){null==t&&(t=1);null==r&&(r=0);null==p&&(p=0);null==q&&(q=0);null==n&&(n=0);null==m&&(m=1);null==l&&(l=0);null==g&&(g=0);null==k&&(k=0);null==h&&(h=0);null==f&&(f=1);null==c&&(c=0);null==d&&(d=0);null==e&&(e=0);null==b&&(b=0);null== +a&&(a=1);this.e00=a;this.e01=b;this.e02=e;this.e03=d;this.e10=c;this.e11=f;this.e12=h;this.e13=k;this.e20=g;this.e21=l;this.e22=m;this.e23=n;this.e30=q;this.e31=p;this.e32=r;this.e33=t;Ea.numCreations++}function ha(a,b,e,d,c,f,h,k,g){null==g&&(g=1);null==k&&(k=0);null==h&&(h=0);null==f&&(f=0);null==c&&(c=1);null==d&&(d=0);null==e&&(e=0);null==b&&(b=0);null==a&&(a=1);this.e00=a;this.e01=b;this.e02=e;this.e10=d;this.e11=c;this.e12=f;this.e20=h;this.e21=k;this.e22=g;ha.numCreations++}function Kh(){} +function ah(){}function zc(){this.i=Array(4);this.mb=Array(4);this.sb=Array(4);this.qa=Array(3);this.qa[0]=new z(1,0,0);this.qa[1]=new z(0,1,0);this.qa[2]=new z(0,0,1);this.bc=new z;this.Sc=new z;this.Fb=new z;this.tb=new z;this.ac=new Ob;this.i[0]=new z;this.mb[0]=new z;this.sb[0]=new z;this.i[1]=new z;this.mb[1]=new z;this.sb[1]=new z;this.i[2]=new z;this.mb[2]=new z;this.sb[2]=new z;this.i[3]=new z;this.mb[3]=new z;this.sb[3]=new z;this.C=new z;this.aa=new z;this.closestPoint1=new z;this.closestPoint2= +new z;this.Y=new ck}function Ba(){}function Ob(){this.H=this.G=this.F=0;this.A=1;this.o=this.m=this.j=0;this.v=1;this.l=this.u=this.s=0;this.B=1}function z(a,b,e){null==e&&(e=0);null==b&&(b=0);null==a&&(a=0);this.x=a;this.y=b;this.z=e;z.numCreations++}function el(){this.xi=new z}function Aj(){this.kd=new z;this.mb=new z;this.sb=new z}function Lh(){this.id=++Lh.h;this.sa=this.U=null;this.jh=new z;this.Zh=this.bh=0;this.Lg=!1;this.Ja=Array(3);this.Ub=Array(3);this.Vb=Array(3);this.ng=new z;this.zc= +Array(3);this.zc[0]=1;this.zc[1]=2;this.zc[2]=0}function ck(){this.Ja=Array(Ba.maxEPAVertices);this.W=new z;this.Vd=0;this.i=this.C=null;this.V=0;this.M=this.I=null}function sk(){this.C=!1;return this}function dk(a){this.C=a;return this}function ek(a){this.C=a;return this}function tk(){this.C=!1;return this}function uk(){this.C=!1;return this}function dl(){}function Ik(){this.C=this.I=this.M=this.w=0;this.i=Array(8);this.h=Array(8);this.i[0]=new lf;this.h[0]=new lf;this.i[1]=new lf;this.h[1]=new lf; +this.i[2]=new lf;this.h[2]=new lf;this.i[3]=new lf;this.h[3]=new lf;this.i[4]=new lf;this.h[4]=new lf;this.i[5]=new lf;this.h[5]=new lf;this.i[6]=new lf;this.h[6]=new lf;this.i[7]=new lf;this.h[7]=new lf}function lf(){this.ab=this.$a=this.Za=this.y=this.x=0}function vk(){this.C=!1;this.i=new Ik;return this}function vg(a){this.C=a}function fl(){this.position1=new z;this.position2=new z;this.id=this.depth=0}function bj(){this.numPoints=0;this.normal=new z;this.points=Array(Ba.maxManifoldPoints);this.incremental= +!1;for(var a=0,b=Ba.maxManifoldPoints;a.2*a&&(b.fc=.2*a);return b}function Pb(){this.va=this.ua=this.ta=this.ya=this.xa=this.wa=0}function Jk(){this.$b=null;this.M=0;this.I=new gl;this.i=this.C=this.h=null;this.ng=Array(1024)}function gl(){this.Yg=!1}function hl(a,b){a=wg.call(this,a,b)||this;a.bg=null;a.Lf=!1;return a}function wk(){this.Le=this.Me=this.U=null;this.L=Array(2);this.Ta=0;this.Ka=null;this.Z=0;this.Eb=null; +this.P=this.O=this.N=this.T=this.S=this.R=0}function dd(){var a=uc.call(this,2)||this;a.eh=!0;a.h=new Jk;a.I=Array(1024);a.M=0;return a}function Od(){var a=uc.call(this,1)||this;a.eh=!1;return a}function bh(){this.Of=this.Nf=null}function wg(a,b){this.userData=a;this.uc=b;this.U=this.sa=null;this.P=this.O=this.N=this.T=this.S=this.R=0}function Kk(){}function Cj(){}function Lk(){var a=md.call(this,-1)||this;a.min=new z;a.max=new z;return a}function xk(){return md.call(this,-1)||this}function md(a){a= +mf.call(this,a)||this;a.fc=Ba.defaultGJKMargin;a.Ma=!1;return a}function mf(a){this.Xb=a;this.Ge=0}function uc(a){this.Xb=a;this.qa=0;this.Cd=this.C=this.i=null;this.eh=!1;this.Ma=0;this.V=null;this.ob=0;this.Oa=new xk;this.D=new Lk;this.nb=new Ob;this.$=new z;new rk}function il(){}function Nh(){}Nh.h=function(){return Date.now()};il.h=function(){window.OIMO={};window.OIMO.BroadPhase=uc;uc.prototype.createProxy=uc.prototype.eg;uc.prototype.destroyProxy=uc.prototype.fg;uc.prototype.moveProxy=uc.prototype.fd; +uc.prototype.isOverlapping=uc.prototype.Sb;uc.prototype.collectPairs=uc.prototype.qg;uc.prototype.getProxyPairList=uc.prototype.Ib;uc.prototype.isIncremental=uc.prototype.Rb;uc.prototype.getTestCount=uc.prototype.Jb;uc.prototype.rayCast=uc.prototype.yd;uc.prototype.convexCast=uc.prototype.aa;uc.prototype.aabbTest=uc.prototype.Y;window.OIMO.Geometry=mf;mf.prototype.getType=mf.prototype.Oa;mf.prototype.getVolume=mf.prototype.nb;mf.prototype.rayCast=mf.prototype.yd;window.OIMO.ConvexGeometry=md;md.prototype.getGjkMergin= +md.prototype.Sa;md.prototype.setGjkMergin=md.prototype.ob;md.prototype.computeLocalSupportingVertex=md.prototype.ud;md.prototype.rayCast=md.prototype.yd;window.OIMO.BroadPhaseProxyCallback=Cj;Cj.prototype.process=Cj.prototype.process;window.OIMO.BroadPhaseType=Kk;window.OIMO.Proxy=wg;wg.prototype.getId=wg.prototype.C;wg.prototype.getFatAabb=wg.prototype.h;wg.prototype.getFatAabbTo=wg.prototype.i;window.OIMO.ProxyPair=bh;bh.prototype.getProxy1=bh.prototype.i;bh.prototype.getProxy2=bh.prototype.C;bh.prototype.getNext= +bh.prototype.h;window.OIMO.BruteForceBroadPhase=Od;Od.prototype.createProxy=Od.prototype.eg;Od.prototype.destroyProxy=Od.prototype.fg;Od.prototype.moveProxy=Od.prototype.fd;Od.prototype.collectPairs=Od.prototype.qg;Od.prototype.rayCast=Od.prototype.yd;Od.prototype.convexCast=Od.prototype.aa;Od.prototype.aabbTest=Od.prototype.Y;window.OIMO.BvhBroadPhase=dd;dd.prototype.createProxy=dd.prototype.eg;dd.prototype.destroyProxy=dd.prototype.fg;dd.prototype.moveProxy=dd.prototype.fd;dd.prototype.collectPairs= +dd.prototype.qg;dd.prototype.rayCast=dd.prototype.yd;dd.prototype.convexCast=dd.prototype.aa;dd.prototype.aabbTest=dd.prototype.Y;dd.prototype.getTreeBalance=dd.prototype.Pb;window.OIMO.Aabb=Pb;Pb.prototype.init=Pb.prototype.Ia;Pb.prototype.getMin=Pb.prototype.Ma;Pb.prototype.getMinTo=Pb.prototype.Oa;Pb.prototype.setMin=Pb.prototype.Ya;Pb.prototype.getMax=Pb.prototype.aa;Pb.prototype.getMaxTo=Pb.prototype.qa;Pb.prototype.setMax=Pb.prototype.Wa;Pb.prototype.getCenter=Pb.prototype.C;Pb.prototype.getCenterTo= +Pb.prototype.I;Pb.prototype.getExtents=Pb.prototype.M;Pb.prototype.getExtentsTo=Pb.prototype.V;Pb.prototype.combine=Pb.prototype.h;Pb.prototype.combined=Pb.prototype.i;Pb.prototype.overlap=Pb.prototype.Sa;Pb.prototype.getIntersection=Pb.prototype.W;Pb.prototype.getIntersectionTo=Pb.prototype.Y;Pb.prototype.copyFrom=Pb.prototype.Dd;Pb.prototype.clone=Pb.prototype.clone;window.OIMO.BoxGeometry=cg;cg.prototype.getHalfExtents=cg.prototype.Wa;cg.prototype.getHalfExtentsTo=cg.prototype.Ya;cg.prototype.computeLocalSupportingVertex= +cg.prototype.ud;window.OIMO.CapsuleGeometry=bg;bg.prototype.getRadius=bg.prototype.C;bg.prototype.getHalfHeight=bg.prototype.i;bg.prototype.computeLocalSupportingVertex=bg.prototype.ud;window.OIMO.ConeGeometry=ag;ag.prototype.getRadius=ag.prototype.M;ag.prototype.getHalfHeight=ag.prototype.I;ag.prototype.computeLocalSupportingVertex=ag.prototype.ud;window.OIMO.ConvexHullGeometry=Mh;Mh.prototype.getVertices=Mh.prototype.i;Mh.prototype.computeLocalSupportingVertex=Mh.prototype.ud;window.OIMO.CylinderGeometry= +$f;$f.prototype.getRadius=$f.prototype.C;$f.prototype.getHalfHeight=$f.prototype.i;$f.prototype.computeLocalSupportingVertex=$f.prototype.ud;window.OIMO.GeometryType=Bj;window.OIMO.RayCastHit=rk;window.OIMO.SphereGeometry=nh;nh.prototype.getRadius=nh.prototype.i;nh.prototype.computeLocalSupportingVertex=nh.prototype.ud;window.OIMO.CollisionMatrix=bk;bk.prototype.getDetector=bk.prototype.i;window.OIMO.DetectorResult=bj;bj.prototype.getMaxDepth=bj.prototype.h;bj.prototype.clear=bj.prototype.clear;window.OIMO.DetectorResultPoint= +fl;window.OIMO.Detector=vg;vg.prototype.detect=vg.prototype.Hi;window.OIMO.BoxBoxDetector=vk;window.OIMO.CapsuleCapsuleDetector=uk;window.OIMO.GjkEpaDetector=tk;window.OIMO.SphereBoxDetector=ek;window.OIMO.SphereCapsuleDetector=dk;window.OIMO.SphereSphereDetector=sk;window.OIMO.Vec3=z;z.prototype.init=z.prototype.Ia;z.prototype.zero=z.prototype.$;z.prototype.add=z.prototype.add;z.prototype.add3=z.prototype.aa;z.prototype.addScaled=z.prototype.Ma;z.prototype.sub=z.prototype.sub;z.prototype.sub3=z.prototype.Xa; +z.prototype.scale=z.prototype.V;z.prototype.scale3=z.prototype.Wb;z.prototype.dot=z.prototype.i;z.prototype.cross=z.prototype.Sa;z.prototype.addEq=z.prototype.h;z.prototype.add3Eq=z.prototype.qa;z.prototype.addScaledEq=z.prototype.Oa;z.prototype.subEq=z.prototype.Y;z.prototype.sub3Eq=z.prototype.tb;z.prototype.scaleEq=z.prototype.W;z.prototype.scale3Eq=z.prototype.Va;z.prototype.crossEq=z.prototype.Wa;z.prototype.mulMat3=z.prototype.Ya;z.prototype.mulMat4=z.prototype.ob;z.prototype.mulTransform=z.prototype.Jb; +z.prototype.mulMat3Eq=z.prototype.nb;z.prototype.mulMat4Eq=z.prototype.Ib;z.prototype.mulTransformEq=z.prototype.Pb;z.prototype.length=z.prototype.length;z.prototype.lengthSq=z.prototype.C;z.prototype.normalized=z.prototype.M;z.prototype.normalize=z.prototype.I;z.prototype.negate=z.prototype.Rb;z.prototype.negateEq=z.prototype.Sb;z.prototype.copyFrom=z.prototype.Dd;z.prototype.clone=z.prototype.clone;z.prototype.toString=z.prototype.toString;window.OIMO.Transform=Ob;Ob.prototype.identity=Ob.prototype.W; +Ob.prototype.getPosition=Ob.prototype.C;Ob.prototype.getPositionTo=Ob.prototype.I;Ob.prototype.setPosition=Ob.prototype.Ma;Ob.prototype.translate=Ob.prototype.Wa;Ob.prototype.getRotation=Ob.prototype.M;Ob.prototype.getRotationTo=Ob.prototype.V;Ob.prototype.setRotation=Ob.prototype.Oa;Ob.prototype.setRotationXyz=Ob.prototype.Sa;Ob.prototype.rotate=Ob.prototype.Y;Ob.prototype.rotateXyz=Ob.prototype.aa;Ob.prototype.getOrientation=Ob.prototype.h;Ob.prototype.getOrientationTo=Ob.prototype.i;Ob.prototype.setOrientation= +Ob.prototype.qa;Ob.prototype.clone=Ob.prototype.clone;Ob.prototype.copyFrom=Ob.prototype.Dd;window.OIMO.Setting=Ba;window.OIMO.GjkEpa=zc;zc.prototype.computeClosestPoints=zc.prototype.Rb;zc.prototype.computeDistance=zc.prototype.Wb;zc.prototype.convexCast=zc.prototype.nb;zc.prototype.rayCast=zc.prototype.yd;zc.getInstance=zc.h;window.OIMO.GjkEpaResultState=ah;window.OIMO.SimplexUtil=Kh;Kh.projectOrigin2=Kh.h;Kh.projectOrigin3=Kh.i;Kh.projectOrigin4=Kh.C;window.OIMO.Mat3=ha;ha.prototype.init=ha.prototype.Ia; +ha.prototype.identity=ha.prototype.W;ha.prototype.add=ha.prototype.add;ha.prototype.sub=ha.prototype.sub;ha.prototype.scale=ha.prototype.nb;ha.prototype.mul=ha.prototype.qa;ha.prototype.addEq=ha.prototype.h;ha.prototype.subEq=ha.prototype.Ib;ha.prototype.scaleEq=ha.prototype.ob;ha.prototype.mulEq=ha.prototype.Ma;ha.prototype.prependScale=ha.prototype.Wa;ha.prototype.appendScale=ha.prototype.I;ha.prototype.prependRotation=ha.prototype.Oa;ha.prototype.appendRotation=ha.prototype.i;ha.prototype.prependScaleEq= +ha.prototype.Ya;ha.prototype.appendScaleEq=ha.prototype.M;ha.prototype.prependRotationEq=ha.prototype.Sa;ha.prototype.appendRotationEq=ha.prototype.C;ha.prototype.transpose=ha.prototype.Rb;ha.prototype.transposeEq=ha.prototype.Sb;ha.prototype.determinant=ha.prototype.V;ha.prototype.trace=ha.prototype.Pb;ha.prototype.inverse=ha.prototype.Y;ha.prototype.inverseEq=ha.prototype.aa;ha.prototype.toArray=ha.prototype.Jb;ha.prototype.copyFrom=ha.prototype.Dd;ha.prototype.clone=ha.prototype.clone;ha.prototype.fromQuat= +ha.prototype.Xa;ha.prototype.toQuat=ha.prototype.Ed;ha.prototype.fromEulerXyz=ha.prototype.Va;ha.prototype.toEulerXyz=ha.prototype.Sc;ha.prototype.getRow=ha.prototype.ac;ha.prototype.getCol=ha.prototype.Fb;ha.prototype.getRowTo=ha.prototype.bc;ha.prototype.getColTo=ha.prototype.Gb;ha.prototype.fromRows=ha.prototype.tb;ha.prototype.fromCols=ha.prototype.Wb;ha.prototype.toString=ha.prototype.toString;window.OIMO.Mat4=Ea;Ea.prototype.init=Ea.prototype.Ia;Ea.prototype.identity=Ea.prototype.Y;Ea.prototype.add= +Ea.prototype.add;Ea.prototype.sub=Ea.prototype.sub;Ea.prototype.scale=Ea.prototype.Ib;Ea.prototype.mul=Ea.prototype.Ma;Ea.prototype.addEq=Ea.prototype.h;Ea.prototype.subEq=Ea.prototype.Pb;Ea.prototype.scaleEq=Ea.prototype.Jb;Ea.prototype.mulEq=Ea.prototype.Oa;Ea.prototype.prependScale=Ea.prototype.nb;Ea.prototype.appendScale=Ea.prototype.I;Ea.prototype.prependRotation=Ea.prototype.Wa;Ea.prototype.appendRotation=Ea.prototype.i;Ea.prototype.prependTranslation=Ea.prototype.bc;Ea.prototype.appendTranslation= +Ea.prototype.Xa;Ea.prototype.prependScaleEq=Ea.prototype.ob;Ea.prototype.appendScaleEq=Ea.prototype.M;Ea.prototype.prependRotationEq=Ea.prototype.Ya;Ea.prototype.appendRotationEq=Ea.prototype.C;Ea.prototype.prependTranslationEq=Ea.prototype.Sc;Ea.prototype.appendTranslationEq=Ea.prototype.tb;Ea.prototype.transpose=Ea.prototype.Wb;Ea.prototype.transposeEq=Ea.prototype.Va;Ea.prototype.determinant=Ea.prototype.V;Ea.prototype.trace=Ea.prototype.Sb;Ea.prototype.inverse=Ea.prototype.aa;Ea.prototype.inverseEq= +Ea.prototype.qa;Ea.prototype.lookAt=Ea.prototype.Gb;Ea.prototype.perspective=Ea.prototype.Sa;Ea.prototype.ortho=Ea.prototype.ac;Ea.prototype.toArray=Ea.prototype.Rb;Ea.prototype.copyFrom=Ea.prototype.Dd;Ea.prototype.fromMat3=Ea.prototype.W;Ea.prototype.fromTransform=Ea.prototype.Fb;Ea.prototype.clone=Ea.prototype.clone;Ea.prototype.toString=Ea.prototype.toString;window.OIMO.MathUtil=Sb;Sb.abs=Sb.abs;Sb.sin=Sb.sin;Sb.cos=Sb.cos;Sb.tan=Sb.tan;Sb.asin=Sb.asin;Sb.acos=Sb.acos;Sb.atan=Sb.atan;Sb.safeAsin= +Sb.W;Sb.safeAcos=Sb.V;Sb.atan2=Sb.atan2;Sb.sqrt=Sb.sqrt;Sb.clamp=Sb.h;Sb.rand=Sb.i;Sb.randIn=Sb.C;Sb.randVec3In=Sb.M;Sb.randVec3=Sb.I;window.OIMO.Pool=ld;ld.prototype.vec3=ld.prototype.ob;ld.prototype.mat3=ld.prototype.Wa;ld.prototype.mat4=ld.prototype.Ya;ld.prototype.quat=ld.prototype.nb;ld.prototype.dispose=ld.prototype.aa;ld.prototype.disposeVec3=ld.prototype.Sa;ld.prototype.disposeMat3=ld.prototype.qa;ld.prototype.disposeMat4=ld.prototype.Ma;ld.prototype.disposeQuat=ld.prototype.Oa;window.OIMO.Quat= +Hb;Hb.prototype.identity=Hb.prototype.I;Hb.prototype.init=Hb.prototype.Ia;Hb.prototype.add=Hb.prototype.add;Hb.prototype.sub=Hb.prototype.sub;Hb.prototype.scale=Hb.prototype.Y;Hb.prototype.addEq=Hb.prototype.h;Hb.prototype.subEq=Hb.prototype.qa;Hb.prototype.scaleEq=Hb.prototype.aa;Hb.prototype.length=Hb.prototype.length;Hb.prototype.lengthSq=Hb.prototype.M;Hb.prototype.dot=Hb.prototype.i;Hb.prototype.normalized=Hb.prototype.W;Hb.prototype.normalize=Hb.prototype.V;Hb.prototype.setArc=Hb.prototype.Ma; +Hb.prototype.slerp=Hb.prototype.Oa;Hb.prototype.copyFrom=Hb.prototype.Dd;Hb.prototype.clone=Hb.prototype.clone;Hb.prototype.fromMat3=Hb.prototype.C;Hb.prototype.toMat3=Hb.prototype.Sa;Hb.prototype.toString=Hb.prototype.toString;window.OIMO.Contact=Hd;Hd.prototype.getShape1=Hd.prototype.M;Hd.prototype.getShape2=Hd.prototype.V;Hd.prototype.isTouching=Hd.prototype.vh;Hd.prototype.getManifold=Hd.prototype.i;Hd.prototype.getContactConstraint=Hd.prototype.Y;Hd.prototype.getPrev=Hd.prototype.I;Hd.prototype.getNext= +Hd.prototype.C;window.OIMO.ContactLink=Ef;Ef.prototype.getContact=Ef.prototype.h;Ef.prototype.getOther=Ef.prototype.C;Ef.prototype.getPrev=Ef.prototype.I;Ef.prototype.getNext=Ef.prototype.i;window.OIMO.ContactManager=ug;ug.prototype.getNumContacts=ug.prototype.W;ug.prototype.getContactList=ug.prototype.V;window.OIMO.TimeStep=cl;window.OIMO.World=sb;sb.prototype.step=sb.prototype.Gb;sb.prototype.addRigidBody=sb.prototype.Ie;sb.prototype.removeRigidBody=sb.prototype.hd;sb.prototype.addJoint=sb.prototype.He; +sb.prototype.removeJoint=sb.prototype.yi;sb.prototype.setDebugDraw=sb.prototype.mg;sb.prototype.getDebugDraw=sb.prototype.vf;sb.prototype.debugDraw=sb.prototype.sf;sb.prototype.rayCast=sb.prototype.yd;sb.prototype.convexCast=sb.prototype.tb;sb.prototype.aabbTest=sb.prototype.Xa;sb.prototype.getRigidBodyList=sb.prototype.gd;sb.prototype.getJointList=sb.prototype.yf;sb.prototype.getBroadPhase=sb.prototype.tf;sb.prototype.getContactManager=sb.prototype.uf;sb.prototype.getNumRigidBodies=sb.prototype.Af; +sb.prototype.getNumJoints=sb.prototype.tc;sb.prototype.getNumShapes=sb.prototype.Fb;sb.prototype.getNumIslands=sb.prototype.zf;sb.prototype.getNumVelocityIterations=sb.prototype.yc;sb.prototype.setNumVelocityIterations=sb.prototype.Vg;sb.prototype.getNumPositionIterations=sb.prototype.vd;sb.prototype.setNumPositionIterations=sb.prototype.wd;sb.prototype.getGravity=sb.prototype.wf;sb.prototype.setGravity=sb.prototype.jd;window.OIMO.AabbTestCallback=bl;window.OIMO.ContactCallback=ak;window.OIMO.RayCastCallback= +Ek;window.OIMO.RayCastClosest=aj;aj.prototype.clear=aj.prototype.clear;aj.prototype.process=aj.prototype.process;window.OIMO.DebugDraw=Zf;window.OIMO.DebugDrawStyle=al;window.OIMO.Performance=ii;window.OIMO.ConstraintSolver=cd;cd.prototype.preSolveVelocity=cd.prototype.Rf;cd.prototype.warmStart=cd.prototype.Wf;cd.prototype.solveVelocity=cd.prototype.Vf;cd.prototype.postSolveVelocity=cd.prototype.rg;cd.prototype.preSolvePosition=cd.prototype.Bf;cd.prototype.solvePositionSplitImpulse=cd.prototype.Uf; +cd.prototype.solvePositionNgs=cd.prototype.Tf;cd.prototype.postSolve=cd.prototype.postSolve;window.OIMO.PositionCorrectionAlgorithm=Jh;window.OIMO.ContactConstraint=Ve;Ve.prototype.getShape1=Ve.prototype.i;Ve.prototype.getShape2=Ve.prototype.C;Ve.prototype.getManifold=Ve.prototype.h;Ve.prototype.isTouching=Ve.prototype.vh;window.OIMO.Manifold=qd;qd.prototype.getNormal=qd.prototype.I;qd.prototype.getNormalTo=qd.prototype.M;qd.prototype.getTangent=qd.prototype.Y;qd.prototype.getTangentTo=qd.prototype.aa; +qd.prototype.getBinormal=qd.prototype.i;qd.prototype.getBinormalTo=qd.prototype.C;qd.prototype.getPoints=qd.prototype.W;qd.prototype.getNumPoints=qd.prototype.V;window.OIMO.ManifoldPoint=Rc;Rc.prototype.getPosition1=Rc.prototype.M;Rc.prototype.getPosition1To=Rc.prototype.V;Rc.prototype.getPosition2=Rc.prototype.W;Rc.prototype.getPosition2To=Rc.prototype.Y;Rc.prototype.getDepth=Rc.prototype.C;Rc.prototype.isWarmStarted=Rc.prototype.qa;Rc.prototype.getNormalImpulse=Rc.prototype.I;Rc.prototype.getTangentImpulse= +Rc.prototype.aa;Rc.prototype.getBinormalImpulse=Rc.prototype.i;Rc.prototype.isEnabled=Rc.prototype.h;window.OIMO.Joint=ya;ya.prototype.getRigidBody1=ya.prototype.gi;ya.prototype.getRigidBody2=ya.prototype.hi;ya.prototype.getType=ya.prototype.Ai;ya.prototype.getAnchor1=ya.prototype.Bh;ya.prototype.getAnchor2=ya.prototype.Dh;ya.prototype.getAnchor1To=ya.prototype.Ch;ya.prototype.getAnchor2To=ya.prototype.Eh;ya.prototype.getLocalAnchor1=ya.prototype.xh;ya.prototype.getLocalAnchor2=ya.prototype.ci;ya.prototype.getLocalAnchor1To= +ya.prototype.bi;ya.prototype.getLocalAnchor2To=ya.prototype.di;ya.prototype.getBasis1=ya.prototype.Jh;ya.prototype.getBasis2=ya.prototype.Lh;ya.prototype.getBasis1To=ya.prototype.Kh;ya.prototype.getBasis2To=ya.prototype.Mh;ya.prototype.getAllowCollision=ya.prototype.Ah;ya.prototype.setAllowCollision=ya.prototype.Ri;ya.prototype.getBreakForce=ya.prototype.Nh;ya.prototype.setBreakForce=ya.prototype.Si;ya.prototype.getBreakTorque=ya.prototype.Oh;ya.prototype.setBreakTorque=ya.prototype.Ti;ya.prototype.getPositionCorrectionAlgorithm= +ya.prototype.fi;ya.prototype.setPositionCorrectionAlgorithm=ya.prototype.Ui;ya.prototype.getAppliedForce=ya.prototype.Fh;ya.prototype.getAppliedForceTo=ya.prototype.Gh;ya.prototype.getAppliedTorque=ya.prototype.Hh;ya.prototype.getAppliedTorqueTo=ya.prototype.Ih;ya.prototype.getPrev=ya.prototype.zi;ya.prototype.getNext=ya.prototype.Vg;window.OIMO.CylindricalJoint=ec;ec.prototype.getAxis1=ec.prototype.gd;ec.prototype.getAxis2=ec.prototype.jd;ec.prototype.getAxis1To=ec.prototype.hd;ec.prototype.getAxis2To= +ec.prototype.wd;ec.prototype.getLocalAxis1=ec.prototype.$d;ec.prototype.getLocalAxis2=ec.prototype.be;ec.prototype.getLocalAxis1To=ec.prototype.ae;ec.prototype.getLocalAxis2To=ec.prototype.Qd;ec.prototype.getTranslationalSpringDamper=ec.prototype.Ze;ec.prototype.getRotationalSpringDamper=ec.prototype.Xe;ec.prototype.getTranslationalLimitMotor=ec.prototype.Ye;ec.prototype.getRotationalLimitMotor=ec.prototype.We;ec.prototype.getAngle=ec.prototype.yc;ec.prototype.getTranslation=ec.prototype.Rd;window.OIMO.JointConfig= +jf;window.OIMO.CylindricalJointConfig=Yj;Yj.prototype.init=Yj.prototype.Ia;window.OIMO.GenericJoint=Qc;Qc.prototype.getAxisX=Qc.prototype.ae;Qc.prototype.getAxisY=Qc.prototype.be;Qc.prototype.getAxisZ=Qc.prototype.Qd;Qc.prototype.getTranslationalSpringDampers=Qc.prototype.Ye;Qc.prototype.getRotationalSpringDampers=Qc.prototype.We;Qc.prototype.getTranslationalLimitMotors=Qc.prototype.Xe;Qc.prototype.getRotationalLimitMotors=Qc.prototype.Rd;Qc.prototype.getAngles=Qc.prototype.$d;Qc.prototype.getTranslations= +Qc.prototype.Ze;window.OIMO.GenericJointConfig=Xj;Xj.prototype.init=Xj.prototype.Ia;window.OIMO.JointLink=Df;Df.prototype.getContact=Df.prototype.h;Df.prototype.getOther=Df.prototype.C;Df.prototype.getPrev=Df.prototype.I;Df.prototype.getNext=Df.prototype.i;window.OIMO.JointType=$g;window.OIMO.PrismaticJoint=rc;rc.prototype.getAxis1=rc.prototype.vd;rc.prototype.getAxis2=rc.prototype.gd;rc.prototype.getAxis1To=rc.prototype.yc;rc.prototype.getAxis2To=rc.prototype.hd;rc.prototype.getLocalAxis1=rc.prototype.wd; +rc.prototype.getLocalAxis2=rc.prototype.ae;rc.prototype.getLocalAxis1To=rc.prototype.$d;rc.prototype.getLocalAxis2To=rc.prototype.be;rc.prototype.getSpringDamper=rc.prototype.Qd;rc.prototype.getLimitMotor=rc.prototype.jd;rc.prototype.getTranslation=rc.prototype.Rd;window.OIMO.PrismaticJointConfig=Wj;Wj.prototype.init=Wj.prototype.Ia;window.OIMO.RagdollJoint=$b;$b.prototype.getAxis1=$b.prototype.$d;$b.prototype.getAxis2=$b.prototype.be;$b.prototype.getAxis1To=$b.prototype.ae;$b.prototype.getAxis2To= +$b.prototype.Qd;$b.prototype.getLocalAxis1=$b.prototype.Rd;$b.prototype.getLocalAxis2=$b.prototype.Xe;$b.prototype.getLocalAxis1To=$b.prototype.We;$b.prototype.getLocalAxis2To=$b.prototype.Ye;$b.prototype.getTwistSpringDamper=$b.prototype.Qi;$b.prototype.getTwistLimitMotor=$b.prototype.ji;$b.prototype.getSwingSpringDamper=$b.prototype.ug;$b.prototype.getSwingAxis=$b.prototype.sg;$b.prototype.getSwingAxisTo=$b.prototype.tg;$b.prototype.getSwingAngle=$b.prototype.Ze;$b.prototype.getTwistAngle=$b.prototype.ii; window.OIMO.RagdollJointConfig=Vj;Vj.prototype.init=Vj.prototype.Ia;window.OIMO.RevoluteJoint=qc;qc.prototype.getAxis1=qc.prototype.yc;qc.prototype.getAxis2=qc.prototype.hd;qc.prototype.getAxis1To=qc.prototype.gd;qc.prototype.getAxis2To=qc.prototype.jd;qc.prototype.getLocalAxis1=qc.prototype.$d;qc.prototype.getLocalAxis2=qc.prototype.be;qc.prototype.getLocalAxis1To=qc.prototype.ae;qc.prototype.getLocalAxis2To=qc.prototype.Qd;qc.prototype.getSpringDamper=qc.prototype.Rd;qc.prototype.getLimitMotor= -qc.prototype.wd;qc.prototype.getAngle=qc.prototype.tc;window.OIMO.RevoluteJointConfig=Uj;Uj.prototype.init=Uj.prototype.Ia;window.OIMO.RotationalLimitMotor=te;te.prototype.setLimits=te.prototype.h;te.prototype.setMotor=te.prototype.i;te.prototype.clone=te.prototype.clone;window.OIMO.SphericalJoint=Zi;Zi.prototype.getSpringDamper=Zi.prototype.Xa;window.OIMO.SphericalJointConfig=Tj;Tj.prototype.init=Tj.prototype.Ia;window.OIMO.SpringDamper=Fd;Fd.prototype.setSpring=Fd.prototype.h;Fd.prototype.setSymplecticEuler= -Fd.prototype.i;Fd.prototype.clone=Fd.prototype.clone;window.OIMO.TranslationalLimitMotor=rf;rf.prototype.setLimits=rf.prototype.h;rf.prototype.setMotor=rf.prototype.i;rf.prototype.clone=rf.prototype.clone;window.OIMO.UniversalJoint=cc;cc.prototype.getAxis1=cc.prototype.$d;cc.prototype.getAxis2=cc.prototype.be;cc.prototype.getAxis1To=cc.prototype.ae;cc.prototype.getAxis2To=cc.prototype.Qd;cc.prototype.getLocalAxis1=cc.prototype.Rd;cc.prototype.getLocalAxis2=cc.prototype.Xe;cc.prototype.getLocalAxis1To= -cc.prototype.We;cc.prototype.getLocalAxis2To=cc.prototype.Ye;cc.prototype.getSpringDamper1=cc.prototype.gi;cc.prototype.getSpringDamper2=cc.prototype.hi;cc.prototype.getLimitMotor1=cc.prototype.tg;cc.prototype.getLimitMotor2=cc.prototype.ug;cc.prototype.getAngle1=cc.prototype.Ze;cc.prototype.getAngle2=cc.prototype.sg;window.OIMO.UniversalJointConfig=Sj;Sj.prototype.init=Sj.prototype.Ia;window.OIMO.ConstraintSolverType=Ck;window.OIMO.DirectJointConstraintSolver=yd;yd.prototype.preSolveVelocity=yd.prototype.Rf; +qc.prototype.wd;qc.prototype.getAngle=qc.prototype.tc;window.OIMO.RevoluteJointConfig=Uj;Uj.prototype.init=Uj.prototype.Ia;window.OIMO.RotationalLimitMotor=ne;ne.prototype.setLimits=ne.prototype.h;ne.prototype.setMotor=ne.prototype.i;ne.prototype.clone=ne.prototype.clone;window.OIMO.SphericalJoint=Zi;Zi.prototype.getSpringDamper=Zi.prototype.Xa;window.OIMO.SphericalJointConfig=Tj;Tj.prototype.init=Tj.prototype.Ia;window.OIMO.SpringDamper=Ed;Ed.prototype.setSpring=Ed.prototype.h;Ed.prototype.setSymplecticEuler= +Ed.prototype.i;Ed.prototype.clone=Ed.prototype.clone;window.OIMO.TranslationalLimitMotor=kf;kf.prototype.setLimits=kf.prototype.h;kf.prototype.setMotor=kf.prototype.i;kf.prototype.clone=kf.prototype.clone;window.OIMO.UniversalJoint=dc;dc.prototype.getAxis1=dc.prototype.$d;dc.prototype.getAxis2=dc.prototype.be;dc.prototype.getAxis1To=dc.prototype.ae;dc.prototype.getAxis2To=dc.prototype.Qd;dc.prototype.getLocalAxis1=dc.prototype.Rd;dc.prototype.getLocalAxis2=dc.prototype.Xe;dc.prototype.getLocalAxis1To= +dc.prototype.We;dc.prototype.getLocalAxis2To=dc.prototype.Ye;dc.prototype.getSpringDamper1=dc.prototype.ii;dc.prototype.getSpringDamper2=dc.prototype.ji;dc.prototype.getLimitMotor1=dc.prototype.tg;dc.prototype.getLimitMotor2=dc.prototype.ug;dc.prototype.getAngle1=dc.prototype.Ze;dc.prototype.getAngle2=dc.prototype.sg;window.OIMO.UniversalJointConfig=Sj;Sj.prototype.init=Sj.prototype.Ia;window.OIMO.ConstraintSolverType=Ck;window.OIMO.DirectJointConstraintSolver=yd;yd.prototype.preSolveVelocity=yd.prototype.Rf; yd.prototype.warmStart=yd.prototype.Wf;yd.prototype.solveVelocity=yd.prototype.Vf;yd.prototype.postSolveVelocity=yd.prototype.rg;yd.prototype.preSolvePosition=yd.prototype.Bf;yd.prototype.solvePositionSplitImpulse=yd.prototype.Uf;yd.prototype.solvePositionNgs=yd.prototype.Tf;yd.prototype.postSolve=yd.prototype.postSolve;window.OIMO.PgsContactConstraintSolver=Nd;Nd.prototype.preSolveVelocity=Nd.prototype.Rf;Nd.prototype.warmStart=Nd.prototype.Wf;Nd.prototype.solveVelocity=Nd.prototype.Vf;Nd.prototype.preSolvePosition= Nd.prototype.Bf;Nd.prototype.solvePositionSplitImpulse=Nd.prototype.Uf;Nd.prototype.solvePositionNgs=Nd.prototype.Tf;Nd.prototype.postSolve=Nd.prototype.postSolve;window.OIMO.PgsJointConstraintSolver=xd;xd.prototype.preSolveVelocity=xd.prototype.Rf;xd.prototype.warmStart=xd.prototype.Wf;xd.prototype.solveVelocity=xd.prototype.Vf;xd.prototype.postSolveVelocity=xd.prototype.rg;xd.prototype.preSolvePosition=xd.prototype.Bf;xd.prototype.solvePositionSplitImpulse=xd.prototype.Uf;xd.prototype.solvePositionNgs= xd.prototype.Tf;xd.prototype.postSolve=xd.prototype.postSolve;window.OIMO.MassData=Vk;window.OIMO.RigidBody=J;J.prototype.getPosition=J.prototype.Va;J.prototype.getPositionTo=J.prototype.Xa;J.prototype.setPosition=J.prototype.He;J.prototype.translate=J.prototype.tf;J.prototype.getRotation=J.prototype.Fb;J.prototype.getRotationTo=J.prototype.Gb;J.prototype.setRotation=J.prototype.Ie;J.prototype.setRotationXyz=J.prototype.rf;J.prototype.rotate=J.prototype.Ed;J.prototype.rotateXyz=J.prototype.ce;J.prototype.getOrientation= -J.prototype.Sb;J.prototype.getOrientationTo=J.prototype.Wb;J.prototype.setOrientation=J.prototype.je;J.prototype.getTransform=J.prototype.ac;J.prototype.getTransformTo=J.prototype.bc;J.prototype.setTransform=J.prototype.sf;J.prototype.getMass=J.prototype.zh;J.prototype.getLocalInertia=J.prototype.We;J.prototype.getLocalInertiaTo=J.prototype.Xe;J.prototype.getMassData=J.prototype.Ah;J.prototype.getMassDataTo=J.prototype.Bh;J.prototype.setMassData=J.prototype.ai;J.prototype.getRotationFactor=J.prototype.sg; -J.prototype.setRotationFactor=J.prototype.bi;J.prototype.getLinearVelocity=J.prototype.Qd;J.prototype.getLinearVelocityTo=J.prototype.Rd;J.prototype.setLinearVelocity=J.prototype.$h;J.prototype.getAngularVelocity=J.prototype.jd;J.prototype.getAngularVelocityTo=J.prototype.wd;J.prototype.setAngularVelocity=J.prototype.Mh;J.prototype.addLinearVelocity=J.prototype.vf;J.prototype.addAngularVelocity=J.prototype.uf;J.prototype.applyImpulse=J.prototype.vd;J.prototype.applyLinearImpulse=J.prototype.Af;J.prototype.applyAngularImpulse= -J.prototype.yf;J.prototype.applyForce=J.prototype.zf;J.prototype.applyForceToCenter=J.prototype.tc;J.prototype.applyTorque=J.prototype.yc;J.prototype.getLinearContactImpulse=J.prototype.$d;J.prototype.getLinearContactImpulseTo=J.prototype.ae;J.prototype.getAngularContactImpulse=J.prototype.gd;J.prototype.getAngularContactImpulseTo=J.prototype.hd;J.prototype.getGravityScale=J.prototype.xi;J.prototype.setGravityScale=J.prototype.ug;J.prototype.getLocalPoint=J.prototype.Ye;J.prototype.getLocalPointTo= -J.prototype.wh;J.prototype.getLocalVector=J.prototype.xh;J.prototype.getLocalVectorTo=J.prototype.yh;J.prototype.getWorldPoint=J.prototype.Fh;J.prototype.getWorldPointTo=J.prototype.Gh;J.prototype.getWorldVector=J.prototype.Hh;J.prototype.getWorldVectorTo=J.prototype.Ih;J.prototype.getNumShapes=J.prototype.Rb;J.prototype.getShapeList=J.prototype.Dh;J.prototype.getNumContactLinks=J.prototype.Ch;J.prototype.getContactLinkList=J.prototype.Vg;J.prototype.getNumJointLinks=J.prototype.Ze;J.prototype.getJointLinkList= -J.prototype.yi;J.prototype.addShape=J.prototype.wf;J.prototype.removeShape=J.prototype.Kh;J.prototype.getType=J.prototype.Sc;J.prototype.setType=J.prototype.di;J.prototype.wakeUp=J.prototype.fi;J.prototype.sleep=J.prototype.ei;J.prototype.isSleeping=J.prototype.Jh;J.prototype.getSleepTime=J.prototype.Eh;J.prototype.setAutoSleep=J.prototype.tg;J.prototype.getLinearDamping=J.prototype.be;J.prototype.setLinearDamping=J.prototype.vh;J.prototype.getAngularDamping=J.prototype.mg;J.prototype.setAngularDamping= -J.prototype.Lh;J.prototype.getPrev=J.prototype.tb;J.prototype.getNext=J.prototype.Pb;window.OIMO.RigidBodyConfig=qk;window.OIMO.RigidBodyType=Eh;window.OIMO.Shape=Ab;Ab.prototype.getFriction=Ab.prototype.Ma;Ab.prototype.setFriction=Ab.prototype.Rb;Ab.prototype.getRestitution=Ab.prototype.Ya;Ab.prototype.setRestitution=Ab.prototype.Wb;Ab.prototype.getLocalTransform=Ab.prototype.Sa;Ab.prototype.getLocalTransformTo=Ab.prototype.Wa;Ab.prototype.getTransform=Ab.prototype.C;Ab.prototype.getTransformTo= -Ab.prototype.I;Ab.prototype.setLocalTransform=Ab.prototype.Sb;Ab.prototype.getDensity=Ab.prototype.qa;Ab.prototype.setDensity=Ab.prototype.Pb;Ab.prototype.getAabb=Ab.prototype.M;Ab.prototype.getAabbTo=Ab.prototype.V;Ab.prototype.getGeometry=Ab.prototype.Oa;Ab.prototype.getRigidBody=Ab.prototype.nb;Ab.prototype.getCollisionGroup=Ab.prototype.W;Ab.prototype.setCollisionGroup=Ab.prototype.ob;Ab.prototype.getCollisionMask=Ab.prototype.Y;Ab.prototype.setCollisionMask=Ab.prototype.Ib;Ab.prototype.getContactCallback= -Ab.prototype.aa;Ab.prototype.setContactCallback=Ab.prototype.Jb;Ab.prototype.getPrev=Ab.prototype.i;Ab.prototype.getNext=Ab.prototype.h;window.OIMO.ShapeConfig=$e};tc.prototype.eg=function(){return null};tc.prototype.fg=function(){};tc.prototype.fd=function(){};tc.prototype.Sb=function(a,b){return a.Rb.R&&a.Sb.S&&a.Tb.T:!1};tc.prototype.qg=function(){};tc.prototype.Ib=function(){return this.Cd};tc.prototype.Rb=function(){return this.eh};tc.prototype.Jb=function(){return this.Ma}; -tc.prototype.yd=function(){};tc.prototype.aa=function(){};tc.prototype.Y=function(){};tf.prototype.Wd=function(){};tf.prototype.Yb=function(){};tf.prototype.h=function(){return!1};tf.prototype.Oa=function(){return this.Xb};tf.prototype.nb=function(){return this.Ge};tf.prototype.yd=function(a,b,e,d){var c=a.x;var f=a.y;a=a.z;var h=b.x;var k=b.y;b=b.z;c-=e.F;f-=e.G;a-=e.H;h-=e.F;k-=e.G;b-=e.H;var g=e.A*c+e.o*f+e.u*a;var l=e.j*c+e.v*f+e.l*a;if(this.h(g,l,e.m*c+e.s*f+e.B*a,e.A*h+e.o*k+e.u*b,e.j*h+e.v* -k+e.l*b,e.m*h+e.s*k+e.B*b,d)){a=d.position;c=a.x;f=a.y;k=a.z;a=d.normal;b=a.x;g=a.y;var m=a.z;l=e.A*c+e.j*f+e.m*k;var n=e.o*c+e.v*f+e.s*k;k=e.u*c+e.l*f+e.B*k;a=e.A*b+e.j*g+e.m*m;h=e.o*b+e.v*g+e.s*m;b=e.u*b+e.l*g+e.B*m;c=l+e.F;f=n+e.G;k+=e.H;e=d.position;e.x=c;e.y=f;e.z=k;d=d.normal;d.x=a;d.y=h;d.z=b;return!0}return!1};rl(kd,tf);kd.prototype.Sa=function(){return this.fc};kd.prototype.ob=function(a){0>a&&(a=0);this.fc=a};kd.prototype.ud=function(){};kd.prototype.yd=function(a,b,e,d){return this.Ma? -yc.instance.yd(this,e,a,b,d):tf.prototype.yd.call(this,a,b,e,d)};rl(xk,kd);xk.prototype.Ia=function(a,b,e){this.c=a;var d=e.x;var c=e.y;var f=e.z;e=b.A*d+b.o*c+b.u*f;var h=b.j*d+b.v*c+b.l*f;b=b.m*d+b.s*c+b.B*f;d=this.i=new z;d.x=e;d.y=h;d.z=b;this.fc=a.fc};xk.prototype.ud=function(a,b){this.c.ud(a,b);var e=this.i;0e.R&&a.Se.S&&a.Te.T){var c=this.V;null!=c?(this.V=c.U,c.U=null):c=new Yg;null!=this.Cd&&(c.U=this.Cd);this.Cd=c;c.Nf=a;c.Of=e}e=d}a=b}};Od.prototype.yd=function(a,b,e){var d=a.x;var c=a.y;a=a.z;var f=b.x;var h=b.y;b=b.z;for(var k=this.i;null!=k;){var g=k.U,l=d,m=c,n=a,q=f,p=h,r=b,t=k.R,x=k.S,v=k.T,B=k.N,H=k.O,C=k.P;if(t>(l>q?l:q)||B<(l(m>p?m: -p)||H<(m(n>r?n:r)||C<(nq?-q:q;var y=0>p?-p:p,A=0>N?-N:N,E=.5*(B-t),L=.5*(H-x),G=.5*(C-v);l-=.5*(B+t);m-=.5*(H+x);n-=.5*(C+v);v=m*N-n*p;0<(0>v?-v:v)-(L*A+G*y)?n=!0:(n=n*q-l*N,n=0<(0>n?-n:n)-(G*r+E*A));n?q=!0:(q=l*p-m*q,q=0<(0>q?-q:q)-(E*y+L*r));q=q?!1:!0}q&&e.process(k);k=g}};Od.prototype.aa=function(a,b,e,d){for(var c=this.i;null!=c;){var f=c.U,h=this.D.min;h.x=c.R;h.y=c.S;h.z=c.T;h=this.D.max;h.x=c.N;h.y=c.O;h.z=c.P;this.Oa.Ia(a,b,e);h=yc.instance; -0==h.Oa(this.Oa,this.D,b,this.nb,null,!1)&&0>=h.distance&&d.process(c);c=f}};Od.prototype.Y=function(a,b){for(var e=this.i;null!=e;){var d=e.U;a.wae.R&&a.xae.S&&a.yae.T&&b.process(e);e=d}};rl(cd,tc);cd.prototype.W=function(a,b){this.Ma++;var e=0==a.Z,d=0==b.Z;a==b?e||(this.W(a.L[0],b),this.W(a.L[1],b)):a.Rb.R&&a.Sb.S&&a.Tb.T&&(e&&d?(e=this.V,null!=e?(this.V=e.U,e.U=null):e=new Yg,null!=this.Cd&&(e.U=this.Cd),this.Cd=e,e.Nf=a.Eb,e.Of=b.Eb): -d||a.Z>b.Z?(this.W(a.L[0],b),this.W(a.L[1],b)):(this.W(b.L[0],a),this.W(b.L[1],a)))};cd.prototype.Ya=function(a,b,e,d,c,f,h,k){var g=a.R,l=a.S,m=a.T,n=a.N,q=a.O,p=a.P;if(g>(b>c?b:c)||n<(b(e>f?e:f)||q<(e(d>h?d:h)||p<(dt?-t:t;var B=0>x?-x:x,H=0>v?-v:v,C=.5*(n-g),N=.5*(q-l),y=.5*(p-m);g=b-.5*(n+g);l=e-.5*(q+l);m=d-.5*(p+m);p=l*v-m*x;0<(0>p?-p:p)-(N*H+y*B)?H=!0:(v=m*t-g*v,H=0<(0>v?-v:v)-(y*r+C*H));H?r=!0:(t=g*x-l*t,r=0<(0>t?-t:t)-(C* -B+N*r));r=r?!1:!0}r&&(0==a.Z?k.process(a.Eb):(this.Ya(a.L[0],b,e,d,c,f,h,k),this.Ya(a.L[1],b,e,d,c,f,h,k)))};cd.prototype.Wa=function(a,b,e,d,c){var f=this.D.min;f.x=a.R;f.y=a.S;f.z=a.T;f=this.D.max;f.x=a.N;f.y=a.O;f.z=a.P;this.Oa.Ia(b,e,d);f=yc.instance;0==f.Oa(this.Oa,this.D,e,this.nb,null,!1)&&0>=f.distance&&(0==a.Z?c.process(a.Eb):(this.Wa(a.L[0],b,e,d,c),this.Wa(a.L[1],b,e,d,c)))};cd.prototype.Sa=function(a,b,e){a.Rb.wa&&a.Sb.xa&&a.Tb.ya&&(0==a.Z?e.process(a.Eb): -(this.Sa(a.L[0],b,e),this.Sa(a.L[1],b,e)))};cd.prototype.eg=function(a,b){a=new hl(a,this.ob++);this.qa++;null==this.i?this.i=a:(this.C.U=a,a.sa=this.C);this.C=a;a.R=b.wa;a.S=b.xa;a.T=b.ya;a.N=b.ta;a.O=b.ua;a.P=b.va;b=ra.bvhProxyPadding;a.R-=b;a.S-=b;a.T-=b;a.N+=b;a.O+=b;a.P+=b;b=this.h;var e=b.h;null!=e?(b.h=e.U,e.U=null):e=new wk;var d=e;d.Eb=a;a.bg=d;d.R=a.R;d.S=a.S;d.T=a.T;d.N=a.N;d.O=a.O;d.P=a.P;b.M++;null==b.C?b.C=d:(b.i.Le=d,d.Me=b.i);b.i=d;if(null==b.$b)b.$b=d;else{for(var c=b.$b;0k.Z?(f.L[1]=e,e.Ka=f,e.Ta=1,e.L[0]=k,k.Ka=e,k.Ta=0,h=f.L[0],k=f.L[1],f.R=h.Rk.N?h.N:k.N,f.O=h.O>k.O?h.O:k.O,f.P=h.P>k.P?h.P:k.P,h=f.L[0].Z, +J.prototype.Sb;J.prototype.getOrientationTo=J.prototype.Wb;J.prototype.setOrientation=J.prototype.je;J.prototype.getTransform=J.prototype.ac;J.prototype.getTransformTo=J.prototype.bc;J.prototype.setTransform=J.prototype.sf;J.prototype.getMass=J.prototype.Bh;J.prototype.getLocalInertia=J.prototype.We;J.prototype.getLocalInertiaTo=J.prototype.Xe;J.prototype.getMassData=J.prototype.Ch;J.prototype.getMassDataTo=J.prototype.Dh;J.prototype.setMassData=J.prototype.ci;J.prototype.getRotationFactor=J.prototype.sg; +J.prototype.setRotationFactor=J.prototype.di;J.prototype.getLinearVelocity=J.prototype.Qd;J.prototype.getLinearVelocityTo=J.prototype.Rd;J.prototype.setLinearVelocity=J.prototype.bi;J.prototype.getAngularVelocity=J.prototype.jd;J.prototype.getAngularVelocityTo=J.prototype.wd;J.prototype.setAngularVelocity=J.prototype.Oh;J.prototype.addLinearVelocity=J.prototype.vf;J.prototype.addAngularVelocity=J.prototype.uf;J.prototype.applyImpulse=J.prototype.vd;J.prototype.applyLinearImpulse=J.prototype.Af;J.prototype.applyAngularImpulse= +J.prototype.yf;J.prototype.applyForce=J.prototype.zf;J.prototype.applyForceToCenter=J.prototype.tc;J.prototype.applyTorque=J.prototype.yc;J.prototype.getLinearContactImpulse=J.prototype.$d;J.prototype.getLinearContactImpulseTo=J.prototype.ae;J.prototype.getAngularContactImpulse=J.prototype.gd;J.prototype.getAngularContactImpulseTo=J.prototype.hd;J.prototype.getGravityScale=J.prototype.zi;J.prototype.setGravityScale=J.prototype.ug;J.prototype.getLocalPoint=J.prototype.Ye;J.prototype.getLocalPointTo= +J.prototype.yh;J.prototype.getLocalVector=J.prototype.zh;J.prototype.getLocalVectorTo=J.prototype.Ah;J.prototype.getWorldPoint=J.prototype.Hh;J.prototype.getWorldPointTo=J.prototype.Ih;J.prototype.getWorldVector=J.prototype.Jh;J.prototype.getWorldVectorTo=J.prototype.Kh;J.prototype.getNumShapes=J.prototype.Rb;J.prototype.getShapeList=J.prototype.Fh;J.prototype.getNumContactLinks=J.prototype.Eh;J.prototype.getContactLinkList=J.prototype.Vg;J.prototype.getNumJointLinks=J.prototype.Ze;J.prototype.getJointLinkList= +J.prototype.Ai;J.prototype.addShape=J.prototype.wf;J.prototype.removeShape=J.prototype.Mh;J.prototype.getType=J.prototype.Sc;J.prototype.setType=J.prototype.fi;J.prototype.wakeUp=J.prototype.hi;J.prototype.sleep=J.prototype.gi;J.prototype.isSleeping=J.prototype.Lh;J.prototype.getSleepTime=J.prototype.Gh;J.prototype.setAutoSleep=J.prototype.tg;J.prototype.getLinearDamping=J.prototype.be;J.prototype.setLinearDamping=J.prototype.xh;J.prototype.getAngularDamping=J.prototype.mg;J.prototype.setAngularDamping= +J.prototype.Nh;J.prototype.getPrev=J.prototype.tb;J.prototype.getNext=J.prototype.Pb;window.OIMO.RigidBodyConfig=qk;window.OIMO.RigidBodyType=Ih;window.OIMO.Shape=zb;zb.prototype.getFriction=zb.prototype.Ma;zb.prototype.setFriction=zb.prototype.Rb;zb.prototype.getRestitution=zb.prototype.Ya;zb.prototype.setRestitution=zb.prototype.Wb;zb.prototype.getLocalTransform=zb.prototype.Sa;zb.prototype.getLocalTransformTo=zb.prototype.Wa;zb.prototype.getTransform=zb.prototype.C;zb.prototype.getTransformTo= +zb.prototype.I;zb.prototype.setLocalTransform=zb.prototype.Sb;zb.prototype.getDensity=zb.prototype.qa;zb.prototype.setDensity=zb.prototype.Pb;zb.prototype.getAabb=zb.prototype.M;zb.prototype.getAabbTo=zb.prototype.V;zb.prototype.getGeometry=zb.prototype.Oa;zb.prototype.getRigidBody=zb.prototype.nb;zb.prototype.getCollisionGroup=zb.prototype.W;zb.prototype.setCollisionGroup=zb.prototype.ob;zb.prototype.getCollisionMask=zb.prototype.Y;zb.prototype.setCollisionMask=zb.prototype.Ib;zb.prototype.getContactCallback= +zb.prototype.aa;zb.prototype.setContactCallback=zb.prototype.Jb;zb.prototype.getPrev=zb.prototype.i;zb.prototype.getNext=zb.prototype.h;window.OIMO.ShapeConfig=Ue};uc.prototype.eg=function(){return null};uc.prototype.fg=function(){};uc.prototype.fd=function(){};uc.prototype.Sb=function(a,b){return a.Rb.R&&a.Sb.S&&a.Tb.T:!1};uc.prototype.qg=function(){};uc.prototype.Ib=function(){return this.Cd};uc.prototype.Rb=function(){return this.eh};uc.prototype.Jb=function(){return this.Ma}; +uc.prototype.yd=function(){};uc.prototype.aa=function(){};uc.prototype.Y=function(){};mf.prototype.Wd=function(){};mf.prototype.Yb=function(){};mf.prototype.h=function(){return!1};mf.prototype.Oa=function(){return this.Xb};mf.prototype.nb=function(){return this.Ge};mf.prototype.yd=function(a,b,e,d){var c=a.x;var f=a.y;a=a.z;var h=b.x;var k=b.y;b=b.z;c-=e.F;f-=e.G;a-=e.H;h-=e.F;k-=e.G;b-=e.H;var g=e.A*c+e.o*f+e.u*a;var l=e.j*c+e.v*f+e.l*a;if(this.h(g,l,e.m*c+e.s*f+e.B*a,e.A*h+e.o*k+e.u*b,e.j*h+e.v* +k+e.l*b,e.m*h+e.s*k+e.B*b,d)){a=d.position;c=a.x;f=a.y;k=a.z;a=d.normal;b=a.x;g=a.y;var m=a.z;l=e.A*c+e.j*f+e.m*k;var n=e.o*c+e.v*f+e.s*k;k=e.u*c+e.l*f+e.B*k;a=e.A*b+e.j*g+e.m*m;h=e.o*b+e.v*g+e.s*m;b=e.u*b+e.l*g+e.B*m;c=l+e.F;f=n+e.G;k+=e.H;e=d.position;e.x=c;e.y=f;e.z=k;d=d.normal;d.x=a;d.y=h;d.z=b;return!0}return!1};rl(md,mf);md.prototype.Sa=function(){return this.fc};md.prototype.ob=function(a){0>a&&(a=0);this.fc=a};md.prototype.ud=function(){};md.prototype.yd=function(a,b,e,d){return this.Ma? +zc.instance.yd(this,e,a,b,d):mf.prototype.yd.call(this,a,b,e,d)};rl(xk,md);xk.prototype.Ia=function(a,b,e){this.c=a;var d=e.x;var c=e.y;var f=e.z;e=b.A*d+b.o*c+b.u*f;var h=b.j*d+b.v*c+b.l*f;b=b.m*d+b.s*c+b.B*f;d=this.i=new z;d.x=e;d.y=h;d.z=b;this.fc=a.fc};xk.prototype.ud=function(a,b){this.c.ud(a,b);var e=this.i;0e.R&&a.Se.S&&a.Te.T){var c=this.V;null!=c?(this.V=c.U,c.U=null):c=new bh;null!=this.Cd&&(c.U=this.Cd);this.Cd=c;c.Nf=a;c.Of=e}e=d}a=b}};Od.prototype.yd=function(a,b,e){var d=a.x;var c=a.y;a=a.z;var f=b.x;var h=b.y;b=b.z;for(var k=this.i;null!=k;){var g=k.U,l=d,m=c,n=a,q=f,p=h,r=b,t=k.R,x=k.S,v=k.T,B=k.N,H=k.O,C=k.P;if(t>(l>q?l:q)||B<(l(m>p?m: +p)||H<(m(n>r?n:r)||C<(nq?-q:q;var y=0>p?-p:p,A=0>O?-O:O,E=.5*(B-t),M=.5*(H-x),G=.5*(C-v);l-=.5*(B+t);m-=.5*(H+x);n-=.5*(C+v);v=m*O-n*p;0<(0>v?-v:v)-(M*A+G*y)?n=!0:(n=n*q-l*O,n=0<(0>n?-n:n)-(G*r+E*A));n?q=!0:(q=l*p-m*q,q=0<(0>q?-q:q)-(E*y+M*r));q=q?!1:!0}q&&e.process(k);k=g}};Od.prototype.aa=function(a,b,e,d){for(var c=this.i;null!=c;){var f=c.U,h=this.D.min;h.x=c.R;h.y=c.S;h.z=c.T;h=this.D.max;h.x=c.N;h.y=c.O;h.z=c.P;this.Oa.Ia(a,b,e);h=zc.instance; +0==h.Oa(this.Oa,this.D,b,this.nb,null,!1)&&0>=h.distance&&d.process(c);c=f}};Od.prototype.Y=function(a,b){for(var e=this.i;null!=e;){var d=e.U;a.wae.R&&a.xae.S&&a.yae.T&&b.process(e);e=d}};rl(dd,uc);dd.prototype.W=function(a,b){this.Ma++;var e=0==a.Z,d=0==b.Z;a==b?e||(this.W(a.L[0],b),this.W(a.L[1],b)):a.Rb.R&&a.Sb.S&&a.Tb.T&&(e&&d?(e=this.V,null!=e?(this.V=e.U,e.U=null):e=new bh,null!=this.Cd&&(e.U=this.Cd),this.Cd=e,e.Nf=a.Eb,e.Of=b.Eb): +d||a.Z>b.Z?(this.W(a.L[0],b),this.W(a.L[1],b)):(this.W(b.L[0],a),this.W(b.L[1],a)))};dd.prototype.Ya=function(a,b,e,d,c,f,h,k){var g=a.R,l=a.S,m=a.T,n=a.N,q=a.O,p=a.P;if(g>(b>c?b:c)||n<(b(e>f?e:f)||q<(e(d>h?d:h)||p<(dt?-t:t;var B=0>x?-x:x,H=0>v?-v:v,C=.5*(n-g),O=.5*(q-l),y=.5*(p-m);g=b-.5*(n+g);l=e-.5*(q+l);m=d-.5*(p+m);p=l*v-m*x;0<(0>p?-p:p)-(O*H+y*B)?H=!0:(v=m*t-g*v,H=0<(0>v?-v:v)-(y*r+C*H));H?r=!0:(t=g*x-l*t,r=0<(0>t?-t:t)-(C* +B+O*r));r=r?!1:!0}r&&(0==a.Z?k.process(a.Eb):(this.Ya(a.L[0],b,e,d,c,f,h,k),this.Ya(a.L[1],b,e,d,c,f,h,k)))};dd.prototype.Wa=function(a,b,e,d,c){var f=this.D.min;f.x=a.R;f.y=a.S;f.z=a.T;f=this.D.max;f.x=a.N;f.y=a.O;f.z=a.P;this.Oa.Ia(b,e,d);f=zc.instance;0==f.Oa(this.Oa,this.D,e,this.nb,null,!1)&&0>=f.distance&&(0==a.Z?c.process(a.Eb):(this.Wa(a.L[0],b,e,d,c),this.Wa(a.L[1],b,e,d,c)))};dd.prototype.Sa=function(a,b,e){a.Rb.wa&&a.Sb.xa&&a.Tb.ya&&(0==a.Z?e.process(a.Eb): +(this.Sa(a.L[0],b,e),this.Sa(a.L[1],b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1],d.R=h.Rg.N?h.N:g.N,d.O=h.O>g.O?h.O:g.O,d.P=h.P>g.P?h.P:g.P,h=d.L[0].Z,g=d.L[1].Z,d.Z=(h>g?h:g)+1),null!=c?(c.L[f]=k,k.Ka=c,k.Ta=f):(b.$b=k,k.Ka=null),d=k)}c=d.L[0].Z;f=d.L[1].Z;d.Z=(c>f?c:f)+1;c=d.L[0];f=d.L[1];d.R=c.Rf.N?c.N:f.N;d.O=c.O>f.O?c.O:f.O;d.P=c.P>f.P?c.P:f.P;d=d.Ka}}}a.bg=null; -e.L[0]=null;e.L[1]=null;e.Ta=0;e.Ka=null;e.Z=0;e.Eb=null;e.U=b.h;b.h=e;a.userData=null;a.U=null;a.sa=null;a.Lf&&(a.Lf=!1)};cd.prototype.fd=function(a,b,e){if(!(a.R<=b.wa&&a.N>=b.ta&&a.S<=b.xa&&a.O>=b.ua&&a.T<=b.ya&&a.P>=b.va)){a.R=b.wa;a.S=b.xa;a.T=b.ya;a.N=b.ta;a.O=b.ua;a.P=b.va;b=ra.bvhProxyPadding;a.R-=b;a.S-=b;a.T-=b;a.N+=b;a.O+=b;a.P+=b;if(null!=e){b=e.x;var d=e.y;e=e.z;a.R+=0b?0:b;a.O+=0>d?0:d;a.P+=0>e?0:e}if(!a.Lf){a.Lf=!0;if(this.I.length==this.M){e= -Array(this.M<<1);b=0;for(d=this.M;bthis.qa)){for(var b=this.M/this.qaN.Z){x.L[1]=r;r.Ka=x;r.Ta=1;r.L[0]=N; -N.Ka=r;N.Ta=0;var y=x.L[0],A=x.L[1];x.R=y.RA.N?y.N:A.N;x.O=y.O>A.O?y.O:A.O;x.P=y.P>A.P?y.P:A.P;var E=x.L[0].Z,L=x.L[1].Z;x.Z=(E>L?E:L)+1;var G=r.L[0],P=r.L[1];r.R=G.RP.N?G.N:P.N;r.O=G.O>P.O?G.O:P.O;r.P=G.P>P.P?G.P:P.P;var K=r.L[0].Z,pa=r.L[1].Z;r.Z=(K>pa?K:pa)+1}else{x.L[0]=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z.Ka=ca,Z.Ta=xb):(Fa.$b=Z,Z.Ka=null);W=Z}}var va=W.L[0].Z, -Na=W.L[1].Z;W.Z=(va>Na?va:Na)+1;var ya=W.L[0],Oa=W.L[1];W.R=ya.ROa.N?ya.N:Oa.N;W.O=ya.O>Oa.O?ya.O:Oa.O;W.P=ya.P>Oa.P?ya.P:Oa.P;W=W.Ka}}b&&this.W(this.h.$b,f.bg);f.Lf=!1}this.I[c]=null}b||this.W(this.h.$b,this.h.$b);this.M=0}};cd.prototype.yd=function(a,b,e){null!=this.h.$b&&this.Ya(this.h.$b,a.x,a.y,a.z,b.x,b.y,b.z,e)};cd.prototype.aa=function(a,b,e,d){null!=this.h.$b&&this.Wa(this.h.$b,a,b,e,d)};cd.prototype.Y=function(a,b){null!= -this.h.$b&&this.Sa(this.h.$b,a,b)};cd.prototype.Pb=function(){return this.h.W()};rl(hl,tg);gl.prototype.Ai=function(a,b){var e=b.R+b.N;var d=b.S+b.O;b=b.T+b.P;var c=a.L[0],f=a.L[1];a=c.R+c.N;var h=c.S+c.O;c=c.T+c.P;var k=f.R+f.N;var g=f.S+f.O;f=f.T+f.P;a-=e;h-=d;c-=b;k-=e;g-=d;f-=b;return a*a+h*h+c*cb&&(b=-b);return b+this.V(a.L[0])+this.V(a.L[1])};Pb.prototype.Ia= +e.L[0]=null;e.L[1]=null;e.Ta=0;e.Ka=null;e.Z=0;e.Eb=null;e.U=b.h;b.h=e;a.userData=null;a.U=null;a.sa=null;a.Lf&&(a.Lf=!1)};dd.prototype.fd=function(a,b,e){if(!(a.R<=b.wa&&a.N>=b.ta&&a.S<=b.xa&&a.O>=b.ua&&a.T<=b.ya&&a.P>=b.va)){a.R=b.wa;a.S=b.xa;a.T=b.ya;a.N=b.ta;a.O=b.ua;a.P=b.va;b=Ba.bvhProxyPadding;a.R-=b;a.S-=b;a.T-=b;a.N+=b;a.O+=b;a.P+=b;if(null!=e){b=e.x;var d=e.y;e=e.z;a.R+=0b?0:b;a.O+=0>d?0:d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:Fb)+1}else{X.L[0]=I;I.Ka=X;I.Ta=0;I.L[1]=Bb;Bb.Ka= +I;Bb.Ta=1;var wb=X.L[0],eb=X.L[1];X.R=wb.Reb.N?wb.N:eb.N;X.O=wb.O>eb.O?wb.O:eb.O;X.P=wb.P>eb.P?wb.P:eb.P;var Ib=X.L[0].Z,Q=X.L[1].Z;X.Z=(Ib>Q?Ib:Q)+1;var U=I.L[0],u=I.L[1];I.R=U.Ru.N?U.N:u.N;I.O=U.O>u.O?U.O:u.O;I.P=U.P>u.P?U.P:u.P;var Ab=I.L[0].Z,rb=I.L[1].Z;I.Z=(Ab>rb?Ab:rb)+1}null!=ba?(ba.L[xb]=X,X.Ka=ba,X.Ta=xb):(sa.$b=X,X.Ka=null);I=X}}var ra=I.L[0].Z,Ua=I.L[1].Z; +I.Z=(ra>Ua?ra:Ua)+1;var xa=I.L[0],Pa=I.L[1];I.R=xa.RPa.N?xa.N:Pa.N;I.O=xa.O>Pa.O?xa.O:Pa.O;I.P=xa.P>Pa.P?xa.P:Pa.P;I=I.Ka}}b&&this.W(this.h.$b,f.bg);f.Lf=!1}this.I[c]=null}b||this.W(this.h.$b,this.h.$b);this.M=0}};dd.prototype.yd=function(a,b,e){null!=this.h.$b&&this.Ya(this.h.$b,a.x,a.y,a.z,b.x,b.y,b.z,e)};dd.prototype.aa=function(a,b,e,d){null!=this.h.$b&&this.Wa(this.h.$b,a,b,e,d)};dd.prototype.Y=function(a,b){null!=this.h.$b&& +this.Sa(this.h.$b,a,b)};dd.prototype.Pb=function(){return this.h.W()};rl(hl,wg);gl.prototype.Ci=function(a,b){var e=b.R+b.N;var d=b.S+b.O;b=b.T+b.P;var c=a.L[0],f=a.L[1];a=c.R+c.N;var h=c.S+c.O;c=c.T+c.P;var k=f.R+f.N;var g=f.S+f.O;f=f.T+f.P;a-=e;h-=d;c-=b;k-=e;g-=d;f-=b;return a*a+h*h+c*cb&&(b=-b);return b+this.V(a.L[0])+this.V(a.L[1])};Pb.prototype.Ia= function(a,b){this.wa=a.x;this.xa=a.y;this.ya=a.z;this.ta=b.x;this.ua=b.y;this.va=b.z;return this};Pb.prototype.Ma=function(){var a=new z;a.x=this.wa;a.y=this.xa;a.z=this.ya;return a};Pb.prototype.Oa=function(a){a.x=this.wa;a.y=this.xa;a.z=this.ya};Pb.prototype.Ya=function(a){this.wa=a.x;this.xa=a.y;this.ya=a.z;return this};Pb.prototype.aa=function(){var a=new z;a.x=this.ta;a.y=this.ua;a.z=this.va;return a};Pb.prototype.qa=function(a){a.x=this.ta;a.y=this.ua;a.z=this.va};Pb.prototype.Wa=function(a){this.ta= a.x;this.ua=a.y;this.va=a.z;return this};Pb.prototype.C=function(){var a=new z;var b=this.wa+this.ta;var e=this.xa+this.ua;var d=this.ya+this.va;a.x=.5*b;a.y=.5*e;a.z=.5*d;return a};Pb.prototype.I=function(a){var b=this.wa+this.ta;var e=this.xa+this.ua;var d=this.ya+this.va;a.x=.5*b;a.y=.5*e;a.z=.5*d};Pb.prototype.M=function(){var a=new z;var b=this.ta-this.wa;var e=this.ua-this.xa;var d=this.va-this.ya;a.x=.5*b;a.y=.5*e;a.z=.5*d;return a};Pb.prototype.V=function(a){var b=this.ta-this.wa;var e=this.ua- this.xa;var d=this.va-this.ya;a.x=.5*b;a.y=.5*e;a.z=.5*d};Pb.prototype.h=function(a){this.wa=this.waa.ta?this.ta:a.ta;this.ua=this.ua>a.ua?this.ua:a.ua;this.va=this.va>a.va?this.va:a.va;return this};Pb.prototype.i=function(a){var b=new Pb;b.wa=this.waa.ta?this.ta:a.ta;b.ua=this.ua>a.ua?this.ua:a.ua;b.va= this.va>a.va?this.va:a.va;return b};Pb.prototype.Sa=function(a){return this.waa.wa&&this.xaa.xa&&this.yaa.ya:!1};Pb.prototype.W=function(a){var b=new Pb;b.wa=this.wa>a.wa?this.wa:a.wa;b.xa=this.xa>a.xa?this.xa:a.xa;b.ya=this.ya>a.ya?this.ya:a.ya;b.ta=this.taa.wa?this.wa:a.wa;b.xa=this.xa>a.xa?this.xa:a.xa;b.ya=this.ya>a.ya? -this.ya:a.ya;b.ta=this.tae&&(e=-e);0>d&&(d=-d);0>c&&(c=-c);0>f&&(f=-f);0>h&&(h=-h);0>k&&(k=-k);0>g&&(g=-g);0>l&&(l=-l);0>m&&(m=-m);e=e+f+g;d=d+h+l;c=c+k+m;a.wa=b.F-e;a.xa=b.G-d;a.ya=b.H-c;a.ta=b.F+e;a.ua=b.G+d;a.va=b.H+c};cg.prototype.ud=function(a,b){var e,d;var c=d=e=this.fc;ed){if(a<=-k||a>=k)return!1}else{var x=1/d,v=(-k-a)*x;k=(k-a)*x;v>k&&(x=v,v=k,k=x);0k&&(p=k)}if(-1E-6c){if(b<=-g||b>=g)return!1}else v=1/c,k=(-g-b)*v,g=(g-b)*v,k>g&&(v=k,k=g,g=v),0g&&(r=g);if(-1E-6f){if(e<=-l||e>=l)return!1}else k=1/f,g=(-l-e)*k,l=(l-e)*k, -g>l&&(k=g,g=l,l=k),0l&&(t=l);if(1<=m||1<=n||1<=q||0>=p||0>=r||0>=t)return!1;l=m;m=0;n>l&&(l=n,m=1);q>l&&(l=q,m=2);rp||0==l)return!1;switch(m){case 0:h.normal.Ia(0l&&(k=g,g=l,l=k),0l&&(t=l);if(1<=m||1<=n||1<=q||0>=p||0>=r||0>=t)return!1;l=m;m=0;n>l&&(l=n,m=1);q>l&&(l=q,m=2);rp||0==l)return!1;switch(m){case 0:h.normal.Ia(0f&&(f=-f);0>h&&(h=-h);0>k&&(k=-k);f*=this.Qb;h*=this.Qb;k*=this.Qb;e+=f;d+=h;c+=k;a.wa=b.F-e;a.xa=b.G-d;a.ya=b.H-c;a.ta=b.F+e;a.ua=b.G+d;a.va=b.H+c};bg.prototype.ud= function(a,b){0p)return!1;if(0=(-n+p)/m)return!1}else{if(0<=q)return!1;q=0}m=b+(c-b)*q;if(m>-k&&mm?-k:k;var r=a- -0;k=b-g;l=e-0;a=d-a;b=c-b;e=f-e;m=a*a+b*b+e*e;n=r*a+k*b+l*e;q=r*r+k*k+l*l-this.lb*this.lb;p=n*n-m*q;if(0>p)return!1;f=(-n-Math.sqrt(p))/m;if(0>f||1p)return!1;f=(-n-Math.sqrt(p))/m;if(0>f||1n?g:n;h=l>q?l:q;f=m>p?m:p;k>e||(k=e);h>d||(h=d);f>c||(f=c);g=gthis.C*this.C*(e*e+d*d+c*c)?(b.Ia(0,this.Qb-this.fc/this.C,0),0>b.y&&(b.y=0)):(e=a.x,a=a.z,d=e*e+a*a,c=2*this.Qb,c=(c-this.fc)/c*this.lb-this.fc/this.i,0>c&&(c=0),d=0c&&(c=0),b.x=e*d,b.y=-c,b.z=a*d)};ag.prototype.h=function(a,b,e,d,c,f,h){var k=this.Qb;d-=a;c-=b;f-=e;var g=0,l=1;if(-1E-6c){if(b<=-k||b>=k)return!1}else{var m= 1/c,n=(-k-b)*m;m*=k-b;if(n>m){var q=n;n=m;m=q}0m&&(l=m)}if(1<=g||0>=l)return!1;b-=k;q=this.i*this.i;m=q*(d*d+c*c+f*f)-c*c;n=q*(a*d+b*c+e*f)-b*c;q=q*(a*a+b*b+e*e)-b*b;var p=n*n-m*q;if(0!=m){if(0>p)return!1;p=Math.sqrt(p);if(0>m)if(0=n)return!1}else{if(q=(-n-p)/m,n=1,1<=q)return!1}else if(q=(-n-p)/m,n=(-n+p)/m,1<=q||0>=n)return!1}else if(m=-q/(2*n),0=m)return!1}else if(q=m,n=1,1<=m)return!1;b+=k;if(n<=g||l<=q)return!1;if(qd&&(d=l);mc&&(c=m);gf&&(f=g)}h=d-a;k=c-b;l=f-e;this.Ge=h*k*l;a=.25*((a+d)*(a+d)+(b+c)*(b+c)+(e+f)*(e+f));h=h*h*.25;k=k*k*.25;l=l*l*.25;this.af=.3333333333333333*(k+l)+a;this.df=this.cf=this.bf=0;this.ef=.3333333333333333*(l+h)+a;this.hf=this.gf=this.ff=0;this.jf=.3333333333333333*(h+k)+a};Ih.prototype.Yb=function(a,b){var e,d;var c=d=e=this.fc;var f=this.Ja[0];var h=f.x;var k=f.y; -var g=f.z;var l=b.A*h+b.j*k+b.m*g;f=b.o*h+b.v*k+b.s*g;var m=b.u*h+b.l*k+b.B*g;h=l+b.F;k=f+b.G;g=m+b.H;f=h;l=k;m=g;var n=h;var q=k;var p=g;for(var r=1,t=this.Vd;rh||(n=h);q>k||(q=k);p>g||(p=g)}a.wa=f-e;a.xa=l-d;a.ya=m-c;a.ta=n+e;a.ua=q+d;a.va=p+c};Ih.prototype.ud=function(a,b){var e=this.Ja[0];e=e.x*a.x+e.y*a.y+e.z*a.z;for(var d=0, -c=1,f=this.Vd;ce&&(e=k,d=h)}a=this.Ja[d];b.x=a.x;b.y=a.y;b.z=a.z};rl($f,kd);$f.prototype.C=function(){return this.lb};$f.prototype.i=function(){return this.Qb};$f.prototype.Wd=function(){var a=this.lb*this.lb,b=this.Qb*this.Qb*4;this.Ge=3.14159265358979*a*this.Qb*2;this.af=.08333333333333333*(3*a+b);this.df=this.cf=this.bf=0;this.ef=.5*a;this.hf=this.gf=this.ff=0;this.jf=.08333333333333333*(3*a+b)};$f.prototype.Yb=function(a,b){var e=b.j;var d= +h.normal.Ia(0,0d&&(d=l);mc&&(c=m);gf&&(f=g)}h=d-a;k=c-b;l=f-e;this.Ge=h*k*l;a=.25*((a+d)*(a+d)+(b+c)*(b+c)+(e+f)*(e+f));h=h*h*.25;k=k*k*.25;l=l*l*.25;this.af=.3333333333333333*(k+l)+a;this.df=this.cf=this.bf=0;this.ef=.3333333333333333*(l+h)+a;this.hf=this.gf=this.ff=0;this.jf=.3333333333333333*(h+k)+a};Mh.prototype.Yb=function(a,b){var e,d;var c=d=e=this.fc;var f=this.Ja[0];var h=f.x;var k=f.y; +var g=f.z;var l=b.A*h+b.j*k+b.m*g;f=b.o*h+b.v*k+b.s*g;var m=b.u*h+b.l*k+b.B*g;h=l+b.F;k=f+b.G;g=m+b.H;f=h;l=k;m=g;var n=h;var q=k;var p=g;for(var r=1,t=this.Vd;rh||(n=h);q>k||(q=k);p>g||(p=g)}a.wa=f-e;a.xa=l-d;a.ya=m-c;a.ta=n+e;a.ua=q+d;a.va=p+c};Mh.prototype.ud=function(a,b){var e=this.Ja[0];e=e.x*a.x+e.y*a.y+e.z*a.z;for(var d=0, +c=1,f=this.Vd;ce&&(e=k,d=h)}a=this.Ja[d];b.x=a.x;b.y=a.y;b.z=a.z};rl($f,md);$f.prototype.C=function(){return this.lb};$f.prototype.i=function(){return this.Qb};$f.prototype.Wd=function(){var a=this.lb*this.lb,b=this.Qb*this.Qb*4;this.Ge=3.14159265358979*a*this.Qb*2;this.af=.08333333333333333*(3*a+b);this.df=this.cf=this.bf=0;this.ef=.5*a;this.hf=this.gf=this.ff=0;this.jf=.08333333333333333*(3*a+b)};$f.prototype.Yb=function(a,b){var e=b.j;var d= b.v;var c=b.l;0>e&&(e=-e);0>d&&(d=-d);0>c&&(c=-c);var f=Math.sqrt(1-e*e);var h=Math.sqrt(1-d*d);var k=Math.sqrt(1-c*c);f*=this.lb;h*=this.lb;k*=this.lb;e*=this.Qb;d*=this.Qb;c*=this.Qb;f+=e;h+=d;k+=c;a.wa=b.F-f;a.xa=b.G-h;a.ya=b.H-k;a.ta=b.F+f;a.ua=b.G+h;a.va=b.H+k};$f.prototype.ud=function(a,b){var e=a.x,d=a.z,c=e*e+d*d,f=this.lb-this.fc;0>f&&(f=0);c=0f&&(f=0);b.x=e*c;b.y=0c){if(b<=-k||b>=k)return!1}else{var m=1/c,n=(-k-b)*m;k=(k-b)*m;n>k&&(m=n,n=k,k=m);0k&&(l=k)}if(1<=g||0>=l)return!1;k=d*d+f*f;n=a*d+e*f;m=a*a+e*e-this.lb*this.lb;var q=n*n-k*m;if(0>q)return!1;if(0=k)return!1}else{if(0<=m)return!1;m=0;k=1}if(k<=g||l<=m)return!1;if(ml)return!1;f=(-g-Math.sqrt(l))/f;if(0>f||1a&&(a=this.points[d].depth)}return a}; -bj.prototype.clear=function(){for(var a=this.numPoints=0,b=this.points;aob&&(ob=-ob);0>Za&&(Za=-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ab,c/=c-f,f=this.h[this.C++],f.x=d.x+(e.x-d.x)*c,f.y=d.y+(e.y-d.y)*c,f.Za=d.Za+(e.Za-d.Za)*c,f.$a=d.$a+(e.$a-d.$a)*c,f.ab=d.ab+(e.ab-d.ab)*c):0>=c&&0=f?(h=this.h[this.C++],h.x=d.x,h.y=d.y,h.Za=d.Za,h.$a=d.$a,h.ab=d.ab,c/=c-f,f=this.h[this.C++],f.x=d.x+(e.x-d.x)*c,f.y=d.y+(e.y-d.y)*c,f.Za=d.Za+(e.Za-d.Za)*c,f.$a=d.$a+(e.$a-d.$a)*c,f.ab=d.ab+(e.ab-d.ab)*c):0>=c&&0this.I)){for(var a=-Infinity,b=Infinity,e=-Infinity,d=Infinity,c=null,f=null,h=null,k=null,g=0,l=this.I;ga&&(a=q,c=n),qe&&(e=p,h=n),pH?0:H>B?1:H/B):0==B?(q=0,n=0>l?0:l>C?1:l/C):(q=C*B-N*N,0==q?n=0:(n=N*H+B*l,n=0>n?0:n>q?1:n/q),q=n*N+H,0>q?(q=0,n=0>l?0:l>C?1:l/C):q>B?(q=1,n=N+l,n=0>n?0:n>C?1:n/C):q/=B);p+=f*n;r+=x*n;t+=c*n;h+=m*q;k+=v*q;d+=g*q;x=p-h;f=r-k;q=t-d;n=x*x+f*f+q*q;n>=(b+e)*(b+e)||(n=Math.sqrt(n),0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.j+this.o)*f,d=(this.m+this.u)*f,c=(this.l-this.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)* -f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.j+this.o)*f,d=(this.s+this.l)*f,c=(this.m-this.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f);a.x=b;a.y=e;a.z=d;a.w=c;return a};Ob.prototype.i=function(a){var b=this.A;var e=this.v;var d=this.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.j+this.o)*f,d=(this.m+this.u)* -f,c=(this.l-this.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.j+this.o)*f,d=(this.s+this.l)*f,c=(this.m-this.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f);a.x=b;a.y=e;a.z=d;a.w=c};Ob.prototype.qa=function(a){var b=a.x;var e=a.y;var d=a.z;var c=a.w,f=2*b,h=2*e,k=2*d;a=b*f;var g=e*h;d*=k;var l=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;this.A=1-g-d;this.j= -l-c;this.m=b+h;this.o=l+c;this.v=1-a-d;this.s=e-f;this.u=b-h;this.l=e+f;this.B=1-a-g;return this};Ob.prototype.clone=function(){var a=new Ob;a.F=this.F;a.G=this.G;a.H=this.H;a.A=this.A;a.j=this.j;a.m=this.m;a.o=this.o;a.v=this.v;a.s=this.s;a.u=this.u;a.l=this.l;a.B=this.B;return a};Ob.prototype.Dd=function(a){this.F=a.F;this.G=a.G;this.H=a.H;this.A=a.A;this.j=a.j;this.m=a.m;this.o=a.o;this.v=a.v;this.s=a.s;this.u=a.u;this.l=a.l;this.B=a.B;return this};yc.prototype.Oa=function(a,b,e,d,c,f){this.Ma= -a;this.Sa=b;this.I=e;this.M=d;var h=this.i,k=this.mb,g=this.sb,l=this.aa,m=this.C;null!=c?(null==c.og&&(c.og=new el),this.Va(c.og)):m.$();if(0==m.x*m.x+m.y*m.y+m.z*m.z){var n=d.F-e.F;var q=d.G-e.G;var p=d.H-e.H;m.x=n;m.y=q;m.z=p;1E-6>m.x*m.x+m.y*m.y+m.z*m.z&&m.Ia(1,0,0)}this.h=0;this.V(!1);this.W(!1);var r=this.i[this.h],t=this.mb[this.h];r.x=t.x;r.y=t.y;r.z=t.z;var x=this.sb[this.h];r.x-=x.x;r.y-=x.y;r.z-=x.z;this.h=1;for(var v=0;40>v;){var B=0;switch(this.h){case 1:var H=h[0];l.x=H.x;l.y=H.y;l.z= -H.z;B=1;break;case 2:var C=void 0,N=void 0,y=void 0,A=void 0,E=void 0,L=void 0,G=h[0];C=G.x;N=G.y;y=G.z;var P=h[1];A=P.x;E=P.y;L=P.z;var K=void 0,pa=void 0,M=void 0;K=A-C;pa=E-N;M=L-y;var Sa=K*C+pa*N+M*y;Sa=-Sa/(K*K+pa*pa+M*M);if(0>Sa)l.x=C,l.y=N,l.z=y,B=1;else if(1O*ba+ma*Fa+Y*ka){var Z=void 0,oa=void 0,xb=void 0,hb=void 0,fb=void 0,gb=void 0;Z=wa.x;oa=wa.y;xb=wa.z;hb=La.x;fb=La.y;gb=La.z;var pb=void 0,ab=void 0,$a=void 0;pb=hb-Z;ab=fb-oa;$a=gb-xb;var ua=pb*Z+ab*oa+$a*xb;ua=-ua/(pb*pb+ab*ab+$a*$a);var Ya=void 0;if(0>ua)l.x=Z,l.y=oa,l.z=xb,Ya=1;else if(1ta*Qa+Va*Ka+D*V){var Wa=void 0,Cb=void 0,qb=void 0,bb=void 0,ib=void 0,rb=void 0;Wa=La.x;Cb=La.y;qb=La.z;bb=Ea.x;ib=Ea.y;rb=Ea.z;var db=void 0,Db=void 0,jb=void 0;db=bb-Wa;Db=ib-Cb;jb=rb-qb;var nb=db*Wa+Db*Cb+jb*qb;nb=-nb/(db*db+Db*Db+jb*jb);var cb=void 0;if(0>nb)l.x=Wa,l.y=Cb,l.z=qb,cb=1;else if(1ha||ubAa*ob+aa*Za+Ua*W){var lb=void 0,yb=void 0,vb=void 0,eb=void 0,Lb=void 0,mb=void 0;lb=wa.x;yb=wa.y;vb=wa.z;eb=Ea.x;Lb=Ea.y;mb=Ea.z;var zb=void 0,u=void 0,T=void 0;zb=eb-lb;u=Lb-yb;T=mb-vb;var R=zb*lb+u*yb+T*vb;R=-R/(zb*zb+u*u+T*T);var va=void 0;if(0>R)l.x=lb,l.y=yb,l.z=vb,va=1;else if(1ha||kb(Q*gc+Ma*Vb+Ia*lc)*Wc){var Sc=void 0,pd=void 0,Gd=void 0,Tc=void 0,Pd=void 0,je=void 0,De=void 0,Kd=void 0,Xc=void 0,be=void 0,ue=void 0,Ee=void 0,ve=void 0,qd=void 0,ce=void 0,we=void 0,ke=void 0,le=void 0;Sc=Ba.x;pd=Ba.y;Gd=Ba.z;Tc=Ta.x;Pd=Ta.y;je=Ta.z;De=sa.x;Kd=sa.y;Xc=sa.z;be=Tc-Sc;ue=Pd- -pd;Ee=je-Gd;ve=De-Tc;qd=Kd-Pd;ce=Xc-je;we=Sc-De;ke=pd-Kd;le=Gd-Xc;var Fc=void 0,gd=void 0,hd=void 0;Fc=ue*ce-Ee*qd;gd=Ee*ve-be*ce;hd=be*qd-ue*ve;var Ad=void 0,Yc=void 0,Mc=void 0,ug=void 0,vg=void 0,lh=void 0,Me=void 0,uf=void 0,vf=void 0;Ad=ue*hd-Ee*gd;Yc=Ee*Fc-be*hd;Mc=be*gd-ue*Fc;ug=qd*hd-ce*gd;vg=ce*Fc-ve*hd;lh=ve*gd-qd*Fc;Me=ke*hd-le*gd;uf=le*Fc-we*hd;vf=we*gd-ke*Fc;var Fe=-1,Ic=void 0,Jc=void 0,oc=void 0,xe=0;oc=Jc=Ic=0;if(0>Sc*Ad+pd*Yc+Gd*Mc){var me=void 0,Qd=void 0,Rd=void 0,ye=void 0,dg= -void 0,Uc=void 0;me=Ba.x;Qd=Ba.y;Rd=Ba.z;ye=Ta.x;dg=Ta.y;Uc=Ta.z;var Vc=void 0,Nc=void 0,wf=void 0;Vc=ye-me;Nc=dg-Qd;wf=Uc-Rd;var Vd=Vc*me+Nc*Qd+wf*Rd;Vd=-Vd/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c*id-xc*Ac;var Ld=void 0,vd=void 0,wd=void 0,Of=void 0,Lh=void 0,Mh=void 0,Nh=void 0,mh=void 0,$g=void 0;Ld=xc*td-Hc*Td;vd=Hc*Ed-Gc*td;wd=Gc*Td-xc*Ed;Of=id*td-Oc*Td;Lh=Oc*Ed-Ac*td;Mh=Ac*Td-id*Ed;Nh=Ie*td-Nf*Td;mh=Nf*Ed-ad*td;$g=ad*Td-Ie*Ed;var Be=-1,Je=void 0,Ce=void 0,Id=void 0,fe=0;Id=Ce=Je=0;if(0>Af*Ld+ld*vd+Sd*wd){var pe=void 0, -qe=void 0,Re=void 0,Ud=void 0,Se=void 0,Pf=void 0;pe=Ba.x;qe=Ba.y;Re=Ba.z;Ud=sa.x;Se=sa.y;Pf=sa.z;var Qf=void 0,nh=void 0,ah=void 0;Qf=Ud-pe;nh=Se-qe;ah=Pf-Re;var gf=Qf*pe+nh*qe+ah*Re;gf=-gf/(Qf*Qf+nh*nh+ah*ah);var hf=void 0;if(0>gf)l.x=pe,l.y=qe,l.z=Re,hf=1;else if(1ud*Of+rd*Lh+sd*Mh){var xg=void 0,yg=void 0, -ch=void 0,zg=void 0,Ag=void 0,Bg=void 0;xg=sa.x;yg=sa.y;ch=sa.z;zg=Ga.x;Ag=Ga.y;Bg=Ga.z;var Cg=void 0,Dg=void 0,gg=void 0;Cg=zg-xg;Dg=Ag-yg;gg=Bg-ch;var Te=Cg*xg+Dg*yg+gg*ch;Te=-Te/(Cg*Cg+Dg*Dg+gg*gg);var Rf=void 0;if(0>Te)l.x=xg,l.y=yg,l.z=ch,Rf=1;else if(1Be||cjmd*Nh+Zc*mh+$c*$g){var oh= -void 0,ph=void 0,ge=void 0,Zd=void 0,$d=void 0,qh=void 0;oh=Ba.x;ph=Ba.y;ge=Ba.z;Zd=Ga.x;$d=Ga.y;qh=Ga.z;var rh=void 0,sh=void 0,th=void 0;rh=Zd-oh;sh=$d-ph;th=qh-ge;var Tf=rh*oh+sh*ph+th*ge;Tf=-Tf/(rh*rh+sh*sh+th*th);var Fg=void 0;if(0>Tf)l.x=oh,l.y=ph,l.z=ge,Fg=1;else if(1Be||hgDc||ig(Q*zc+Ma*Cc+Ia*sc)*Wc){var kf=void 0,Bf=void 0,Hg=void 0,Ig=void 0,Jg=void 0,Kg=void 0,jg=void 0,kg=void 0,lg=void 0,Ue=void 0,mg=void 0,fh=void 0,Lg=void 0,Mg=void 0,Cf=void 0,ng=void 0, -og=void 0,gh=void 0;kf=Ba.x;Bf=Ba.y;Hg=Ba.z;Ig=Ta.x;Jg=Ta.y;Kg=Ta.z;jg=Ga.x;kg=Ga.y;lg=Ga.z;Ue=Ig-kf;mg=Jg-Bf;fh=Kg-Hg;Lg=jg-Ig;Mg=kg-Jg;Cf=lg-Kg;ng=kf-jg;og=Bf-kg;gh=Hg-lg;var re=void 0,se=void 0,ae=void 0;re=mg*Cf-fh*Mg;se=fh*Lg-Ue*Cf;ae=Ue*Mg-mg*Lg;var he=void 0,ie=void 0,Md=void 0,ji=void 0,Dj=void 0,Ej=void 0,Fj=void 0,dj=void 0,Qh=void 0;he=mg*ae-fh*se;ie=fh*re-Ue*ae;Md=Ue*se-mg*re;ji=Mg*ae-Cf*se;Dj=Cf*re-Lg*ae;Ej=Lg*se-Mg*re;Fj=og*ae-gh*se;dj=gh*re-ng*ae;Qh=ng*se-og*re;var Df=-1,Vf=void 0, -Ng=void 0,Ke=void 0,Wf=0;Ke=Ng=Vf=0;if(0>kf*he+Bf*ie+Hg*Md){var Ve=void 0,We=void 0,Xf=void 0,lf=void 0,pg=void 0,uh=void 0;Ve=Ba.x;We=Ba.y;Xf=Ba.z;lf=Ta.x;pg=Ta.y;uh=Ta.z;var vh=void 0,wh=void 0,hh=void 0;vh=lf-Ve;wh=pg-We;hh=uh-Xf;var Ef=vh*Ve+wh*We+hh*Xf;Ef=-Ef/(vh*vh+wh*wh+hh*hh);var mf=void 0;if(0>Ef)l.x=Ve,l.y=We,l.z=Xf,mf=1;else if(1Ig*ji+Jg*Dj+Kg*Ej){var ej=void 0,fj=void 0,gj=void 0,ki=void 0,li=void 0,mi=void 0;ej=Ta.x;fj=Ta.y;gj=Ta.z;ki=Ga.x;li=Ga.y;mi=Ga.z;var ni=void 0,oi=void 0,pi=void 0;ni=ki-ej;oi=li-fj;pi=mi-gj;var Pg=ni*ej+oi*fj+pi*gj;Pg=-Pg/(ni*ni+oi*oi+pi*pi);var Rh=void 0;if(0>Pg)l.x=ej,l.y=fj,l.z=gj,Rh=1;else if(1Df|| -fkjg*Fj+kg*dj+lg*Qh){var ij=void 0,jj=void 0,kj=void 0,qi=void 0,ri=void 0,si=void 0;ij=Ba.x;jj=Ba.y;kj=Ba.z;qi=Ga.x;ri=Ga.y;si=Ga.z;var ti=void 0,ui=void 0,vi=void 0;ti=qi-ij;ui=ri-jj;vi=si-kj;var Qg=ti*ij+ui*jj+vi*kj;Qg=-Qg/(ti*ti+ui*ui+vi*vi);var xh=void 0;if(0>Qg)l.x=ij,l.y=jj,l.z=kj,xh=1;else if(1Df||gkDc||Jj(Eb*Lc+wb*zd+Mb*Rc)*Wc){var ih=void 0,yh=void 0,oj=void 0,Uh=void 0,Vh=void 0,Wh=void 0,xi=void 0,yi=void 0, -zi=void 0,Xh=void 0,Yh=void 0,Zh=void 0,zh=void 0,Ah=void 0,Bh=void 0,Ai=void 0,Bi=void 0,Ci=void 0;ih=Ta.x;yh=Ta.y;oj=Ta.z;Uh=sa.x;Vh=sa.y;Wh=sa.z;xi=Ga.x;yi=Ga.y;zi=Ga.z;Xh=Uh-ih;Yh=Vh-yh;Zh=Wh-oj;zh=xi-Uh;Ah=yi-Vh;Bh=zi-Wh;Ai=ih-xi;Bi=yh-yi;Ci=oj-zi;var Xe=void 0,Ye=void 0,Ze=void 0;Xe=Yh*Bh-Zh*Ah;Ye=Zh*zh-Xh*Bh;Ze=Xh*Ah-Yh*zh;var nf=void 0,of=void 0,pf=void 0,hk=void 0,ik=void 0,jk=void 0,kk=void 0,lk=void 0,mk=void 0;nf=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ui);var Dh=void 0;if(0>Vg)l.x=uj,l.y=vj,l.z=wj,Dh=1;else if(1Ch||okDc||Ojl.x*l.x+l.y*l.y+l.z*l.z){if(!f)return this.distance=0;switch(this.h){case 1:this.Xa();break;case 2:this.Wa();break;case 3:this.Ya()}if(4==this.h){var Wi=this.Sb(h,k,g);if(0!=Wi)return this.distance=0,Wi;this.distance=-this.depth;return 0}this.distance=0;return 1}this.Pb(B);m.x=l.x;m.y=l.y;m.z=l.z;m.x=-m.x;m.y=-m.y;m.z=-m.z;this.V(!1);this.W(!1);var Yf=this.i[this.h],Pj=this.mb[this.h];Yf.x=Pj.x;Yf.y=Pj.y;Yf.z=Pj.z;var Le=this.sb[this.h];Yf.x-=Le.x;Yf.y-=Le.y;Yf.z-=Le.z;if(1E-8>m.x*m.x+ -m.y*m.y+m.z*m.z)throw Error("!?");var hi=h[this.h];if(1E-8>hi.x*m.x+hi.y*m.y+hi.z*m.z-(l.x*m.x+l.y*m.y+l.z*m.z))return this.Ib(),this.distance=Math.sqrt(l.x*l.x+l.y*l.y+l.z*l.z),null!=c&&null!=c.og&&this.Gb(c.og),0;this.h++;++v}return 2};yc.prototype.ob=function(a,b,e,d,c,f,h){this.Ma=a;this.Sa=b;this.I=e;this.M=d;var k=this.i,g=this.aa,l=this.C;var m=d.F-e.F;var n=d.G-e.G;var q=d.H-e.H;l.x=m;l.y=n;l.z=q;1E-6>l.x*l.x+l.y*l.y+l.z*l.z&&l.Ia(1,0,0);this.h=0;if(null!=this.Ma)this.V(!0);else{var p=this.mb[this.h]; -p.x=this.I.F;p.y=this.I.G;p.z=this.I.H}this.W(!0);var r=this.i[this.h],t=this.mb[this.h];r.x=t.x;r.y=t.y;r.z=t.z;var x=this.sb[this.h];r.x-=x.x;r.y-=x.y;r.z-=x.z;this.h=1;var v=0,B=0,H=this.Fb,C=this.tb;H.$();C.x=f.x;C.y=f.y;C.z=f.z;C.x-=c.x;C.y-=c.y;for(C.z-=c.z;40>v;){var N=0;switch(this.h){case 1:var y=k[0];g.x=y.x;g.y=y.y;g.z=y.z;N=1;break;case 2:var A=void 0,E=void 0,L=void 0,G=void 0,P=void 0,K=void 0,pa=k[0];A=pa.x;E=pa.y;L=pa.z;var M=k[1];G=M.x;P=M.y;K=M.z;var Sa=void 0,Pa=void 0,Ca=void 0; -Sa=G-A;Pa=P-E;Ca=K-L;var Ra=Sa*A+Pa*E+Ca*L;Ra=-Ra/(Sa*Sa+Pa*Pa+Ca*Ca);if(0>Ra)g.x=A,g.y=E,g.z=L,N=1;else if(1ta*Qa+Va*Ka+D*V){var hb=void 0,fb=void 0,gb=void 0,pb=void 0,ab=void 0, -$a=void 0;hb=O.x;fb=O.y;gb=O.z;pb=ma.x;ab=ma.y;$a=ma.z;var ua=void 0,Ya=void 0,Fb=void 0;ua=pb-hb;Ya=ab-fb;Fb=$a-gb;var Xa=ua*hb+Ya*fb+Fb*gb;Xa=-Xa/(ua*ua+Ya*Ya+Fb*Fb);var Bb=void 0;if(0>Xa)g.x=hb,g.y=fb,g.z=gb,Bb=1;else if(1Aa*ob+aa*Za+Ua*W){var bb=void 0,ib=void 0,rb=void 0,db=void 0,Db=void 0,jb=void 0;bb=ma.x; -ib=ma.y;rb=ma.z;db=Y.x;Db=Y.y;jb=Y.z;var nb=void 0,cb=void 0,Jb=void 0;nb=db-bb;cb=Db-ib;Jb=jb-rb;var Kb=nb*bb+cb*ib+Jb*rb;Kb=-Kb/(nb*nb+cb*cb+Jb*Jb);var F=void 0;if(0>Kb)g.x=bb,g.y=ib,g.z=rb,F=1;else if(1ca||vbxa*ha+Ja*I+S*na){var eb=void 0,Lb=void 0,mb=void 0,zb=void 0,u=void 0,T=void 0;eb= -O.x;Lb=O.y;mb=O.z;zb=Y.x;u=Y.y;T=Y.z;var R=void 0,va=void 0,Na=void 0;R=zb-eb;va=u-Lb;Na=T-mb;var ya=R*eb+va*Lb+Na*mb;ya=-ya/(R*R+va*va+Na*Na);var Oa=void 0;if(0>ya)g.x=eb,g.y=Lb,g.z=mb,Oa=1;else if(1ca||Ba(Eb*ed+wb*Bc+Mb*Kc)*od){var Tc=void 0,Pd=void 0,je=void 0,De=void 0,Kd=void 0,Xc=void 0,be=void 0,ue=void 0,Ee=void 0,ve=void 0,qd=void 0,ce=void 0,we=void 0,ke=void 0,le=void 0,Fc=void 0,gd=void 0,hd=void 0;Tc=Ga.x;Pd=Ga.y;je=Ga.z;De=Q.x;Kd=Q.y;Xc=Q.z;be=Ma.x;ue=Ma.y;Ee=Ma.z;ve=De-Tc;qd=Kd-Pd;ce=Xc-je;we=be-De;ke=ue-Kd;le=Ee-Xc;Fc=Tc-be;gd=Pd-ue;hd=je-Ee;var Ad=void 0,Yc=void 0,Mc=void 0;Ad=qd*le-ce*ke;Yc=ce*we-ve*le;Mc=ve*ke-qd*we;var ug=void 0, -vg=void 0,lh=void 0,Me=void 0,uf=void 0,vf=void 0,Fe=void 0,Ic=void 0,Jc=void 0;ug=qd*Mc-ce*Yc;vg=ce*Ad-ve*Mc;lh=ve*Yc-qd*Ad;Me=ke*Mc-le*Yc;uf=le*Ad-we*Mc;vf=we*Yc-ke*Ad;Fe=gd*Mc-hd*Yc;Ic=hd*Ad-Fc*Mc;Jc=Fc*Yc-gd*Ad;var oc=-1,xe=void 0,me=void 0,Qd=void 0,Rd=0;Qd=me=xe=0;if(0>Tc*ug+Pd*vg+je*lh){var ye=void 0,dg=void 0,Uc=void 0,Vc=void 0,Nc=void 0,wf=void 0;ye=Ga.x;dg=Ga.y;Uc=Ga.z;Vc=Q.x;Nc=Q.y;wf=Q.z;var Vd=void 0,Ge=void 0,eg=void 0;Vd=Vc-ye;Ge=Nc-dg;eg=wf-Uc;var Ne=Vd*ye+Ge*dg+eg*Uc;Ne=-Ne/(Vd* -Vd+Ge*Ge+eg*eg);var bf=void 0;if(0>Ne)g.x=ye,g.y=dg,g.z=Uc,bf=1;else if(1De*Me+Kd*uf+Xc*vf){var cf=void 0,df=void 0,Kf=void 0,Lf=void 0,yf=void 0,zf=void 0;c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){var Ig=void 0,Jg=void 0,Kg=void 0,jg=void 0,kg=void 0,lg=void 0,Ue=void 0,mg=void 0,fh=void 0,Lg=void 0,Mg=void 0,Cf=void 0,ng=void 0,og=void 0,gh=void 0,re=void 0,se=void 0,ae=void 0;Ig=Ga.x;Jg=Ga.y;Kg=Ga.z;jg=Q.x;kg=Q.y;lg=Q.z;Ue=Ia.x;mg=Ia.y;fh=Ia.z;Lg=jg-Ig;Mg=kg-Jg;Cf=lg-Kg;ng=Ue-jg;og=mg-kg;gh=fh-lg;re=Ig-Ue;se=Jg-mg;ae= -Kg-fh;var he=void 0,ie=void 0,Md=void 0;he=Mg*gh-Cf*og;ie=Cf*ng-Lg*gh;Md=Lg*og-Mg*ng;var ji=void 0,Dj=void 0,Ej=void 0,Fj=void 0,dj=void 0,Qh=void 0,Df=void 0,Vf=void 0,Ng=void 0;ji=Mg*Md-Cf*ie;Dj=Cf*he-Lg*Md;Ej=Lg*ie-Mg*he;Fj=og*Md-gh*ie;dj=gh*he-ng*Md;Qh=ng*ie-og*he;Df=se*Md-ae*ie;Vf=ae*he-re*Md;Ng=re*ie-se*he;var Ke=-1,Wf=void 0,Ve=void 0,We=void 0,Xf=0;We=Ve=Wf=0;if(0>Ig*ji+Jg*Dj+Kg*Ej){var lf=void 0,pg=void 0,uh=void 0,vh=void 0,wh=void 0,hh=void 0;lf=Ga.x;pg=Ga.y;uh=Ga.z;vh=Q.x;wh=Q.y;hh=Q.z; -var Ef=void 0,mf=void 0,qg=void 0;Ef=vh-lf;mf=wh-pg;qg=hh-uh;var Og=Ef*lf+mf*pg+qg*uh;Og=-Og/(Ef*Ef+mf*mf+qg*qg);var Gj=void 0;if(0>Og)g.x=lf,g.y=pg,g.z=uh,Gj=1;else if(1jg*Fj+kg*dj+lg*Qh){var ki=void 0,li=void 0,mi=void 0,ni=void 0,oi=void 0,pi=void 0;ki=Q.x;li=Q.y;mi=Q.z;ni=Ia.x;oi=Ia.y;pi=Ia.z;var Pg=void 0, -Rh=void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normal;Le.x=l.x;Le.y=l.y;Le.z=l.z;var hi=Math.sqrt(Le.x*Le.x+Le.y*Le.y+Le.z* -Le.z);0 -l.x*l.x+l.y*l.y+l.z*l.z)throw Error("!?");var Qk=k[this.h],jl=Qk.x*l.x+Qk.y*l.y+Qk.z*l.z;if(0>jl){if(0<=C.x*l.x+C.y*l.y+C.z*l.z)break;var pk=jl/(C.x*l.x+C.y*l.y+C.z*l.z);B+=pk;if(1<=B)break;H.x+=C.x*pk;H.y+=C.y*pk;H.z+=C.z*pk;for(var kl=0,yl=this.h+1;klnl*nl+ol*ol+pl*pl){ll=!0;break}}ll||this.h++;++v}return!1}; -yc.prototype.Ib=function(){switch(this.h){case 1:var a=this.closestPoint1,b=this.mb[0];a.x=b.x;a.y=b.y;a.z=b.z;var e=this.closestPoint2,d=this.sb[0];e.x=d.x;e.y=d.y;e.z=d.z;break;case 2:var c=this.aa;var f=c.x;var h=c.y;var k=c.z;var g=this.i[0];var l=g.x;var m=g.y;var n=g.z;var q=this.mb[0];var p=q.x;var r=q.y;var t=q.z;var x=this.sb[0];var v=x.x;var B=x.y;var H=x.z;var C=this.i[1];var N=C.x;var y=C.y;var A=C.z;var E=this.mb[1];var L=E.x;var G=E.y;var P=E.z;var K=this.sb[1];var pa=K.x;var M=K.y; -var Sa=K.z;var Pa=N-l;var Ca=y-m;var Ra=A-n;var wa=Pa*Pa+Ca*Ca+Ra*Ra;0!=wa&&(wa=1/wa);var La=((f-l)*Pa+(h-m)*Ca+(k-n)*Ra)*wa;var Ea=L-p;var O=G-r;var ma=P-t;var Y=p+Ea*La;var ta=r+O*La;var Va=t+ma*La;Ea=pa-v;O=M-B;ma=Sa-H;var D=v+Ea*La;var Aa=B+O*La;var aa=H+ma*La;var Ua=this.closestPoint1;Ua.x=Y;Ua.y=ta;Ua.z=Va;var xa=this.closestPoint2;xa.x=D;xa.y=Aa;xa.z=aa;break;case 3:var Ja=this.aa;var S=Ja.x;var la=Ja.y;var qa=Ja.z;var Da=this.i[0];var X=Da.x;var fa=Da.y;var w=Da.z;var ja=this.mb[0];var ea= -ja.x;var U=ja.y;var ba=ja.z;var Fa=this.sb[0];var ka=Fa.x;var Qa=Fa.y;var Ka=Fa.z;var V=this.i[1];var ob=V.x;var Za=V.y;var W=V.z;var ha=this.mb[1];var I=ha.x;var na=ha.y;var ca=ha.z;var da=this.sb[1];var Z=da.x;var oa=da.y;var xb=da.z;var hb=this.i[2];var fb=hb.x;var gb=hb.y;var pb=hb.z;var ab=this.mb[2];var $a=ab.x;var ua=ab.y;var Ya=ab.z;var Fb=this.sb[2];var Xa=Fb.x;var Bb=Fb.y;var Wa=Fb.z;var Cb=ob-X;var qb=Za-fa;var bb=W-w;var ib=fb-X;var rb=gb-fa;var db=pb-w;var Db=S-X;var jb=la-fa;var nb= -qa-w;var cb=Cb*Cb+qb*qb+bb*bb,Jb=Cb*ib+qb*rb+bb*db,Kb=ib*ib+rb*rb+db*db,F=Cb*Db+qb*jb+bb*nb,ub=ib*Db+rb*jb+db*nb,lb=cb*Kb-Jb*Jb;0!=lb&&(lb=1/lb);var yb=(F*Kb-ub*Jb)*lb,vb=(-F*Jb+ub*cb)*lb;var eb=I-ea;var Lb=na-U;var mb=ca-ba;var zb=ea+eb*yb;var u=U+Lb*yb;var T=ba+mb*yb;eb=$a-ea;Lb=ua-U;mb=Ya-ba;zb+=eb*vb;u+=Lb*vb;T+=mb*vb;eb=Z-ka;Lb=oa-Qa;mb=xb-Ka;var R=ka+eb*yb;var va=Qa+Lb*yb;var Na=Ka+mb*yb;eb=Xa-ka;Lb=Bb-Qa;mb=Wa-Ka;R+=eb*vb;va+=Lb*vb;Na+=mb*vb;var ya=this.closestPoint1;ya.x=zb;ya.y=u;ya.z=T; -var Oa=this.closestPoint2;Oa.x=R;Oa.y=va;Oa.z=Na;break;default:throw Error("!?");}};yc.prototype.Va=function(a){var b=this.C;a=a.vi;b.x=a.x;b.y=a.y;b.z=a.z};yc.prototype.Gb=function(a){a=a.vi;var b=this.aa;a.x=b.x;a.y=b.y;a.z=b.z;a.x=-a.x;a.y=-a.y;a.z=-a.z};yc.prototype.Pb=function(a){this.h=a;this.h=(this.h&5)+(this.h>>1&5);this.h=(this.h&3)+(this.h>>2&3);switch(a){case 2:a=this.i[0];var b=this.i[1];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[1];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[1]; -a.x=b.x;a.y=b.y;a.z=b.z;break;case 4:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;break;case 5:a=this.i[1];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;break;case 6:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[2];a.x=b.x;a.y=b.y;a.z= -b.z;break;case 8:a=this.i[0];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 9:a=this.i[1];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 10:a=this.i[0];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 11:a= -this.i[2];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[2];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[2];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 12:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.i[1];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 13:a=this.i[1];b=this.i[3];a.x=b.x; -a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 14:a=this.i[0],b=this.i[3],a.x=b.x,a.y=b.y,a.z=b.z,a=this.mb[0],b=this.mb[3],a.x=b.x,a.y=b.y,a.z=b.z,a=this.sb[0],b=this.sb[3],a.x=b.x,a.y=b.y,a.z=b.z}};yc.prototype.V=function(a){var b=this.C;var e=b.x;var d=b.y;b=b.z;var c=this.I.A*e+this.I.o*d+this.I.u*b;var f=this.I.j*e+this.I.v*d+this.I.l*b;var h=this.I.m*e+this.I.s*d+this.I.B*b;var k=this.C;k.x=c;k.y=f;k.z=h;this.Ma.ud(this.C, -this.mb[this.h]);a&&(a=this.C,h=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z),0a;){var b=this.C,e=this.qa[a++];b.x=e.x;b.y=e.y;b.z=e.z;this.V(!1);this.W(!1);b=this.i[this.h];e=this.mb[this.h];b.x=e.x;b.y=e.y;b.z=e.z;e=this.sb[this.h];b.x-=e.x;b.y-=e.y;b.z-=e.z;this.h++;this.Wa();if(4==this.h)break;this.h--;b=this.C;b.x=-b.x;b.y=-b.y;b.z=-b.z;this.V(!1);this.W(!1);b=this.i[this.h];e=this.mb[this.h];b.x=e.x;b.y=e.y;b.z=e.z;e=this.sb[this.h];b.x-=e.x;b.y-=e.y;b.z-=e.z;this.h++;this.Wa();if(4== -this.h)break;this.h--}};yc.prototype.Wa=function(){var a=this.C;var b=a.x;var e=a.y;a=a.z;var d=this.i[0];var c=d.x;var f=d.y;d=d.z;var h=this.i[1];var k=h.x;var g=h.y;h=h.z;c-=k;f-=g;d-=h;for(g=0;3>g;){h=this.qa[g++];k=h.x;var l=h.y;var m=h.z;h=f*m-d*l;m=d*k-c*m;k=c*l-f*k;l=this.C;l.x=h;l.y=m;l.z=k;this.V(!1);this.W(!1);h=this.i[this.h];k=this.mb[this.h];h.x=k.x;h.y=k.y;h.z=k.z;k=this.sb[this.h];h.x-=k.x;h.y-=k.y;h.z-=k.z;this.h++;this.Ya();if(4==this.h)break;this.h--;h=this.C;h.x=-h.x;h.y=-h.y; -h.z=-h.z;this.V(!1);this.W(!1);h=this.i[this.h];k=this.mb[this.h];h.x=k.x;h.y=k.y;h.z=k.z;k=this.sb[this.h];h.x-=k.x;h.y-=k.y;h.z-=k.z;this.h++;this.Ya();if(4==this.h)break;this.h--}c=this.C;c.x=b;c.y=e;c.z=a};yc.prototype.Ya=function(){var a=this.C;var b=a.x;var e=a.y;for(a=a.z;;){var d=this.i[0];var c=d.x;var f=d.y;d=d.z;var h=this.i[1];var k=h.x;var g=h.y;var l=h.z;var m=this.i[2];var n=m.x;h=m.y;m=m.z;k-=c;g-=f;l-=d;c=n-c;f=h-f;h=m-d;d=g*h-l*f;h=l*c-k*h;f=k*f-g*c;k=this.C;k.x=d;k.y=h;k.z=f;this.V(!1); -this.W(!1);f=this.i[this.h];d=this.mb[this.h];f.x=d.x;f.y=d.y;f.z=d.z;d=this.sb[this.h];f.x-=d.x;f.y-=d.y;f.z-=d.z;this.h++;if(this.Jb())break;this.h--;f=this.C;f.x=-f.x;f.y=-f.y;f.z=-f.z;this.V(!1);this.W(!1);f=this.i[this.h];d=this.mb[this.h];f.x=d.x;f.y=d.y;f.z=d.z;d=this.sb[this.h];f.x-=d.x;f.y-=d.y;f.z-=d.z;this.h++;if(this.Jb())break;this.h--;break}f=this.C;f.x=b;f.y=e;f.z=a};yc.prototype.Jb=function(){var a=this.i[2].x-this.i[0].x,b=this.i[2].y-this.i[0].y,e=this.i[2].z-this.i[0].z,d=this.i[3].x- -this.i[0].x,c=this.i[3].y-this.i[0].y,f=this.i[3].z-this.i[0].z;a=(this.i[1].x-this.i[0].x)*(b*f-e*c)-(this.i[1].y-this.i[0].y)*(a*f-e*d)+(this.i[1].z-this.i[0].z)*(a*c-b*d);return 1E-12a};yc.prototype.Sb=function(a,b,e){for(var d=this.Y;0A;){for(var E=this.Y.C,L=Infinity,G=null;null!=E;)E.bhC.x*ma.x+C.y*ma.y+C.z*ma.z-(Ea.x*O.x+Ea.y*O.y+Ea.z*O.z)||39==A){var Y=this.aa,ta=this.C;Y.x=ta.x;Y.y=ta.y;Y.z=ta.z;var Va=this.C,D=Ra.kd,Aa=this.C,aa=(Va.x*D.x+Va.y*D.y+Va.z*D.z)/(Aa.x*Aa.x+Aa.y* -Aa.y+Aa.z*Aa.z);Y.x*=aa;Y.y*=aa;Y.z*=aa;var Ua=void 0,xa=void 0,Ja=void 0,S=this.aa;Ua=S.x;xa=S.y;Ja=S.z;var la=void 0,qa=void 0,Da=void 0,X=void 0,fa=void 0,w=void 0,ja=void 0,ea=void 0,U=void 0,ba=void 0,Fa=void 0,ka=void 0,Qa=void 0,Ka=void 0,V=void 0,ob=void 0,Za=void 0,W=void 0,ha=void 0,I=void 0,na=void 0,ca=void 0,da=void 0,Z=void 0,oa=void 0,xb=void 0,hb=void 0,fb=Ra.kd;la=fb.x;qa=fb.y;Da=fb.z;var gb=Ra.mb;X=gb.x;fa=gb.y;w=gb.z;var pb=Ra.sb;ja=pb.x;ea=pb.y;U=pb.z;var ab=wa.kd;ba=ab.x;Fa=ab.y; -ka=ab.z;var $a=wa.mb;Qa=$a.x;Ka=$a.y;V=$a.z;var ua=wa.sb;ob=ua.x;Za=ua.y;W=ua.z;var Ya=La.kd;ha=Ya.x;I=Ya.y;na=Ya.z;var Fb=La.mb;ca=Fb.x;da=Fb.y;Z=Fb.z;var Xa=La.sb;oa=Xa.x;xb=Xa.y;hb=Xa.z;var Bb=void 0,Wa=void 0,Cb=void 0,qb=void 0,bb=void 0,ib=void 0,rb=void 0,db=void 0,Db=void 0;Bb=ba-la;Wa=Fa-qa;Cb=ka-Da;qb=ha-la;bb=I-qa;ib=na-Da;rb=Ua-la;db=xa-qa;Db=Ja-Da;var jb=Bb*Bb+Wa*Wa+Cb*Cb,nb=Bb*qb+Wa*bb+Cb*ib,cb=qb*qb+bb*bb+ib*ib,Jb=Bb*rb+Wa*db+Cb*Db,Kb=qb*rb+bb*db+ib*Db,F=jb*cb-nb*nb;0!=F&&(F=1/F);var ub= -(Jb*cb-Kb*nb)*F,lb=(-Jb*nb+Kb*jb)*F,yb=void 0,vb=void 0,eb=void 0,Lb=void 0,mb=void 0,zb=void 0,u=void 0,T=void 0,R=void 0;yb=Qa-X;vb=Ka-fa;eb=V-w;Lb=X+yb*ub;mb=fa+vb*ub;zb=w+eb*ub;yb=ca-X;vb=da-fa;eb=Z-w;Lb+=yb*lb;mb+=vb*lb;zb+=eb*lb;yb=ob-ja;vb=Za-ea;eb=W-U;u=ja+yb*ub;T=ea+vb*ub;R=U+eb*ub;yb=oa-ja;vb=xb-ea;eb=hb-U;u+=yb*lb;T+=vb*lb;R+=eb*lb;var va=this.closestPoint1;va.x=Lb;va.y=mb;va.z=zb;var Na=this.closestPoint2;Na.x=u;Na.y=T;Na.z=R;var ya=this.aa;this.depth=Math.sqrt(ya.x*ya.x+ya.y*ya.y+ya.z* -ya.z);return Xg.SUCCEEDED}var Oa=this.Y,kb=Oa.M;null!=kb?(Oa.M=kb.U,kb.U=null):kb=new Aj;var sb=kb.Ia(C,N,y);if(!this.Y.qa(sb,P))return Xg.EPA_FAILED_TO_ADD_VERTEX;++A}return Xg.EPA_DID_NOT_CONVERGE};yc.prototype.Rb=function(a,b,e,d,c){return this.Oa(a,b,e,d,c,!0)};yc.prototype.Wb=function(a,b,e,d,c){return this.Oa(a,b,e,d,c,!1)};yc.prototype.nb=function(a,b,e,d,c,f,h){return this.ob(a,b,e,d,c,f,h)};yc.prototype.yd=function(a,b,e,d,c){var f=this.ac;f.F=e.x;f.G=e.y;f.H=e.z;var h=this.bc,k=this.Sc; -h.x=d.x;h.y=d.y;h.z=d.z;h.x-=e.x;h.y-=e.y;h.z-=e.z;k.$();return this.ob(null,a,f,b,h,k,c)};yc.h=function(){return yc.instance};Gh.h=function(a,b,e){var d=a.x;var c=a.y;a=a.z;var f=b.x;var h=b.y;b=b.z;var k=f-d;var g=h-c;var l=b-a;var m=-(k*d+g*c+l*a)/(k*k+g*g+l*l);if(0>m)return e.x=d,e.y=c,e.z=a,1;if(1c*(r*E-t*A)+f*(t*y-p*E)+h*(p*A-r*y)){L=a.x;G=a.y;P=a.z;pa=b.x;K=b.y;p=b.z;r=pa-L;t=K-G;var M=p-P;var Sa=-(r*L+t*G+M*P)/(r*r+t*t+M*M);0>Sa?(d.x=L,d.y=G,d.z=P,L=1):1k*(v*E-B*A)+g*(B*y-x*E)+l*(x*A-v*y)&&(k=b.x,g=b.y,b=b.z,l=e.x,x=e.y, -v=e.z,B=l-k,p=x-g,r=v-b,t=-(B*k+p*g+r*b)/(B*B+p*p+r*r),0>t?(d.x=k,d.y=g,d.z=b,b=1):1L||km*(C*E-N*A)+n*(N*y-H*E)+q*(H*A-C*y)&&(m=a.x,n=a.y,a=a.z,q=e.x,H=e.y,e=e.z,C=q-m,N=H-n,b=e-a,k=-(C*m+N*n+b*a)/(C*C+N*N+b*b),0>k?(d.x=m,d.y=n,d.z=a,e=1):1L||a(f*Pa+h*Ca+k*Ra)*Aa){var la=a.x;var qa=a.y;var Da=a.z;var X=b.x;var fa=b.y;var w=b.z;var ja=e.x;var ea=e.y;var U=e.z;var ba=X-la;var Fa=fa-qa;var ka=w-Da;var Qa=ja-X;var Ka=ea-fa;var V=U-w;var ob=la-ja;var Za=qa-ea;var W=Da-U;var ha=Fa*V-ka*Ka;var I=ka*Qa-ba*V;var na=ba*Ka-Fa*Qa;var ca=Fa*na-ka*I;var da= -ka*ha-ba*na;var Z=ba*I-Fa*ha;var oa=Ka*na-V*I;var xb=V*ha-Qa*na;var hb=Qa*I-Ka*ha;var fb=Za*na-W*I;var gb=W*ha-ob*na;var pb=ob*I-Za*ha;var ab=-1,$a,ua,Ya=0;var Fb=ua=$a=0;if(0>la*ca+qa*da+Da*Z){var Xa=a.x;var Bb=a.y;var Wa=a.z;var Cb=b.x;var qb=b.y;var bb=b.z;var ib=Cb-Xa;var rb=qb-Bb;var db=bb-Wa;var Db=ib*Xa+rb*Bb+db*Wa;Db=-Db/(ib*ib+rb*rb+db*db);if(0>Db){c.x=Xa;c.y=Bb;c.z=Wa;var jb=1}else if(1X*oa+fa*xb+w*hb){var Kb=b.x;var F=b.y;var ub=b.z;var lb=e.x;var yb=e.y;var vb=e.z;var eb=lb-Kb;var Lb=yb-F;var mb=vb-ub;var zb=eb*Kb+Lb*F+mb*ub;zb=-zb/(eb*eb+Lb*Lb+mb*mb);if(0>zb){c.x=Kb;c.y=F;c.z=ub;var u=1}else if(1ab||Naja*fb+ea*gb+U*pb){var ya=a.x;var Oa= -a.y;var kb=a.z;var sb=e.x;var Hb=e.y;var Ba=e.z;var Ta=sb-ya;var sa=Hb-Oa;var Ga=Ba-kb;var Q=Ta*ya+sa*Oa+Ga*kb;Q=-Q/(Ta*Ta+sa*sa+Ga*Ga);if(0>Q){c.x=ya;c.y=Oa;c.z=kb;var Ma=1}else if(1ab||Mb(f*wa+h*La+k*Ea)*Aa){var Wb=a.x;var mc=a.y;var Xb=a.z;var ic=e.x;var bc=e.y;var $b=e.z;var Zb=d.x;var Qb=d.y;var jc=d.z;var ac=ic-Wb;var ec=bc-mc;var Ub=$b-Xb;var kc=Zb-ic;var uc=Qb-bc;var fc=jc-$b;var dd=Wb-Zb;var Nb=mc-Qb;var nc=Xb-jc;var gc=ec*fc-Ub*uc;var Vb=Ub*kc-ac*fc;var lc=ac*uc-ec*kc;var ed=ec*lc-Ub*Vb;var Bc=Ub*gc-ac*lc;var Kc=ac*Vb-ec*gc; -var zc=uc*lc-fc*Vb;var Cc=fc*gc-kc*lc;var sc=kc*Vb-uc*gc;var Lc=Nb*lc-nc*Vb;var zd=nc*gc-dd*lc;var Rc=dd*Vb-Nb*gc;var Wc=-1,Dc,Ec,od=0;var hc=Ec=Dc=0;if(0>Wb*ed+mc*Bc+Xb*Kc){var fd=a.x;var Sc=a.y;var pd=a.z;var Gd=e.x;var Tc=e.y;var Pd=e.z;var je=Gd-fd;var De=Tc-Sc;var Kd=Pd-pd;var Xc=je*fd+De*Sc+Kd*pd;Xc=-Xc/(je*je+De*De+Kd*Kd);if(0>Xc){c.x=fd;c.y=Sc;c.z=pd;var be=1}else if(1ic*zc+bc*Cc+$b*sc){var qd=e.x;var ce=e.y;var we=e.z;var ke=d.x;var le=d.y;var Fc=d.z;var gd=ke-qd;var hd=le-ce;var Ad=Fc-we;var Yc=gd*qd+hd*ce+Ad*we;Yc=-Yc/(gd*gd+hd*hd+Ad*Ad);if(0>Yc){c.x=qd;c.y=ce;c.z=we;var Mc=1}else if(1Wc||MeZb*Lc+Qb*zd+jc*Rc){var uf=a.x;var vf= -a.y;var Fe=a.z;var Ic=d.x;var Jc=d.y;var oc=d.z;var xe=Ic-uf;var me=Jc-vf;var Qd=oc-Fe;var Rd=xe*uf+me*vf+Qd*Fe;Rd=-Rd/(xe*xe+me*me+Qd*Qd);if(0>Rd){c.x=uf;c.y=vf;c.z=Fe;var ye=1}else if(1Wc||Ncaa||eg(f*O+h*ma+k*Y)*Aa){var Ne=a.x;var bf=a.y;var xf=a.z;var If=b.x;var Jf=b.y;var cf=b.z;var df=d.x;var Kf=d.y;var Lf=d.z;var yf=If-Ne;var zf=Jf-bf;var ze=cf-xf;var ef=df-If;var Mf=Kf-Jf;var ff=Lf-cf;var Zg=Ne-df;var Kh=bf-Kf;var Bd=xf-Lf;var vc=zf*ff-ze*Mf;var wc=ze*ef-yf*ff;var Cd=yf*Mf-zf*ef;var Oe= -zf*Cd-ze*wc;var Pe=ze*vc-yf*Cd;var Qe=yf*wc-zf*vc;var Wd=Mf*Cd-ff*wc;var Xd=ff*vc-ef*Cd;var Dd=ef*wc-Mf*vc;var de=Kh*Cd-Bd*wc;var He=Bd*vc-Zg*Cd;var ne=Zg*wc-Kh*vc;var Hd=-1,ee,Yd,Ae=0;var oe=Yd=ee=0;if(0>Ne*Oe+bf*Pe+xf*Qe){var Af=a.x;var ld=a.y;var Sd=a.z;var ud=b.x;var rd=b.y;var sd=b.z;var md=ud-Af;var Zc=rd-ld;var $c=sd-Sd;var Gc=md*Af+Zc*ld+$c*Sd;Gc=-Gc/(md*md+Zc*Zc+$c*$c);if(0>Gc){c.x=Af;c.y=ld;c.z=Sd;var xc=1}else if(1If*Wd+Jf*Xd+cf*Dd){var Oc=b.x;var ad=b.y;var Ie=b.z;var Nf=d.x;var Ed=d.y;var Td=d.z;var td=Nf-Oc;var Ld=Ed-ad;var vd=Td-Ie;var wd=td*Oc+Ld*ad+vd*Ie;wd=-wd/(td*td+Ld*Ld+vd*vd);if(0>wd){c.x=Oc;c.y=ad;c.z=Ie;var Of=1}else if(1Hd||mhdf*de+Kf*He+Lf*ne){var $g=a.x;var Be=a.y;var Je=a.z;var Ce=d.x;var Id=d.y;var fe=d.z;var pe=Ce-$g;var qe=Id-Be;var Re=fe-Je;var Ud=pe*$g+qe*Be+Re*Je;Ud=-Ud/(pe*pe+qe*qe+Re*Re);if(0>Ud){c.x=$g;c.y=Be;c.z=Je;var Se=1}else if(1Hd||ahaa||wg(g*ta+l*Va+m*D)*Aa){var bh=b.x;var xg=b.y;var yg=b.z;var ch=e.x;var zg=e.y;var Ag=e.z;var Bg=d.x;var Cg=d.y;var Dg=d.z;var gg=ch-bh;var Te=zg-xg;var Rf=Ag-yg;var Eg=Bg-ch;var Sf=Cg-zg;var dh=Dg-Ag;var cj=bh-Bg;var oh=xg-Cg;var ph=yg-Dg;var ge=Te*dh-Rf* -Sf;var Zd=Rf*Eg-gg*dh;var $d=gg*Sf-Te*Eg;var qh=Te*$d-Rf*Zd;var rh=Rf*ge-gg*$d;var sh=gg*Zd-Te*ge;var th=Sf*$d-dh*Zd;var Tf=dh*ge-Eg*$d;var Fg=Eg*Zd-Sf*ge;var Oh=oh*$d-ph*Zd;var eh=ph*ge-cj*$d;var Ph=cj*Zd-oh*ge;var hg=-1,Uf,jf,Gg=0;var ig=jf=Uf=0;if(0>bh*qh+xg*rh+yg*sh){var kf=b.x;var Bf=b.y;var Hg=b.z;var Ig=e.x;var Jg=e.y;var Kg=e.z;var jg=Ig-kf;var kg=Jg-Bf;var lg=Kg-Hg;var Ue=jg*kf+kg*Bf+lg*Hg;Ue=-Ue/(jg*jg+kg*kg+lg*lg);if(0>Ue){c.x=kf;c.y=Bf;c.z=Hg;var mg=1}else if(1ch*th+zg*Tf+Ag*Fg){var Cf=e.x;var ng=e.y;var og=e.z;var gh=d.x;var re=d.y;var se=d.z;var ae=gh-Cf;var he=re-ng;var ie=se-og;var Md=ae*Cf+he*ng+ie*og;Md=-Md/(ae*ae+he*he+ie*ie);if(0>Md){c.x=Cf;c.y=ng;c.z=og;var ji=1}else if(1hg||djBg*Oh+Cg*eh+Dg*Ph){var Qh=b.x;var Df=b.y;var Vf=b.z;var Ng=d.x;var Ke=d.y;var Wf=d.z;var Ve=Ng-Qh;var We=Ke-Df;var Xf=Wf-Vf;var lf=Ve*Qh+We*Df+Xf*Vf;lf=-lf/(Ve*Ve+We*We+Xf*Xf);if(0>lf){c.x=Qh;c.y=Df;c.z=Vf;var pg=1}else if(1hg||hhaa||Oge?b>d?(b=Math.sqrt(b-e-d+1),a.x=.5*b,b=.5/b,a.y=(this.e01+this.e10)*b, -a.z=(this.e02+this.e20)*b,a.w=(this.e21-this.e12)*b):(b=Math.sqrt(d-b-e+1),a.z=.5*b,b=.5/b,a.x=(this.e02+this.e20)*b,a.y=(this.e12+this.e21)*b,a.w=(this.e10-this.e01)*b):e>d?(b=Math.sqrt(e-d-b+1),a.y=.5*b,b=.5/b,a.x=(this.e01+this.e10)*b,a.z=(this.e12+this.e21)*b,a.w=(this.e02-this.e20)*b):(b=Math.sqrt(d-b-e+1),a.z=.5*b,b=.5/b,a.x=(this.e02+this.e20)*b,a.y=(this.e12+this.e21)*b,a.w=(this.e10-this.e01)*b);return a};ia.prototype.Va=function(a){var b=Math.sin(a.x),e=Math.sin(a.y),d=Math.sin(a.z),c=Math.cos(a.x), -f=Math.cos(a.y);a=Math.cos(a.z);this.e00=f*a;this.e01=-f*d;this.e02=e;this.e10=c*d+a*b*e;this.e11=c*a-b*e*d;this.e12=-f*b;this.e20=b*d-c*a*e;this.e21=a*b+c*e*d;this.e22=c*f;return this};ia.prototype.Sc=function(){var a=this.e02;return-1>=a?(a=Math.atan2(this.e21,this.e11),new z(.5*a,-1.570796326794895,.5*-a)):1<=a?(a=Math.atan2(this.e21,this.e11),new z(.5*a,1.570796326794895,.5*a)):new z(Math.atan2(-this.e12,this.e22),Math.asin(a),Math.atan2(-this.e01,this.e00))};ia.prototype.ac=function(a){return 0== -a?new z(this.e00,this.e01,this.e02):1==a?new z(this.e10,this.e11,this.e12):2==a?new z(this.e20,this.e21,this.e22):null};ia.prototype.Fb=function(a){return 0==a?new z(this.e00,this.e10,this.e20):1==a?new z(this.e01,this.e11,this.e21):2==a?new z(this.e02,this.e12,this.e22):null};ia.prototype.bc=function(a,b){0==a?b.Ia(this.e00,this.e01,this.e02):1==a?b.Ia(this.e10,this.e11,this.e12):2==a?b.Ia(this.e20,this.e21,this.e22):b.$()};ia.prototype.Gb=function(a,b){0==a?b.Ia(this.e00,this.e10,this.e20):1==a? -b.Ia(this.e01,this.e11,this.e21):2==a?b.Ia(this.e02,this.e12,this.e22):b.$()};ia.prototype.tb=function(a,b,e){this.e00=a.x;this.e01=a.y;this.e02=a.z;this.e10=b.x;this.e11=b.y;this.e12=b.z;this.e20=e.x;this.e21=e.y;this.e22=e.z;return this};ia.prototype.Wb=function(a,b,e){this.e00=a.x;this.e01=b.x;this.e02=e.x;this.e10=a.y;this.e11=b.y;this.e12=e.y;this.e20=a.z;this.e21=b.z;this.e22=e.z;return this};ia.prototype.toString=function(){return"Mat3["+(0=a?-1.570796326794895:1<=a?1.570796326794895:Math.asin(a)};Sb.V=function(a){return-1>=a?3.14159265358979:1<=a?0:Math.acos(a)};Sb.atan2=function(a,b){return Math.atan2(a,b)};Sb.sqrt=function(a){return Math.sqrt(a)};Sb.h=function(a,b,e){return ae?e:a};Sb.i=function(){return Math.random()};Sb.C=function(a,b){return a+ -Math.random()*(b-a)};Sb.M=function(a,b){return new z(a+Math.random()*(b-a),a+Math.random()*(b-a),a+Math.random()*(b-a))};Sb.I=function(){return new z(-1+2*Math.random(),-1+2*Math.random(),-1+2*Math.random())};jd.prototype.ob=function(){return 0==this.h?new z:this.i[--this.h]};jd.prototype.Wa=function(){return 0==this.I?new ia:this.C[--this.I]};jd.prototype.Ya=function(){return 0==this.Y?new Ha:this.W[--this.Y]};jd.prototype.nb=function(){return 0==this.V?new Gb:this.M[--this.V]};jd.prototype.aa=function(a, -b,e,d){if(null!=a){a.$();if(this.h==this.i.length){for(var c=Array(this.h<<1),f=0,h=this.h;fe){e=-e;var d=-a.x;var c=-a.y;var f=-a.z;a=-a.w}else d=a.x,c=a.y,f=a.z,a=a.w;if(.999999e?b>d?(b=Math.sqrt(b-e-d+1),this.x=.5*b,b=.5/b,this.y=(a.e01+a.e10)*b,this.z=(a.e02+a.e20)*b,this.w=(a.e21-a.e12)*b):(b=Math.sqrt(d-b-e+1),this.z=.5*b,b=.5/b,this.x=(a.e02+a.e20)*b,this.y= -(a.e12+a.e21)*b,this.w=(a.e10-a.e01)*b):e>d?(b=Math.sqrt(e-d-b+1),this.y=.5*b,b=.5/b,this.x=(a.e01+a.e10)*b,this.z=(a.e12+a.e21)*b,this.w=(a.e02-a.e20)*b):(b=Math.sqrt(d-b-e+1),this.z=.5*b,b=.5/b,this.x=(a.e02+a.e20)*b,this.y=(a.e12+a.e21)*b,this.w=(a.e10-a.e01)*b);return this};Gb.prototype.Sa=function(){var a=new ia,b=this.x,e=this.y,d=this.z,c=this.w,f=2*b,h=2*e,k=2*d,g=b*f,l=e*h;d*=k;var m=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;a.e00=1-l-d;a.e01=m-c;a.e02=b+h;a.e10=m+c;a.e11=1-g-d;a.e12=e-f;a.e20=b-h;a.e21= -e+f;a.e22=1-g-l;return a};Gb.prototype.toString=function(){return"Quat["+(0ra.contactUseAlternativePositionCorrectionAlgorithmDepthThreshold?ra.alternativeContactPositionCorrectionAlgorithm:ra.defaultContactPositionCorrectionAlgorithm,b.incremental?this.h.W(b,this.J.g,this.K.g):this.h.aa(b,this.J.g,this.K.g)):this.Ra.de();if(this.xd&&!a){b=this.ic.ld;var e=this.jc.ld;b==e&&(e=null);null!=b&&b.beginContact(this);null!=e&&e.beginContact(this)}!this.xd&&a&&(a=this.ic.ld,b=this.jc.ld,a==b&&(b=null),null!=a&&a.endContact(this),null!=b&&b.endContact(this));this.xd&& -(a=this.ic.ld,b=this.jc.ld,a==b&&(b=null),null!=a&&a.preSolve(this),null!=b&&b.preSolve(this))}};Jd.prototype.Uh=function(){var a=this.ic.ld,b=this.jc.ld;a==b&&(b=null);null!=a&&a.postSolve(this);null!=b&&b.postSolve(this)};Jd.prototype.M=function(){return this.ic};Jd.prototype.V=function(){return this.jc};Jd.prototype.th=function(){return this.xd};Jd.prototype.i=function(){return this.Ra};Jd.prototype.Y=function(){return this.ee};Jd.prototype.I=function(){return this.sa};Jd.prototype.C=function(){return this.U}; -Hf.prototype.h=function(){return this.zd};Hf.prototype.C=function(){return this.Fc};Hf.prototype.I=function(){return this.sa};Hf.prototype.i=function(){return this.U};rg.prototype.I=function(){for(var a=this.nc.Cd;null!=a;){for(var b=a.U;;){if(a.Nf.ucg.R&&k.Sg.S&& -k.Tg.T&&this.h(d,c))){d=b.sa;c=b.U;null!=d&&(d.U=c);null!=c&&(c.sa=d);b==this.md&&(this.md=this.md.U);b==this.Nd&&(this.Nd=this.Nd.sa);b.U=null;b.sa=null;b.xd&&(d=b.ic.ld,c=b.jc.ld,d==c&&(c=null),null!=d&&d.endContact(b),null!=c&&c.endContact(b));d=b.Bb.sa;c=b.Bb.U;null!=d&&(d.U=c);null!=c&&(c.sa=d);b.Bb==b.J.Zb&&(b.J.Zb=b.J.Zb.U);b.Bb==b.J.oc&&(b.J.oc=b.J.oc.sa);b.Bb.U=null;b.Bb.sa=null;d=b.Cb.sa;c=b.Cb.U;null!=d&&(d.U=c);null!=c&&(c.sa=d);b.Cb==b.K.Zb&&(b.K.Zb=b.K.Zb.U);b.Cb==b.K.oc&& -(b.K.oc=b.K.oc.sa);b.Cb.U=null;b.Cb.sa=null;b.J.Pd--;b.K.Pd--;b.Bb.Fc=null;b.Cb.Fc=null;b.Bb.zd=null;b.Cb.zd=null;b.ic=null;b.jc=null;b.J=null;b.K=null;b.xd=!1;b.Eg.de();b.Ra.de();b.Yf=null;d=b.ee;d.ic=null;d.jc=null;d.J=null;d.K=null;d.Jg=null;d.Kg=null;b.U=this.$e;this.$e=b;this.pg--;break}b.lh=!(f.wah.wa&&f.xah.xa&&f.yah.ya);break}b=e}};rg.prototype.h=function(a,b){var e=a.hc,d=b.hc;if(e==d||0!=e.Xb&&0!=d.Xb||0==(a.$g&b.ah)||0==(b.$g&a.ah))return!1;e.Mfra.sleepingTimeThreshold&&(b.Ob=!0,b.Kb=0)):b.Kb=0;if(!b.Ob){if(0==b.Xb){e=a*b.gh;d=e*e;e=1/(1+e+d*(.5+.16666666666666666*e+.041666666666666664*d));d=a*b.Xg;var c=d*d;d=1/(1+d+c*(.5+.16666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+d.B*f.B;c.A=h;c.j=l;c.m=k;c.o=g;c.v=m;c.s=n;c.u=q;c.l=p;c.B=r;h=d.A*f.F+d.j*f.G+d.m*f.H;l=d.o*f.F+d.v*f.G+d.s*f.H;f=d.u*f.F+d.l*f.G+d.B*f.H;c.F=h;c.G=l;c.H=f;c.F+=d.F;c.G+=d.G;c.H+=d.H;a.Tb.Yb(a.D,a.za);d=a.D.wa;c=a.D.xa;f=a.D.ya; -h=a.D.ta;l=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=da.D.ta?h:a.D.ta;a.D.ua=l>a.D.ua?l:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,c=a.g.G-a.za.G,f=a.g.H-a.za.H,h=a.qc,h.x=d,h.y=c,h.z=f,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=e}}};Mj.prototype.Wa=function(a,b,e){for(var d=a.dt,c=!0,f=0,h=this.h;fb.D.ta?g:b.D.ta;b.D.ua=l>b.D.ua?l:b.D.ua;b.D.va=m>b.D.va?m:b.D.va;null!=b.Eb&&(f=b.g.F- -b.za.F,h=b.g.G-b.za.G,k=b.g.H-b.za.H,g=b.qc,g.x=f,g.y=h,g.z=k,b.hc.pc.nc.fd(b.Eb,b.D,b.qc));b=c}}};tb.prototype.Va=function(){var a=Jh.h()/1E3;this.Xf.i();ii.broadPhaseCollisionTime=1E3*(Jh.h()/1E3-a);a=Jh.h()/1E3;for(var b=this.Xf.md;null!=b;){var e=b.U;b.lh||b.Li();b=e}ii.narrowPhaseCollisionTime=1E3*(Jh.h()/1E3-a)};tb.prototype.je=function(){var a=Jh.h()/1E3;if(ra.disableSleeping)for(var b=this.I;null!=b;)b.Ob=!1,b.Kb=0,b=b.U;if(this.W.length=a.drawBvhMinLevel&&e<=a.drawBvhMaxLevel){var c=this.h,f=0==c.h?new z:c.i[--c.h];c=this.h;c=0==c.h?new z:c.i[--c.h];f.x=b.R;f.y=b.S;f.z=b.T;c.x=b.N;c.y=b.O;c.z=b.P;a.aabb(f,c,d);var h=this.h;if(null!=f){f.$();if(h.h==h.i.length){for(var k=Array(h.h<<1),g=0,l=h.h;gra.sleepingTimeThreshold?b.sleepyShapeColor1:b.shapeColor1:e.Ob?b.sleepingShapeColor2:e.Kb>ra.sleepingTimeThreshold?b.sleepyShapeColor2:b.shapeColor2);if(a.drawShapes){var l=k.Tb,m=k.g;switch(l.Xb){case 0:a.sphere(m,l.lb,f);break;case 1:var n=l,q=this.h,p=0==q.h?new z:q.i[--q.h],r=p;r.x=n.Sd;r.y=n.Td;r.z=n.Ud;a.box(m,p,f);var t=this.h;if(null!=p){p.$();if(t.h==t.i.length){for(var x=Array(t.h<<1),v=0,B=t.h;vk?a.ellipse(b,e,d,f,f,g):a.arc(b,e,d,f,f,h,k,!0,g)}};tb.prototype.Wb=function(a,b,e,d,c,f){if(dl)return!1;f=(-g-Math.sqrt(l))/f;if(0>f||1a&&(a=this.points[d].depth)}return a}; +bj.prototype.clear=function(){for(var a=this.numPoints=0,b=this.points;aab&&(ab=-ab);0>ja&&(ja=-ja);0>ob&&(ob=-ob);var Ha=ab+ +ja+ob,I=r*n+t*q+x*p,Ka=Oa+Ha,P=0>I,na=P?-I:I;if(naba&&(ta=ba,Ga=0,W=r,sa=t,la=x,da=P?-1:1);Oa=Ja;var ea=v*ca+B*ia+H*T,X=v*ka+B*pa+H*Ca,ma=v*V+B*fa+H*w;0>ea&&(ea=-ea);0>X&&(X=-X);0>ma&&(ma=-ma);Ha=ea+X+ma;I=v*n+B*q+H*p;var xb=Oa+Ha,Za=0>I,ib=Za?-I:I;if(iblb&&(lb=-lb);0>bb&&(bb=-bb);0>$a&&($a=-$a);Ha=lb+bb+$a;I=C*n+O*q+y*p;var qa=Oa+Ha,mb=0>I,Db=mb? +-I:I;if(DbBa.linearSlop?ta-Ba.linearSlop:0;var tb=A*L+E*Z+M*Y,Ma=A*va+E*Va+M*D,Eb=A*za+E*aa+M*Ta;0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vd;var eg=Ae;Ae=wf;wf=eg}Xe+=f;Mf+=h;Ke+=k;var ud=1,ke=0,wd=Nc*A+Oc*E+Ic*M; +wd-Ba.contactPersistenceThreshold&&(ze?this.h(a,fg,gg,Pf,Wd,Ee,de,ve,yg):this.h(a,Wd,Ee,de,fg,gg, +Pf,ve,yg))}}}}}}}}};Ik.prototype.V=function(){for(var a=0,b=this.I;a=f){var h=this.h[this.C++];h.x=d.x;h.y=d.y;h.Za=d.Za;h.$a=d.$a;h.ab=d.ab;c/=c-f;f=this.h[this.C++];f.x=d.x+(e.x-d.x)*c;f.y=d.y+(e.y-d.y)*c;f.Za=d.Za+(e.Za-d.Za)*c;f.$a=d.$a+(e.$a-d.$a)*c;f.ab=d.ab+(e.ab-d.ab)*c}else 0>=c&&0=f?(h=this.h[this.C++],h.x=d.x,h.y=d.y,h.Za=d.Za,h.$a=d.$a,h.ab=d.ab,c/=c-f,f=this.h[this.C++],f.x=d.x+(e.x-d.x)*c,f.y=d.y+(e.y-d.y)*c,f.Za=d.Za+(e.Za-d.Za)*c,f.$a=d.$a+(e.$a- +d.$a)*c,f.ab=d.ab+(e.ab-d.ab)*c):0>=c&&0=f?(h=this.h[this.C++],h.x=d.x,h.y=d.y,h.Za=d.Za,h.$a=d.$a,h.ab=d.ab,c/=c-f,f=this.h[this.C++], +f.x=d.x+(e.x-d.x)*c,f.y=d.y+(e.y-d.y)*c,f.Za=d.Za+(e.Za-d.Za)*c,f.$a=d.$a+(e.$a-d.$a)*c,f.ab=d.ab+(e.ab-d.ab)*c):0>=c&&0=f?(h=this.h[this.C++], +h.x=d.x,h.y=d.y,h.Za=d.Za,h.$a=d.$a,h.ab=d.ab,c/=c-f,f=this.h[this.C++],f.x=d.x+(e.x-d.x)*c,f.y=d.y+(e.y-d.y)*c,f.Za=d.Za+(e.Za-d.Za)*c,f.$a=d.$a+(e.$a-d.$a)*c,f.ab=d.ab+(e.ab-d.ab)*c):0>=c&&0this.I)){for(var a=-Infinity,b=Infinity,e=-Infinity,d=Infinity,c=null,f=null, +h=null,k=null,g=0,l=this.I;ga&&(a=q,c=n),qe&&(e=p,h=n),pH?0:H>B?1:H/B):0==B?(q=0,n=0>l?0:l>C?1:l/C):(q=C*B-O*O,0==q?n=0:(n=O*H+B*l,n=0>n?0:n>q?1:n/q),q=n*O+H,0>q?(q=0,n=0>l?0:l>C?1:l/C):q>B?(q=1,n=O+l,n=0>n?0:n>C?1:n/C):q/=B);p+=f*n;r+=x*n;t+=c*n;h+=m*q;k+=v*q;d+=g*q;x=p-h;f=r-k;q=t-d;n=x*x+f*f+q*q;n>=(b+e)*(b+e)||(n=Math.sqrt(n),0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.j+this.o)*f,d=(this.m+this.u)*f,c=(this.l-this.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.j+this.o)*f,d=(this.s+this.l)*f,c=(this.m-this.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e= +(this.s+this.l)*f,c=(this.o-this.j)*f);a.x=b;a.y=e;a.z=d;a.w=c;return a};Ob.prototype.i=function(a){var b=this.A;var e=this.v;var d=this.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.j+this.o)*f,d=(this.m+this.u)*f,c=(this.l-this.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f, +b=(this.j+this.o)*f,d=(this.s+this.l)*f,c=(this.m-this.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.m+this.u)*f,e=(this.s+this.l)*f,c=(this.o-this.j)*f);a.x=b;a.y=e;a.z=d;a.w=c};Ob.prototype.qa=function(a){var b=a.x;var e=a.y;var d=a.z;var c=a.w,f=2*b,h=2*e,k=2*d;a=b*f;var g=e*h;d*=k;var l=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;this.A=1-g-d;this.j=l-c;this.m=b+h;this.o=l+c;this.v=1-a-d;this.s=e-f;this.u=b-h;this.l=e+f;this.B=1-a-g;return this};Ob.prototype.clone=function(){var a=new Ob;a.F=this.F;a.G= +this.G;a.H=this.H;a.A=this.A;a.j=this.j;a.m=this.m;a.o=this.o;a.v=this.v;a.s=this.s;a.u=this.u;a.l=this.l;a.B=this.B;return a};Ob.prototype.Dd=function(a){this.F=a.F;this.G=a.G;this.H=a.H;this.A=a.A;this.j=a.j;this.m=a.m;this.o=a.o;this.v=a.v;this.s=a.s;this.u=a.u;this.l=a.l;this.B=a.B;return this};zc.prototype.Oa=function(a,b,e,d,c,f){this.Ma=a;this.Sa=b;this.I=e;this.M=d;var h=this.i,k=this.mb,g=this.sb,l=this.aa,m=this.C;null!=c?(null==c.og&&(c.og=new el),this.Va(c.og)):m.$();if(0==m.x*m.x+m.y* +m.y+m.z*m.z){var n=d.F-e.F;var q=d.G-e.G;var p=d.H-e.H;m.x=n;m.y=q;m.z=p;1E-6>m.x*m.x+m.y*m.y+m.z*m.z&&m.Ia(1,0,0)}this.h=0;this.V(!1);this.W(!1);var r=this.i[this.h],t=this.mb[this.h];r.x=t.x;r.y=t.y;r.z=t.z;var x=this.sb[this.h];r.x-=x.x;r.y-=x.y;r.z-=x.z;this.h=1;for(var v=0;40>v;){var B=0;switch(this.h){case 1:var H=h[0];l.x=H.x;l.y=H.y;l.z=H.z;B=1;break;case 2:var C=void 0,O=void 0,y=void 0,A=void 0,E=void 0,M=void 0,G=h[0];C=G.x;O=G.y;y=G.z;var R=h[1];A=R.x;E=R.y;M=R.z;var K=void 0,oa=void 0, +N=void 0;K=A-C;oa=E-O;N=M-y;var Ra=K*C+oa*O+N*y;Ra=-Ra/(K*K+oa*oa+N*N);if(0>Ra)l.x=C,l.y=O,l.z=y,B=1;else if(1L*W+Z*sa+Y*la){var X=void 0,ma=void 0,xb=void 0,Za=void 0,ib=void 0, +qb=void 0;X=Aa.x;ma=Aa.y;xb=Aa.z;Za=La.x;ib=La.y;qb=La.z;var lb=void 0,bb=void 0,$a=void 0;lb=Za-X;bb=ib-ma;$a=qb-xb;var qa=lb*X+bb*ma+$a*xb;qa=-qa/(lb*lb+bb*bb+$a*$a);var mb=void 0;if(0>qa)l.x=X,l.y=ma,l.z=xb,mb=1;else if(1va*Oa+Va*ab+D*ja){var Ma=void 0,Eb=void 0,ub=void 0,fb=void 0,db=void 0,gb=void 0;Ma=La.x; +Eb=La.y;ub=La.z;fb=Fa.x;db=Fa.y;gb=Fa.z;var jb=void 0,Bb=void 0,kb=void 0;jb=fb-Ma;Bb=db-Eb;kb=gb-ub;var nb=jb*Ma+Bb*Eb+kb*ub;nb=-nb/(jb*jb+Bb*Bb+kb*kb);var Ya=void 0;if(0>nb)l.x=Ma,l.y=Eb,l.z=ub,Ya=1;else if(1Ka||pbza*ob+aa*Ha+Ta*I){var cb=void 0,Fb=void 0,wb=void 0,eb=void 0,Ib=void 0,Q=void 0; +cb=Aa.x;Fb=Aa.y;wb=Aa.z;eb=Fa.x;Ib=Fa.y;Q=Fa.z;var U=void 0,u=void 0,Ab=void 0;U=eb-cb;u=Ib-Fb;Ab=Q-wb;var rb=U*cb+u*Fb+Ab*wb;rb=-rb/(U*U+u*u+Ab*Ab);var ra=void 0;if(0>rb)l.x=cb,l.y=Fb,l.z=wb,ra=1;else if(1Ka||hb(S*fc+Na*Zb+Ia*lc)*Xc){var Tc=void 0,zd=void 0,Ad=void 0,id=void 0,we=void 0,Jd=void 0,he=void 0,Td=void 0,Yc=void 0,$d=void 0,He=void 0,We=void 0,oe=void 0,rd=void 0,Fd=void 0,ae=void 0,xe=void 0,ie=void 0;Tc=ua.x;zd=ua.y;Ad=ua.z;id=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Qf=ua.z;Ze=wa.x;hg=wa.y;ph=wa.z;var qh=void 0,rh=void 0,dh=void 0;qh=Ze-de;rh=hg-Me;dh=ph- +Qf;var $e=qh*de+rh*Me+dh*Qf;$e=-$e/(qh*qh+rh*rh+dh*dh);var af=void 0;if(0>$e)l.x=de,l.y=Me,l.z=Qf,af=1;else if(1<$e)l.x=Ze,l.y=hg,l.z=ph,af=2;else{var ig=void 0,Ag=void 0,eh=void 0;ig=de+qh*$e;Ag=Me+rh*$e;eh=Qf+dh*$e;l.x=ig;l.y=Ag;l.z=eh;af=3}Ee=af;De=l.x*l.x+l.y*l.y+l.z*l.z;Le=l.x;ve=l.y;Wd=l.z}if(0>kd*yg+Ac*oh+Bc*fg){var Bg=void 0,Cg=void 0,fh=void 0,Dg=void 0,Eg=void 0,Fg=void 0;Bg=wa.x;Cg=wa.y;fh=wa.z;Dg=Da.x;Eg=Da.y;Fg=Da.z;var Gg=void 0,Hg=void 0,jg=void 0;Gg=Dg-Bg;Hg=Eg-Cg;jg=Fg-fh;var Ne= +Gg*Bg+Hg*Cg+jg*fh;Ne=-Ne/(Gg*Gg+Hg*Hg+jg*jg);var Rf=void 0;if(0>Ne)l.x=Bg,l.y=Cg,l.z=fh,Rf=1;else if(1De||cjyc*gg+ad*Pf+bd*zg){var sh=void 0,th=void 0,ee=void 0,Xd=void 0,Yd=void 0,uh=void 0;sh=ua.x;th=ua.y;ee=ua.z;Xd=Da.x;Yd=Da.y;uh=Da.z;var vh=void 0,wh=void 0,xh=void 0;vh=Xd-sh;wh=Yd-th; +xh=uh-ee;var Tf=vh*sh+wh*th+xh*ee;Tf=-Tf/(vh*vh+wh*wh+xh*xh);var Jg=void 0;if(0>Tf)l.x=sh,l.y=th,l.z=ee,Jg=1;else if(1De||kgDc||lg(S*sc+Na*Kc+Ia*tc)*Xc){var cf=void 0,yf=void 0,Lg=void 0,Mg=void 0,Ng=void 0,Og=void 0,mg=void 0,ng=void 0,og=void 0,Oe=void 0,pg=void 0,ih=void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>lh*ff+Ch*gf+oj*hf){var Vg=void 0, +Wg=void 0,bi=void 0,Di=void 0,Ei=void 0,Fi=void 0;Vg=Qa.x;Wg=Qa.y;bi=Qa.z;Di=wa.x;Ei=wa.y;Fi=wa.z;var Gi=void 0,Hi=void 0,Ii=void 0;Gi=Di-Vg;Hi=Ei-Wg;Ii=Fi-bi;var Xg=Gi*Vg+Hi*Wg+Ii*bi;Xg=-Xg/(Gi*Gi+Hi*Hi+Ii*Ii);var ci=void 0;if(0>Xg)l.x=Vg,l.y=Wg,l.z=bi,ci=1;else if(1Uh*hk+Vh*ik+Wh*jk){var qj=void 0,rj=void 0, +sj=void 0,Ji=void 0,Ki=void 0,Li=void 0;qj=wa.x;rj=wa.y;sj=wa.z;Ji=Da.x;Ki=Da.y;Li=Da.z;var Mi=void 0,Ni=void 0,Oi=void 0;Mi=Ji-qj;Ni=Ki-rj;Oi=Li-sj;var Yg=Mi*qj+Ni*rj+Oi*sj;Yg=-Yg/(Mi*Mi+Ni*Ni+Oi*Oi);var ei=void 0;if(0>Yg)l.x=qj,l.y=rj,l.z=sj,ei=1;else if(1Gh||nkxi*kk+yi*lk+zi*mk){var uj= +void 0,vj=void 0,wj=void 0,Pi=void 0,Qi=void 0,Ri=void 0;uj=Qa.x;vj=Qa.y;wj=Qa.z;Pi=Da.x;Qi=Da.y;Ri=Da.z;var Si=void 0,Ti=void 0,Ui=void 0;Si=Pi-uj;Ti=Qi-vj;Ui=Ri-wj;var Zg=Si*uj+Ti*vj+Ui*wj;Zg=-Zg/(Si*Si+Ti*Ti+Ui*Ui);var Hh=void 0;if(0>Zg)l.x=uj,l.y=vj,l.z=wj,Hh=1;else if(1Gh||okDc||Ojl.x*l.x+l.y*l.y+l.z*l.z){if(!f)return this.distance=0;switch(this.h){case 1:this.Xa();break;case 2:this.Wa();break;case 3:this.Ya()}if(4==this.h){var Wi= +this.Sb(h,k,g);if(0!=Wi)return this.distance=0,Wi;this.distance=-this.depth;return 0}this.distance=0;return 1}this.Pb(B);m.x=l.x;m.y=l.y;m.z=l.z;m.x=-m.x;m.y=-m.y;m.z=-m.z;this.V(!1);this.W(!1);var Yf=this.i[this.h],Pj=this.mb[this.h];Yf.x=Pj.x;Yf.y=Pj.y;Yf.z=Pj.z;var Ge=this.sb[this.h];Yf.x-=Ge.x;Yf.y-=Ge.y;Yf.z-=Ge.z;if(1E-8>m.x*m.x+m.y*m.y+m.z*m.z)throw Error("!?");var hi=h[this.h];if(1E-8>hi.x*m.x+hi.y*m.y+hi.z*m.z-(l.x*m.x+l.y*m.y+l.z*m.z))return this.Ib(),this.distance=Math.sqrt(l.x*l.x+l.y* +l.y+l.z*l.z),null!=c&&null!=c.og&&this.Gb(c.og),0;this.h++;++v}return 2};zc.prototype.ob=function(a,b,e,d,c,f,h){this.Ma=a;this.Sa=b;this.I=e;this.M=d;var k=this.i,g=this.aa,l=this.C;var m=d.F-e.F;var n=d.G-e.G;var q=d.H-e.H;l.x=m;l.y=n;l.z=q;1E-6>l.x*l.x+l.y*l.y+l.z*l.z&&l.Ia(1,0,0);this.h=0;if(null!=this.Ma)this.V(!0);else{var p=this.mb[this.h];p.x=this.I.F;p.y=this.I.G;p.z=this.I.H}this.W(!0);var r=this.i[this.h],t=this.mb[this.h];r.x=t.x;r.y=t.y;r.z=t.z;var x=this.sb[this.h];r.x-=x.x;r.y-=x.y; +r.z-=x.z;this.h=1;var v=0,B=0,H=this.Fb,C=this.tb;H.$();C.x=f.x;C.y=f.y;C.z=f.z;C.x-=c.x;C.y-=c.y;for(C.z-=c.z;40>v;){var O=0;switch(this.h){case 1:var y=k[0];g.x=y.x;g.y=y.y;g.z=y.z;O=1;break;case 2:var A=void 0,E=void 0,M=void 0,G=void 0,R=void 0,K=void 0,oa=k[0];A=oa.x;E=oa.y;M=oa.z;var N=k[1];G=N.x;R=N.y;K=N.z;var Ra=void 0,Wa=void 0,Ja=void 0;Ra=G-A;Wa=R-E;Ja=K-M;var Sa=Ra*A+Wa*E+Ja*M;Sa=-Sa/(Ra*Ra+Wa*Wa+Ja*Ja);if(0>Sa)g.x=A,g.y=E,g.z=M,O=1;else if(1va*Oa+Va*ab+D*ja){var Za=void 0,ib=void 0,qb=void 0,lb=void 0,bb=void 0,$a=void 0;Za=L.x;ib=L.y;qb=L.z;lb=Z.x;bb=Z.y;$a=Z.z;var qa=void 0,mb=void 0,Db=void 0;qa=lb-Za;mb=bb-ib;Db=$a-qb;var Xa=qa*Za+mb*ib+Db*qb;Xa=-Xa/(qa*qa+mb* +mb+Db*Db);var tb=void 0;if(0>Xa)g.x=Za,g.y=ib,g.z=qb,tb=1;else if(1za*ob+aa*Ha+Ta*I){var fb=void 0,db=void 0,gb=void 0,jb=void 0,Bb=void 0,kb=void 0;fb=Z.x;db=Z.y;gb=Z.z;jb=Y.x;Bb=Y.y;kb=Y.z;var nb=void 0,Ya=void 0,Nb=void 0;nb=jb-fb;Ya=Bb-db;Nb=kb-gb;var Lb=nb*fb+Ya*db+Nb*gb;Lb=-Lb/(nb*nb+Ya*Ya+Nb*Nb);var F=void 0; +if(0>Lb)g.x=fb,g.y=db,g.z=gb,F=1;else if(1ba||wbca*Ka+ia*P+T*na){var eb=void 0,Ib=void 0,Q=void 0,U=void 0,u=void 0,Ab=void 0;eb=L.x;Ib=L.y;Q=L.z;U=Y.x;u=Y.y;Ab=Y.z;var rb=void 0,ra=void 0,Ua=void 0;rb=U-eb;ra=u-Ib;Ua=Ab-Q;var xa=rb*eb+ra*Ib+Ua*Q;xa=-xa/(rb*rb+ra*ra+Ua*Ua);var Pa=void 0;if(0> +xa)g.x=eb,g.y=Ib,g.z=Q,Pa=1;else if(1ba||ua(Cb*ed+vb*Cc+Kb*wc)*gd){var id=void 0,we=void 0,Jd=void 0,he=void 0,Td=void 0,Yc=void 0,$d=void 0,He=void 0, +We=void 0,oe=void 0,rd=void 0,Fd=void 0,ae=void 0,xe=void 0,ie=void 0,Ec=void 0,sd=void 0,td=void 0;id=Da.x;we=Da.y;Jd=Da.z;he=S.x;Td=S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g;rg=pg-ng;jh=ih-og;le=Mg-Oe;me=Ng-pg;Zd=Og-ih;var fe=void 0,ge=void 0,Md=void 0;fe=Qg*jh-zf*rg;ge=zf*qg-Pg*jh;Md=Pg*rg-Qg*qg;var ji=void 0,Dj=void 0,Ej=void 0,Fj=void 0,dj=void 0,Qh=void 0, +Af=void 0,Vf=void 0,Rg=void 0;ji=Qg*Md-zf*ge;Dj=zf*fe-Pg*Md;Ej=Pg*ge-Qg*fe;Fj=rg*Md-jh*ge;dj=jh*fe-qg*Md;Qh=qg*ge-rg*fe;Af=me*Md-Zd*ge;Vf=Zd*fe-le*Md;Rg=le*ge-me*fe;var Fe=-1,Wf=void 0,Pe=void 0,Qe=void 0,Xf=0;Qe=Pe=Wf=0;if(0>Mg*ji+Ng*Dj+Og*Ej){var df=void 0,sg=void 0,yh=void 0,zh=void 0,Ah=void 0,kh=void 0;df=Da.x;sg=Da.y;yh=Da.z;zh=S.x;Ah=S.y;kh=S.z;var Bf=void 0,ef=void 0,tg=void 0;Bf=zh-df;ef=Ah-sg;tg=kh-yh;var Sg=Bf*df+ef*sg+tg*yh;Sg=-Sg/(Bf*Bf+ef*ef+tg*tg);var Gj=void 0;if(0>Sg)g.x=df,g.y=sg, +g.z=yh,Gj=1;else if(1mg*Fj+ng*dj+og*Qh){var ki=void 0,li=void 0,mi=void 0,ni=void 0,oi=void 0,pi=void 0;ki=S.x;li=S.y;mi=S.z;ni=Ia.x;oi=Ia.y;pi=Ia.z;var Tg=void 0,Rh=void 0,hj=void 0;Tg=ni-ki;Rh=oi-li;hj=pi-mi;var Sh=Tg*ki+Rh*li+hj*mi;Sh=-Sh/(Tg*Tg+Rh*Rh+hj*hj);var Hj=void 0;if(0>Sh)g.x=ki,g.y=li,g.z=mi,Hj=1;else if(1< +Sh)g.x=ni,g.y=oi,g.z=pi,Hj=2;else{var fk=void 0,ij=void 0,jj=void 0;fk=ki+Tg*Sh;ij=li+Rh*Sh;jj=mi+hj*Sh;g.x=fk;g.y=ij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throw Error("!?");var Qk=k[this.h],jl=Qk.x*l.x+Qk.y*l.y+Qk.z*l.z;if(0>jl){if(0<=C.x*l.x+C.y*l.y+C.z*l.z)break;var pk= +jl/(C.x*l.x+C.y*l.y+C.z*l.z);B+=pk;if(1<=B)break;H.x+=C.x*pk;H.y+=C.y*pk;H.z+=C.z*pk;for(var kl=0,yl=this.h+1;klnl*nl+ol*ol+pl*pl){ll=!0;break}}ll||this.h++;++v}return!1};zc.prototype.Ib=function(){switch(this.h){case 1:var a=this.closestPoint1,b=this.mb[0];a.x=b.x;a.y=b.y;a.z=b.z;var e=this.closestPoint2, +d=this.sb[0];e.x=d.x;e.y=d.y;e.z=d.z;break;case 2:var c=this.aa;var f=c.x;var h=c.y;var k=c.z;var g=this.i[0];var l=g.x;var m=g.y;var n=g.z;var q=this.mb[0];var p=q.x;var r=q.y;var t=q.z;var x=this.sb[0];var v=x.x;var B=x.y;var H=x.z;var C=this.i[1];var O=C.x;var y=C.y;var A=C.z;var E=this.mb[1];var M=E.x;var G=E.y;var R=E.z;var K=this.sb[1];var oa=K.x;var N=K.y;var Ra=K.z;var Wa=O-l;var Ja=y-m;var Sa=A-n;var Aa=Wa*Wa+Ja*Ja+Sa*Sa;0!=Aa&&(Aa=1/Aa);var La=((f-l)*Wa+(h-m)*Ja+(k-n)*Sa)*Aa;var Fa=M-p; +var L=G-r;var Z=R-t;var Y=p+Fa*La;var va=r+L*La;var Va=t+Z*La;Fa=oa-v;L=N-B;Z=Ra-H;var D=v+Fa*La;var za=B+L*La;var aa=H+Z*La;var Ta=this.closestPoint1;Ta.x=Y;Ta.y=va;Ta.z=Va;var ca=this.closestPoint2;ca.x=D;ca.y=za;ca.z=aa;break;case 3:var ia=this.aa;var T=ia.x;var ka=ia.y;var pa=ia.z;var Ca=this.i[0];var V=Ca.x;var fa=Ca.y;var w=Ca.z;var ta=this.mb[0];var Ga=ta.x;var da=ta.y;var W=ta.z;var sa=this.sb[0];var la=sa.x;var Oa=sa.y;var ab=sa.z;var ja=this.i[1];var ob=ja.x;var Ha=ja.y;var I=ja.z;var Ka= +this.mb[1];var P=Ka.x;var na=Ka.y;var ba=Ka.z;var ea=this.sb[1];var X=ea.x;var ma=ea.y;var xb=ea.z;var Za=this.i[2];var ib=Za.x;var qb=Za.y;var lb=Za.z;var bb=this.mb[2];var $a=bb.x;var qa=bb.y;var mb=bb.z;var Db=this.sb[2];var Xa=Db.x;var tb=Db.y;var Ma=Db.z;var Eb=ob-V;var ub=Ha-fa;var fb=I-w;var db=ib-V;var gb=qb-fa;var jb=lb-w;var Bb=T-V;var kb=ka-fa;var nb=pa-w;var Ya=Eb*Eb+ub*ub+fb*fb,Nb=Eb*db+ub*gb+fb*jb,Lb=db*db+gb*gb+jb*jb,F=Eb*Bb+ub*kb+fb*nb,pb=db*Bb+gb*kb+jb*nb,cb=Ya*Lb-Nb*Nb;0!=cb&&(cb= +1/cb);var Fb=(F*Lb-pb*Nb)*cb,wb=(-F*Nb+pb*Ya)*cb;var eb=P-Ga;var Ib=na-da;var Q=ba-W;var U=Ga+eb*Fb;var u=da+Ib*Fb;var Ab=W+Q*Fb;eb=$a-Ga;Ib=qa-da;Q=mb-W;U+=eb*wb;u+=Ib*wb;Ab+=Q*wb;eb=X-la;Ib=ma-Oa;Q=xb-ab;var rb=la+eb*Fb;var ra=Oa+Ib*Fb;var Ua=ab+Q*Fb;eb=Xa-la;Ib=tb-Oa;Q=Ma-ab;rb+=eb*wb;ra+=Ib*wb;Ua+=Q*wb;var xa=this.closestPoint1;xa.x=U;xa.y=u;xa.z=Ab;var Pa=this.closestPoint2;Pa.x=rb;Pa.y=ra;Pa.z=Ua;break;default:throw Error("!?");}};zc.prototype.Va=function(a){var b=this.C;a=a.xi;b.x=a.x;b.y= +a.y;b.z=a.z};zc.prototype.Gb=function(a){a=a.xi;var b=this.aa;a.x=b.x;a.y=b.y;a.z=b.z;a.x=-a.x;a.y=-a.y;a.z=-a.z};zc.prototype.Pb=function(a){this.h=a;this.h=(this.h&5)+(this.h>>1&5);this.h=(this.h&3)+(this.h>>2&3);switch(a){case 2:a=this.i[0];var b=this.i[1];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[1];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[1];a.x=b.x;a.y=b.y;a.z=b.z;break;case 4:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0]; +b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;break;case 5:a=this.i[1];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;break;case 6:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;break;case 8:a=this.i[0];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[3];a.x=b.x; +a.y=b.y;a.z=b.z;break;case 9:a=this.i[1];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 10:a=this.i[0];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 11:a=this.i[2];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[2];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[2];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z; +break;case 12:a=this.i[0];b=this.i[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[0];b=this.mb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[0];b=this.sb[2];a.x=b.x;a.y=b.y;a.z=b.z;a=this.i[1];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 13:a=this.i[1];b=this.i[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.mb[1];b=this.mb[3];a.x=b.x;a.y=b.y;a.z=b.z;a=this.sb[1];b=this.sb[3];a.x=b.x;a.y=b.y;a.z=b.z;break;case 14:a=this.i[0],b=this.i[3], +a.x=b.x,a.y=b.y,a.z=b.z,a=this.mb[0],b=this.mb[3],a.x=b.x,a.y=b.y,a.z=b.z,a=this.sb[0],b=this.sb[3],a.x=b.x,a.y=b.y,a.z=b.z}};zc.prototype.V=function(a){var b=this.C;var e=b.x;var d=b.y;b=b.z;var c=this.I.A*e+this.I.o*d+this.I.u*b;var f=this.I.j*e+this.I.v*d+this.I.l*b;var h=this.I.m*e+this.I.s*d+this.I.B*b;var k=this.C;k.x=c;k.y=f;k.z=h;this.Ma.ud(this.C,this.mb[this.h]);a&&(a=this.C,h=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z),0a;){var b=this.C,e=this.qa[a++];b.x=e.x;b.y= +e.y;b.z=e.z;this.V(!1);this.W(!1);b=this.i[this.h];e=this.mb[this.h];b.x=e.x;b.y=e.y;b.z=e.z;e=this.sb[this.h];b.x-=e.x;b.y-=e.y;b.z-=e.z;this.h++;this.Wa();if(4==this.h)break;this.h--;b=this.C;b.x=-b.x;b.y=-b.y;b.z=-b.z;this.V(!1);this.W(!1);b=this.i[this.h];e=this.mb[this.h];b.x=e.x;b.y=e.y;b.z=e.z;e=this.sb[this.h];b.x-=e.x;b.y-=e.y;b.z-=e.z;this.h++;this.Wa();if(4==this.h)break;this.h--}};zc.prototype.Wa=function(){var a=this.C;var b=a.x;var e=a.y;a=a.z;var d=this.i[0];var c=d.x;var f=d.y;d=d.z; +var h=this.i[1];var k=h.x;var g=h.y;h=h.z;c-=k;f-=g;d-=h;for(g=0;3>g;){h=this.qa[g++];k=h.x;var l=h.y;var m=h.z;h=f*m-d*l;m=d*k-c*m;k=c*l-f*k;l=this.C;l.x=h;l.y=m;l.z=k;this.V(!1);this.W(!1);h=this.i[this.h];k=this.mb[this.h];h.x=k.x;h.y=k.y;h.z=k.z;k=this.sb[this.h];h.x-=k.x;h.y-=k.y;h.z-=k.z;this.h++;this.Ya();if(4==this.h)break;this.h--;h=this.C;h.x=-h.x;h.y=-h.y;h.z=-h.z;this.V(!1);this.W(!1);h=this.i[this.h];k=this.mb[this.h];h.x=k.x;h.y=k.y;h.z=k.z;k=this.sb[this.h];h.x-=k.x;h.y-=k.y;h.z-=k.z; +this.h++;this.Ya();if(4==this.h)break;this.h--}c=this.C;c.x=b;c.y=e;c.z=a};zc.prototype.Ya=function(){var a=this.C;var b=a.x;var e=a.y;a=a.z;var d=this.i[0];var c=d.x;var f=d.y;d=d.z;var h=this.i[1];var k=h.x;var g=h.y;var l=h.z;var m=this.i[2];var n=m.x;h=m.y;m=m.z;k-=c;g-=f;l-=d;c=n-c;f=h-f;d=m-d;h=this.C;h.x=g*d-l*f;h.y=l*c-k*d;h.z=k*f-g*c;this.V(!1);this.W(!1);f=this.i[this.h];d=this.mb[this.h];f.x=d.x;f.y=d.y;f.z=d.z;d=this.sb[this.h];f.x-=d.x;f.y-=d.y;f.z-=d.z;this.h++;this.Jb()||(this.h--, +f=this.C,f.x=-f.x,f.y=-f.y,f.z=-f.z,this.V(!1),this.W(!1),f=this.i[this.h],d=this.mb[this.h],f.x=d.x,f.y=d.y,f.z=d.z,d=this.sb[this.h],f.x-=d.x,f.y-=d.y,f.z-=d.z,this.h++,this.Jb()||this.h--);f=this.C;f.x=b;f.y=e;f.z=a};zc.prototype.Jb=function(){var a=this.i[2].x-this.i[0].x,b=this.i[2].y-this.i[0].y,e=this.i[2].z-this.i[0].z,d=this.i[3].x-this.i[0].x,c=this.i[3].y-this.i[0].y,f=this.i[3].z-this.i[0].z;a=(this.i[1].x-this.i[0].x)*(b*f-e*c)-(this.i[1].y-this.i[0].y)*(a*f-e*d)+(this.i[1].z-this.i[0].z)* +(a*c-b*d);return 1E-12a};zc.prototype.Sb=function(a,b,e){for(var d=this.Y;0A;){for(var E=this.Y.C,M=Infinity,G=null;null!=E;)E.bhC.x*Z.x+C.y*Z.y+C.z*Z.z-(Fa.x*L.x+Fa.y*L.y+Fa.z*L.z)||39==A){var Y=this.aa,va=this.C;Y.x=va.x;Y.y=va.y;Y.z=va.z;var Va=this.C,D=Sa.kd,za=this.C,aa=(Va.x*D.x+Va.y*D.y+Va.z*D.z)/(za.x*za.x+za.y*za.y+za.z*za.z);Y.x*=aa;Y.y*=aa;Y.z*=aa;var Ta=void 0,ca=void 0,ia=void 0,T=this.aa;Ta=T.x;ca=T.y;ia=T.z;var ka=void 0,pa=void 0,Ca=void 0,V=void 0,fa=void 0,w=void 0, +ta=void 0,Ga=void 0,da=void 0,W=void 0,sa=void 0,la=void 0,Oa=void 0,ab=void 0,ja=void 0,ob=void 0,Ha=void 0,I=void 0,Ka=void 0,P=void 0,na=void 0,ba=void 0,ea=void 0,X=void 0,ma=void 0,xb=void 0,Za=void 0,ib=Sa.kd;ka=ib.x;pa=ib.y;Ca=ib.z;var qb=Sa.mb;V=qb.x;fa=qb.y;w=qb.z;var lb=Sa.sb;ta=lb.x;Ga=lb.y;da=lb.z;var bb=Aa.kd;W=bb.x;sa=bb.y;la=bb.z;var $a=Aa.mb;Oa=$a.x;ab=$a.y;ja=$a.z;var qa=Aa.sb;ob=qa.x;Ha=qa.y;I=qa.z;var mb=La.kd;Ka=mb.x;P=mb.y;na=mb.z;var Db=La.mb;ba=Db.x;ea=Db.y;X=Db.z;var Xa=La.sb; +ma=Xa.x;xb=Xa.y;Za=Xa.z;var tb=void 0,Ma=void 0,Eb=void 0,ub=void 0,fb=void 0,db=void 0,gb=void 0,jb=void 0,Bb=void 0;tb=W-ka;Ma=sa-pa;Eb=la-Ca;ub=Ka-ka;fb=P-pa;db=na-Ca;gb=Ta-ka;jb=ca-pa;Bb=ia-Ca;var kb=tb*tb+Ma*Ma+Eb*Eb,nb=tb*ub+Ma*fb+Eb*db,Ya=ub*ub+fb*fb+db*db,Nb=tb*gb+Ma*jb+Eb*Bb,Lb=ub*gb+fb*jb+db*Bb,F=kb*Ya-nb*nb;0!=F&&(F=1/F);var pb=(Nb*Ya-Lb*nb)*F,cb=(-Nb*nb+Lb*kb)*F,Fb=void 0,wb=void 0,eb=void 0,Ib=void 0,Q=void 0,U=void 0,u=void 0,Ab=void 0,rb=void 0;Fb=Oa-V;wb=ab-fa;eb=ja-w;Ib=V+Fb*pb;Q= +fa+wb*pb;U=w+eb*pb;Fb=ba-V;wb=ea-fa;eb=X-w;Ib+=Fb*cb;Q+=wb*cb;U+=eb*cb;Fb=ob-ta;wb=Ha-Ga;eb=I-da;u=ta+Fb*pb;Ab=Ga+wb*pb;rb=da+eb*pb;Fb=ma-ta;wb=xb-Ga;eb=Za-da;u+=Fb*cb;Ab+=wb*cb;rb+=eb*cb;var ra=this.closestPoint1;ra.x=Ib;ra.y=Q;ra.z=U;var Ua=this.closestPoint2;Ua.x=u;Ua.y=Ab;Ua.z=rb;var xa=this.aa;this.depth=Math.sqrt(xa.x*xa.x+xa.y*xa.y+xa.z*xa.z);return ah.SUCCEEDED}var Pa=this.Y,hb=Pa.M;null!=hb?(Pa.M=hb.U,hb.U=null):hb=new Aj;var yb=hb.Ia(C,O,y);if(!this.Y.qa(yb,R))return ah.EPA_FAILED_TO_ADD_VERTEX; +++A}return ah.EPA_DID_NOT_CONVERGE};zc.prototype.Rb=function(a,b,e,d,c){return this.Oa(a,b,e,d,c,!0)};zc.prototype.Wb=function(a,b,e,d,c){return this.Oa(a,b,e,d,c,!1)};zc.prototype.nb=function(a,b,e,d,c,f,h){return this.ob(a,b,e,d,c,f,h)};zc.prototype.yd=function(a,b,e,d,c){var f=this.ac;f.F=e.x;f.G=e.y;f.H=e.z;var h=this.bc,k=this.Sc;h.x=d.x;h.y=d.y;h.z=d.z;h.x-=e.x;h.y-=e.y;h.z-=e.z;k.$();return this.ob(null,a,f,b,h,k,c)};zc.h=function(){return zc.instance};Kh.h=function(a,b,e){var d=a.x;var c= +a.y;a=a.z;var f=b.x;var h=b.y;b=b.z;var k=f-d;var g=h-c;var l=b-a;var m=-(k*d+g*c+l*a)/(k*k+g*g+l*l);if(0>m)return e.x=d,e.y=c,e.z=a,1;if(1c*(r*E-t*A)+ +f*(t*y-p*E)+h*(p*A-r*y)){M=a.x;G=a.y;R=a.z;oa=b.x;K=b.y;p=b.z;r=oa-M;t=K-G;var N=p-R;var Ra=-(r*M+t*G+N*R)/(r*r+t*t+N*N);0>Ra?(d.x=M,d.y=G,d.z=R,M=1):1k*(v*E-B*A)+g*(B*y-x*E)+l*(x*A-v*y)&&(k=b.x,g=b.y,b=b.z,l=e.x,x=e.y,v=e.z,B=l-k,p=x-g,r=v-b,t=-(B*k+p*g+r*b)/(B*B+p*p+r*r),0>t?(d.x=k,d.y=g,d.z=b,b=1):1M||km*(C*E-O*A)+n*(O*y-H*E)+q*(H*A-C*y)&&(m=a.x,n=a.y,a=a.z,q=e.x,H=e.y,e=e.z,C=q-m,O=H-n,b=e-a,k=-(C*m+O*n+b*a)/(C*C+O*O+b*b),0>k?(d.x=m,d.y=n,d.z=a,e=1):1M||a(f*Wa+h*Ja+k*Sa)*za){var ka=a.x;var pa=a.y;var Ca=a.z;var V=b.x;var fa=b.y;var w=b.z;var ta=e.x;var Ga=e.y;var da=e.z;var W=V-ka;var sa=fa-pa;var la=w-Ca;var Oa=ta-V;var ab=Ga-fa;var ja=da-w;var ob=ka-ta;var Ha=pa-Ga;var I=Ca-da;var Ka=sa*ja-la*ab;var P=la*Oa-W*ja;var na=W*ab-sa*Oa;var ba=sa*na-la*P;var ea=la*Ka-W*na;var X=W*P-sa*Ka;var ma=ab*na-ja*P;var xb=ja*Ka-Oa*na;var Za=Oa*P-ab*Ka;var ib=Ha*na-I*P;var qb=I*Ka-ob*na;var lb=ob*P-Ha*Ka;var bb=-1,$a,qa,mb=0;var Db= +qa=$a=0;if(0>ka*ba+pa*ea+Ca*X){var Xa=a.x;var tb=a.y;var Ma=a.z;var Eb=b.x;var ub=b.y;var fb=b.z;var db=Eb-Xa;var gb=ub-tb;var jb=fb-Ma;var Bb=db*Xa+gb*tb+jb*Ma;Bb=-Bb/(db*db+gb*gb+jb*jb);if(0>Bb){c.x=Xa;c.y=tb;c.z=Ma;var kb=1}else if(1V*ma+fa*xb+w*Za){var Lb=b.x;var F=b.y;var pb=b.z;var cb=e.x;var Fb=e.y;var wb=e.z;var eb=cb-Lb;var Ib= +Fb-F;var Q=wb-pb;var U=eb*Lb+Ib*F+Q*pb;U=-U/(eb*eb+Ib*Ib+Q*Q);if(0>U){c.x=Lb;c.y=F;c.z=pb;var u=1}else if(1bb||Uata*ib+Ga*qb+da*lb){var xa=a.x;var Pa=a.y;var hb=a.z;var yb=e.x;var Jb=e.y;var ua=e.z;var Qa=yb-xa;var wa=Jb-Pa;var Da=ua-hb;var S=Qa*xa+wa*Pa+Da*hb;S=-S/(Qa*Qa+wa*wa+Da*Da);if(0>S){c.x=xa;c.y=Pa;c.z=hb;var Na= +1}else if(1bb||Kb(f*Aa+h*La+k*Fa)*za){var Wb= +a.x;var nc=a.y;var ac=a.z;var gc=e.x;var cc=e.y;var Tb=e.z;var Ub=d.x;var Qb=d.y;var hc=d.z;var bc=gc-Wb;var jc=cc-nc;var Xb=Tb-ac;var ic=Ub-gc;var vc=Qb-cc;var Yb=hc-Tb;var Sc=Wb-Ub;var Mb=nc-Qb;var mc=ac-hc;var fc=jc*Yb-Xb*vc;var Zb=Xb*ic-bc*Yb;var lc=bc*vc-jc*ic;var ed=jc*lc-Xb*Zb;var Cc=Xb*fc-bc*lc;var wc=bc*Zb-jc*fc;var sc=vc*lc-Yb*Zb;var Kc=Yb*fc-ic*lc;var tc=ic*Zb-vc*fc;var Lc=Mb*lc-mc*Zb;var Id=mc*fc-Sc*lc;var fd=Sc*Zb-Mb*fc;var Xc=-1,Dc,oc,gd=0;var kc=oc=Dc=0;if(0>Wb*ed+nc*Cc+ac*wc){var hd= +a.x;var Tc=a.y;var zd=a.z;var Ad=e.x;var id=e.y;var we=e.z;var Jd=Ad-hd;var he=id-Tc;var Td=we-zd;var Yc=Jd*hd+he*Tc+Td*zd;Yc=-Yc/(Jd*Jd+he*he+Td*Td);if(0>Yc){c.x=hd;c.y=Tc;c.z=zd;var $d=1}else if(1gc*sc+cc*Kc+Tb*tc){var rd=e.x;var Fd=e.y;var ae=e.z;var xe=d.x;var ie=d.y;var Ec=d.z;var sd=xe-rd;var td=ie-Fd;var Bd=Ec-ae;var Zc=sd*rd+ +td*Fd+Bd*ae;Zc=-Zc/(sd*sd+td*td+Bd*Bd);if(0>Zc){c.x=rd;c.y=Fd;c.z=ae;var Mc=1}else if(1Xc||IeUb*Lc+Qb*Id+hc*fd){var xg=a.x;var $c=a.y;var xc=a.z;var Hc=d.x;var of=d.y;var be=d.z;var Ud=Hc-xg;var Pd=of-$c;var Qd=be-xc;var je=Ud*xg+Pd*$c+Qd*xc;je=-je/(Ud*Ud+Pd*Pd+Qd*Qd);if(0>je){c.x=xg;c.y=$c;c.z=xc;var Fc=1}else if(1< +je)c.x=Hc,c.y=of,c.z=be,Fc=2;else{var Uc=xg+Ud*je;var Vc=$c+Pd*je;var dg=xc+Qd*je;c.x=Uc;c.y=Vc;c.z=dg;Fc=3}var Gf=c.x*c.x+c.y*c.y+c.z*c.z;if(0>Xc||Gfaa||qf(f*L+h*Z+k*Y)*za){var Je=a.x;var Hf=a.y;var rf=a.z;var sf=b.x;var tf=b.y;var If=b.z;var Jf=d.x;var Kf=d.y;var Lf=d.z;var uf=sf-Je;var vf=tf-Hf;var Wc=If-rf;var nd=Jf-sf;var vd=Kf-tf;var ze=Lf-If;var Xe=Je-Jf;var Mf=Hf-Kf;var Ke=rf-Lf;var Nc=vf*ze-Wc*vd;var Oc=Wc*nd-uf*ze;var Ic=uf*vd-vf*nd;var pe=vf*Ic-Wc*Oc;var qe=Wc*Nc-uf*Ic;var re=uf*Oc-vf*Nc;var se=vd*Ic-ze*Oc;var te=ze*Nc-nd*Ic;var Rd=nd*Oc-vd*Nc;var Ae=Mf*Ic-Ke*Oc;var wf=Ke*Nc-Xe*Ic;var eg=Xe*Oc-Mf*Nc;var ud=-1,ke,wd,od=0;var jd= +wd=ke=0;if(0>Je*pe+Hf*qe+rf*re){var pd=a.x;var Jc=a.y;var Pc=a.z;var kd=b.x;var Ac=b.y;var Bc=b.z;var yc=kd-pd;var ad=Ac-Jc;var bd=Bc-Pc;var Gc=yc*pd+ad*Jc+bd*Pc;Gc=-Gc/(yc*yc+ad*ad+bd*bd);if(0>Gc){c.x=pd;c.y=Jc;c.z=Pc;var Be=1}else if(1sf*se+tf*te+If*Rd){var ce=b.x;var Ye=b.y;var ue=b.z;var Of=d.x;var Cd=d.y;var Sd=d.z;var Gd=Of-ce; +var Kd=Cd-Ye;var Ld=Sd-ue;var Dd=Gd*ce+Kd*Ye+Ld*ue;Dd=-Dd/(Gd*Gd+Kd*Kd+Ld*Ld);if(0>Dd){c.x=ce;c.y=Ye;c.z=ue;var yg=1}else if(1ud||PfJf*Ae+Kf*wf+Lf*eg){var zg=a.x;var De=a.y;var Le=a.z;var ve=d.x;var Wd=d.y;var Ee=d.z;var de=ve-zg;var Me=Wd-De;var Qf=Ee-Le;var Ze=de*zg+Me*De+Qf*Le;Ze=-Ze/(de*de+Me*Me+Qf*Qf);if(0> +Ze){c.x=zg;c.y=De;c.z=Le;var hg=1}else if(1ud||dh +aa||Ag(g*va+l*Va+m*D)*za){var eh=b.x;var Bg=b.y;var Cg=b.z;var fh=e.x;var Dg=e.y;var Eg=e.z;var Fg=d.x;var Gg=d.y;var Hg=d.z;var jg=fh-eh;var Ne=Dg-Bg;var Rf=Eg-Cg;var Ig=Fg-fh;var Sf=Gg-Dg;var gh=Hg-Eg;var cj=eh-Fg;var sh=Bg-Gg;var th=Cg-Hg;var ee=Ne*gh-Rf*Sf;var Xd=Rf*Ig-jg*gh;var Yd=jg*Sf-Ne*Ig;var uh=Ne*Yd-Rf*Xd;var vh=Rf*ee-jg*Yd;var wh=jg*Xd-Ne*ee;var xh=Sf*Yd-gh*Xd;var Tf=gh*ee-Ig*Yd;var Jg=Ig*Xd-Sf*ee;var Oh=sh*Yd-th*Xd;var hh=th*ee-cj* +Yd;var Ph=cj*Xd-sh*ee;var kg=-1,Uf,bf,Kg=0;var lg=bf=Uf=0;if(0>eh*uh+Bg*vh+Cg*wh){var cf=b.x;var yf=b.y;var Lg=b.z;var Mg=e.x;var Ng=e.y;var Og=e.z;var mg=Mg-cf;var ng=Ng-yf;var og=Og-Lg;var Oe=mg*cf+ng*yf+og*Lg;Oe=-Oe/(mg*mg+ng*ng+og*og);if(0>Oe){c.x=cf;c.y=yf;c.z=Lg;var pg=1}else if(1fh*xh+Dg*Tf+Eg*Jg){var zf=e.x;var qg=e.y;var rg= +e.z;var jh=d.x;var le=d.y;var me=d.z;var Zd=jh-zf;var fe=le-qg;var ge=me-rg;var Md=Zd*zf+fe*qg+ge*rg;Md=-Md/(Zd*Zd+fe*fe+ge*ge);if(0>Md){c.x=zf;c.y=qg;c.z=rg;var ji=1}else if(1kg||djFg*Oh+Gg*hh+Hg*Ph){var Qh=b.x;var Af=b.y;var Vf=b.z;var Rg=d.x;var Fe=d.y;var Wf=d.z;var Pe=Rg-Qh;var Qe=Fe-Af;var Xf=Wf-Vf;var df= +Pe*Qh+Qe*Af+Xf*Vf;df=-df/(Pe*Pe+Qe*Qe+Xf*Xf);if(0>df){c.x=Qh;c.y=Af;c.z=Vf;var sg=1}else if(1kg||khaa||Sge?b>d?(b=Math.sqrt(b-e-d+1),a.x=.5*b,b=.5/b,a.y=(this.e01+this.e10)*b,a.z=(this.e02+this.e20)*b,a.w=(this.e21-this.e12)*b):(b=Math.sqrt(d-b-e+1),a.z=.5*b,b=.5/b,a.x=(this.e02+this.e20)*b,a.y=(this.e12+this.e21)*b,a.w=(this.e10-this.e01)*b):e>d?(b=Math.sqrt(e- +d-b+1),a.y=.5*b,b=.5/b,a.x=(this.e01+this.e10)*b,a.z=(this.e12+this.e21)*b,a.w=(this.e02-this.e20)*b):(b=Math.sqrt(d-b-e+1),a.z=.5*b,b=.5/b,a.x=(this.e02+this.e20)*b,a.y=(this.e12+this.e21)*b,a.w=(this.e10-this.e01)*b);return a};ha.prototype.Va=function(a){var b=Math.sin(a.x),e=Math.sin(a.y),d=Math.sin(a.z),c=Math.cos(a.x),f=Math.cos(a.y);a=Math.cos(a.z);this.e00=f*a;this.e01=-f*d;this.e02=e;this.e10=c*d+a*b*e;this.e11=c*a-b*e*d;this.e12=-f*b;this.e20=b*d-c*a*e;this.e21=a*b+c*e*d;this.e22=c*f;return this}; +ha.prototype.Sc=function(){var a=this.e02;return-1>=a?(a=Math.atan2(this.e21,this.e11),new z(.5*a,-1.570796326794895,.5*-a)):1<=a?(a=Math.atan2(this.e21,this.e11),new z(.5*a,1.570796326794895,.5*a)):new z(Math.atan2(-this.e12,this.e22),Math.asin(a),Math.atan2(-this.e01,this.e00))};ha.prototype.ac=function(a){return 0==a?new z(this.e00,this.e01,this.e02):1==a?new z(this.e10,this.e11,this.e12):2==a?new z(this.e20,this.e21,this.e22):null};ha.prototype.Fb=function(a){return 0==a?new z(this.e00,this.e10, +this.e20):1==a?new z(this.e01,this.e11,this.e21):2==a?new z(this.e02,this.e12,this.e22):null};ha.prototype.bc=function(a,b){0==a?b.Ia(this.e00,this.e01,this.e02):1==a?b.Ia(this.e10,this.e11,this.e12):2==a?b.Ia(this.e20,this.e21,this.e22):b.$()};ha.prototype.Gb=function(a,b){0==a?b.Ia(this.e00,this.e10,this.e20):1==a?b.Ia(this.e01,this.e11,this.e21):2==a?b.Ia(this.e02,this.e12,this.e22):b.$()};ha.prototype.tb=function(a,b,e){this.e00=a.x;this.e01=a.y;this.e02=a.z;this.e10=b.x;this.e11=b.y;this.e12= +b.z;this.e20=e.x;this.e21=e.y;this.e22=e.z;return this};ha.prototype.Wb=function(a,b,e){this.e00=a.x;this.e01=b.x;this.e02=e.x;this.e10=a.y;this.e11=b.y;this.e12=e.y;this.e20=a.z;this.e21=b.z;this.e22=e.z;return this};ha.prototype.toString=function(){return"Mat3["+(0= +a?-1.570796326794895:1<=a?1.570796326794895:Math.asin(a)};Sb.V=function(a){return-1>=a?3.14159265358979:1<=a?0:Math.acos(a)};Sb.atan2=function(a,b){return Math.atan2(a,b)};Sb.sqrt=function(a){return Math.sqrt(a)};Sb.h=function(a,b,e){return ae?e:a};Sb.i=function(){return Math.random()};Sb.C=function(a,b){return a+Math.random()*(b-a)};Sb.M=function(a,b){return new z(a+Math.random()*(b-a),a+Math.random()*(b-a),a+Math.random()*(b-a))};Sb.I=function(){return new z(-1+2*Math.random(),-1+2*Math.random(), +-1+2*Math.random())};ld.prototype.ob=function(){return 0==this.h?new z:this.i[--this.h]};ld.prototype.Wa=function(){return 0==this.I?new ha:this.C[--this.I]};ld.prototype.Ya=function(){return 0==this.Y?new Ea:this.W[--this.Y]};ld.prototype.nb=function(){return 0==this.V?new Hb:this.M[--this.V]};ld.prototype.aa=function(a,b,e,d){if(null!=a){a.$();if(this.h==this.i.length){for(var c=Array(this.h<<1),f=0,h=this.h;fe){e=-e;var d=-a.x;var c=-a.y;var f=-a.z;a=-a.w}else d=a.x,c=a.y,f=a.z,a=a.w;if(.999999e?b>d?(b=Math.sqrt(b-e-d+1),this.x=.5*b,b=.5/b,this.y=(a.e01+a.e10)*b,this.z=(a.e02+a.e20)*b,this.w=(a.e21-a.e12)*b):(b=Math.sqrt(d-b-e+1),this.z=.5*b,b=.5/b,this.x=(a.e02+a.e20)*b,this.y=(a.e12+a.e21)*b,this.w=(a.e10-a.e01)*b):e>d?(b=Math.sqrt(e-d-b+1),this.y=.5*b,b=.5/b,this.x=(a.e01+a.e10)*b,this.z=(a.e12+a.e21)*b,this.w=(a.e02-a.e20)*b):(b=Math.sqrt(d- +b-e+1),this.z=.5*b,b=.5/b,this.x=(a.e02+a.e20)*b,this.y=(a.e12+a.e21)*b,this.w=(a.e10-a.e01)*b);return this};Hb.prototype.Sa=function(){var a=new ha,b=this.x,e=this.y,d=this.z,c=this.w,f=2*b,h=2*e,k=2*d,g=b*f,l=e*h;d*=k;var m=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;a.e00=1-l-d;a.e01=m-c;a.e02=b+h;a.e10=m+c;a.e11=1-g-d;a.e12=e-f;a.e20=b-h;a.e21=e+f;a.e22=1-g-l;return a};Hb.prototype.toString=function(){return"Quat["+(0Ba.contactUseAlternativePositionCorrectionAlgorithmDepthThreshold?Ba.alternativeContactPositionCorrectionAlgorithm:Ba.defaultContactPositionCorrectionAlgorithm, +b.incremental?this.h.W(b,this.J.g,this.K.g):this.h.aa(b,this.J.g,this.K.g)):this.Ra.de();if(this.xd&&!a){b=this.ic.ld;var e=this.jc.ld;b==e&&(e=null);null!=b&&b.beginContact(this);null!=e&&e.beginContact(this)}!this.xd&&a&&(a=this.ic.ld,b=this.jc.ld,a==b&&(b=null),null!=a&&a.endContact(this),null!=b&&b.endContact(this));this.xd&&(a=this.ic.ld,b=this.jc.ld,a==b&&(b=null),null!=a&&a.preSolve(this),null!=b&&b.preSolve(this))}};Hd.prototype.Wh=function(){var a=this.ic.ld,b=this.jc.ld;a==b&&(b=null);null!= +a&&a.postSolve(this);null!=b&&b.postSolve(this)};Hd.prototype.M=function(){return this.ic};Hd.prototype.V=function(){return this.jc};Hd.prototype.vh=function(){return this.xd};Hd.prototype.i=function(){return this.Ra};Hd.prototype.Y=function(){return this.ee};Hd.prototype.I=function(){return this.sa};Hd.prototype.C=function(){return this.U};Ef.prototype.h=function(){return this.zd};Ef.prototype.C=function(){return this.Fc};Ef.prototype.I=function(){return this.sa};Ef.prototype.i=function(){return this.U}; +ug.prototype.I=function(){for(var a=this.nc.Cd;null!=a;){var b=a.U;if(a.Nf.ucg.R&&k.Sg.S&&k.Tg.T&&this.h(d,c)?b.lh=!(f.wah.wa&&f.xah.xa&&f.yah.ya):(d=b.sa,c=b.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b==this.md&&(this.md=this.md.U),b==this.Nd&&(this.Nd=this.Nd.sa),b.U=null,b.sa=null,b.xd&&(d=b.ic.ld,c=b.jc.ld,d==c&&(c=null),null!=d&&d.endContact(b),null!=c&&c.endContact(b)),d=b.Bb.sa,c=b.Bb.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b.Bb==b.J.Zb&&(b.J.Zb=b.J.Zb.U),b.Bb==b.J.oc&&(b.J.oc=b.J.oc.sa),b.Bb.U=null,b.Bb.sa= +null,d=b.Cb.sa,c=b.Cb.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b.Cb==b.K.Zb&&(b.K.Zb=b.K.Zb.U),b.Cb==b.K.oc&&(b.K.oc=b.K.oc.sa),b.Cb.U=null,b.Cb.sa=null,b.J.Pd--,b.K.Pd--,b.Bb.Fc=null,b.Cb.Fc=null,b.Bb.zd=null,b.Cb.zd=null,b.ic=null,b.jc=null,b.J=null,b.K=null,b.xd=!1,b.Eg.de(),b.Ra.de(),b.Yf=null,d=b.ee,d.ic=null,d.jc=null,d.J=null,d.K=null,d.Jg=null,d.Kg=null,b.U=this.$e,this.$e=b,this.pg--)}else b.lh=!0}else d=b.sa,c=b.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b==this.md&&(this.md=this.md.U),b==this.Nd&& +(this.Nd=this.Nd.sa),b.U=null,b.sa=null,b.xd&&(d=b.ic.ld,c=b.jc.ld,d==c&&(c=null),null!=d&&d.endContact(b),null!=c&&c.endContact(b)),d=b.Bb.sa,c=b.Bb.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b.Bb==b.J.Zb&&(b.J.Zb=b.J.Zb.U),b.Bb==b.J.oc&&(b.J.oc=b.J.oc.sa),b.Bb.U=null,b.Bb.sa=null,d=b.Cb.sa,c=b.Cb.U,null!=d&&(d.U=c),null!=c&&(c.sa=d),b.Cb==b.K.Zb&&(b.K.Zb=b.K.Zb.U),b.Cb==b.K.oc&&(b.K.oc=b.K.oc.sa),b.Cb.U=null,b.Cb.sa=null,b.J.Pd--,b.K.Pd--,b.Bb.Fc=null,b.Cb.Fc=null,b.Bb.zd=null,b.Cb.zd=null,b.ic=null, +b.jc=null,b.J=null,b.K=null,b.xd=!1,b.Eg.de(),b.Ra.de(),b.Yf=null,d=b.ee,d.ic=null,d.jc=null,d.J=null,d.K=null,d.Jg=null,d.Kg=null,b.U=this.$e,this.$e=b,this.pg--;b=e}};ug.prototype.h=function(a,b){var e=a.hc,d=b.hc;if(e==d||0!=e.Xb&&0!=d.Xb||0==(a.$g&b.ah)||0==(b.$g&a.ah))return!1;e.Mf=b.Fi&&(b.Ob=!0,b.Kb=0)):b.Kb=0;if(!b.Ob){if(0==b.Xb){e=a*b.gh;d=e*e;e=1/(1+e+d*(.5+.16666666666666666*e+.041666666666666664*d));d=a*b.Xg;var c=d*d;d=1/(1+d+c*(.5+.16666666666666666*d+.041666666666666664*c));c=this.Ma*b.Hf;var f=this.Oa*b.Hf;var h=this.Sa*b.Hf;c+=b.Zf*b.Ab;f+=b.$f*b.Ab;h+=b.ag*b.Ab; +var k=b.ba*b.De+b.ca*b.Ee+b.da*b.Fe;var g=b.ea*b.De+b.fa*b.Ee+b.ga*b.Fe;var l=b.ha*b.De+b.ia*b.Ee+b.ja*b.Fe;b.ub+=c*a;b.vb+=f*a;b.wb+=h*a;b.ub*=e;b.vb*=e;b.wb*=e;b.xb+=k*a;b.yb+=g*a;b.zb+=l*a;b.xb*=d;b.yb*=d;b.zb*=d}b.Di(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.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,c=a.g.G-a.za.G,f=a.g.H-a.za.H,h=a.qc,h.x=d,h.y=c,h.z=f,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=e}}};Mj.prototype.Wa= +function(a,b,e){for(var d=a.dt,c=!0,f=0,h=this.h;fb.D.ta?g:b.D.ta;b.D.ua=l>b.D.ua?l:b.D.ua;b.D.va= +m>b.D.va?m:b.D.va;null!=b.Eb&&(f=b.g.F-b.za.F,h=b.g.G-b.za.G,k=b.g.H-b.za.H,g=b.qc,g.x=f,g.y=h,g.z=k,b.hc.pc.nc.fd(b.Eb,b.D,b.qc));b=c}}};sb.prototype.Va=function(){var a=Nh.h()/1E3;this.Xf.i();ii.broadPhaseCollisionTime=1E3*(Nh.h()/1E3-a);a=Nh.h()/1E3;for(var b=this.Xf.md;null!=b;){var e=b.U;b.lh||b.Oi();b=e}ii.narrowPhaseCollisionTime=1E3*(Nh.h()/1E3-a)};sb.prototype.je=function(){var a=Nh.h()/1E3;if(Ba.disableSleeping)for(var b=this.I;null!=b;)b.Ob=!1,b.Kb=0,b=b.U;if(this.W.length=a.drawBvhMinLevel&&e<=a.drawBvhMaxLevel){var c=this.h,f=0==c.h?new z:c.i[--c.h];c=this.h;c=0==c.h?new z:c.i[--c.h];f.x=b.R;f.y=b.S;f.z=b.T;c.x=b.N;c.y=b.O;c.z=b.P;a.aabb(f,c,d);var h=this.h;if(null!=f){f.$();if(h.h== +h.i.length){for(var k=Array(h.h<<1),g=0,l=h.h;gBa.sleepingTimeThreshold?b.sleepyShapeColor1:b.shapeColor1:e.Ob?b.sleepingShapeColor2:e.Kb>Ba.sleepingTimeThreshold?b.sleepyShapeColor2:b.shapeColor2);if(a.drawShapes){var l=k.Tb,m=k.g;switch(l.Xb){case 0:a.sphere(m,l.lb,f);break;case 1:var n=l,q=this.h,p=0==q.h?new z:q.i[--q.h],r=p;r.x=n.Sd;r.y=n.Td;r.z=n.Ud;a.box(m,p,f);var t=this.h;if(null!=p){p.$();if(t.h==t.i.length){for(var x=Array(t.h<< +1),v=0,B=t.h;vk?a.ellipse(b,e,d,f,f,g):a.arc(b,e,d,f,f,h,k,!0,g)}};sb.prototype.Wb=function(a,b,e,d,c,f){if(dr;){var t=r++,x=Math.cos(l)*f,v=Math.sin(l)*h,B=Math.sqrt(x*x+v*v),H=Math.sin(.5*B),C=Math.cos(.5*B),N=n.$();N.x+=d.x*x;N.y+=d.y*x;N.z+=d.z*x;N.x+=c.x* -v;N.y+=c.y*v;N.z+=c.z*v;x=1/B*H;n.x*=x;n.y*=x;n.z*=x;q.x=n.x;q.y=n.y;q.z=n.z;q.w=C;var y=q.x,A=q.y;H=q.z;v=q.w;var E=2*y,L=2*A;B=2*H;C=y*E;x=A*L;H*=B;N=y*L;A*=B;y*=B;E*=v;L*=v;v*=B;p.e00=1-x-H;p.e01=N-v;p.e02=y+L;p.e10=N+v;p.e11=1-C-H;p.e12=A-E;p.e20=y-L;p.e21=A+E;p.e22=1-C-x;C=this.h;C=0==C.h?new z:C.i[--C.h];C.x+=e.x*k;C.y+=e.y*k;C.z+=e.z*k;x=C.x*p.e10+C.y*p.e11+C.z*p.e12;v=C.x*p.e20+C.y*p.e21+C.z*p.e22;C.x=C.x*p.e00+C.y*p.e01+C.z*p.e02;C.y=x;C.z=v;C.x+=b.x;C.y+=b.y;C.z+=b.z;1<=t&&a.line(m,C,g); +f}f=this.h;if(null!=h){h.$();if(f.h==f.i.length){l=Array(f.h<<1);k=0;for(x=f.h;kr;){var t=r++,x=Math.cos(l)*f,v=Math.sin(l)*h,B=Math.sqrt(x*x+v*v),H=Math.sin(.5*B),C=Math.cos(.5*B),O=n.$();O.x+=d.x*x;O.y+=d.y*x;O.z+=d.z*x;O.x+=c.x* +v;O.y+=c.y*v;O.z+=c.z*v;x=1/B*H;n.x*=x;n.y*=x;n.z*=x;q.x=n.x;q.y=n.y;q.z=n.z;q.w=C;var y=q.x,A=q.y;H=q.z;v=q.w;var E=2*y,M=2*A;B=2*H;C=y*E;x=A*M;H*=B;O=y*M;A*=B;y*=B;E*=v;M*=v;v*=B;p.e00=1-x-H;p.e01=O-v;p.e02=y+M;p.e10=O+v;p.e11=1-C-H;p.e12=A-E;p.e20=y-M;p.e21=A+E;p.e22=1-C-x;C=this.h;C=0==C.h?new z:C.i[--C.h];C.x+=e.x*k;C.y+=e.y*k;C.z+=e.z*k;x=C.x*p.e10+C.y*p.e11+C.z*p.e12;v=C.x*p.e20+C.y*p.e21+C.z*p.e22;C.x=C.x*p.e00+C.y*p.e01+C.z*p.e02;C.y=x;C.z=v;C.x+=b.x;C.y+=b.y;C.z+=b.z;1<=t&&a.line(m,C,g); t=this.h;if(null!=m){m.$();if(t.h==t.i.length){x=Array(t.h<<1);v=0;for(B=t.h;vb||5this.D.wa&&b.xa< +c.Cb==c.K.oc&&(c.K.oc=c.K.oc.sa);c.Cb.U=null;c.Cb.sa=null;c.J.Pd--;c.K.Pd--;c.Bb.Fc=null;c.Cb.Fc=null;c.Bb.zd=null;c.Cb.zd=null;c.ic=null;c.jc=null;c.J=null;c.K=null;c.xd=!1;c.Eg.de();c.Ra.de();c.Yf=null;f=c.ee;f.ic=null;f.jc=null;f.J=null;f.K=null;f.Jg=null;f.Kg=null;c.U=d.$e;d.$e=c;d.pg--}d=e}this.nf--;a=b}this.Wa--};sb.prototype.He=function(a){if(null!=a.pc)throw Error("A joint cannot belong to multiple worlds.");null==this.Y?this.Y=a:(this.Ma.U=a,a.sa=this.Ma);this.Ma=a;a.pc=this;a.Bb.Fc=a.K; +a.Cb.Fc=a.J;null==a.J.Od?a.J.Od=a.Bb:(a.J.fe.U=a.Bb,a.Bb.sa=a.J.fe);a.J.fe=a.Bb;null==a.K.Od?a.K.Od=a.Cb:(a.K.fe.U=a.Cb,a.Cb.sa=a.K.fe);a.K.fe=a.Cb;a.J.Mf++;a.K.Mf++;var b=a.J;b.Ob=!1;b.Kb=0;b=a.K;b.Ob=!1;b.Kb=0;a.Gc();this.Pb++};sb.prototype.yi=function(a){if(a.pc!=this)throw Error("The joint doesn't belong to the world.");var b=a.sa,e=a.U;null!=b&&(b.U=e);null!=e&&(e.sa=b);a==this.Y&&(this.Y=this.Y.U);a==this.Ma&&(this.Ma=this.Ma.sa);a.U=null;a.sa=null;a.pc=null;b=a.Bb.sa;e=a.Bb.U;null!=b&&(b.U= +e);null!=e&&(e.sa=b);a.Bb==a.J.Od&&(a.J.Od=a.J.Od.U);a.Bb==a.J.fe&&(a.J.fe=a.J.fe.sa);a.Bb.U=null;a.Bb.sa=null;b=a.Cb.sa;e=a.Cb.U;null!=b&&(b.U=e);null!=e&&(e.sa=b);a.Cb==a.K.Od&&(a.K.Od=a.K.Od.U);a.Cb==a.K.fe&&(a.K.fe=a.K.fe.sa);a.Cb.U=null;a.Cb.sa=null;a.Bb.Fc=null;a.Cb.Fc=null;a.J.Mf--;a.K.Mf--;b=a.J;b.Ob=!1;b.Kb=0;a=a.K;a.Ob=!1;a.Kb=0;this.Pb--};sb.prototype.mg=function(a){this.qa=a};sb.prototype.vf=function(){return this.qa};sb.prototype.sf=function(){null!=this.qa&&(2==this.nc.Xb&&this.ac(this.qa, +this.nc.h),this.Ed(this.qa),this.bc(this.qa))};sb.prototype.yd=function(a,b,e){var d=this.nb.h;d.x=a.x;d.y=a.y;d.z=a.z;d=this.nb.end;d.x=b.x;d.y=b.y;d.z=b.z;this.nb.i=e;this.nc.yd(a,b,this.nb)};sb.prototype.tb=function(a,b,e,d){this.Sa.M=a;var c=this.Sa.h;c.F=b.F;c.G=b.G;c.H=b.H;c.A=b.A;c.j=b.j;c.m=b.m;c.o=b.o;c.v=b.v;c.s=b.s;c.u=b.u;c.l=b.l;c.B=b.B;c=this.Sa.I;c.x=e.x;c.y=e.y;c.z=e.z;this.Sa.i=d;this.nc.aa(a,b,e,this.Sa)};sb.prototype.Xa=function(a,b){this.ob.D.Dd(a);this.ob.h=b;this.nc.Y(a,this.ob)}; +sb.prototype.gd=function(){return this.I};sb.prototype.yf=function(){return this.Y};sb.prototype.tf=function(){return this.nc};sb.prototype.uf=function(){return this.Xf};sb.prototype.Af=function(){return this.Wa};sb.prototype.tc=function(){return this.Pb};sb.prototype.Fb=function(){return this.nf};sb.prototype.zf=function(){return this.Ya};sb.prototype.yc=function(){return this.Sb};sb.prototype.Vg=function(a){this.Sb=a};sb.prototype.vd=function(){return this.Rb};sb.prototype.wd=function(a){this.Rb= +a};sb.prototype.wf=function(){return this.Jb};sb.prototype.jd=function(a){var b=this.Jb;b.x=a.x;b.y=a.y;b.z=a.z};rl(Hk,Cj);Hk.prototype.process=function(a){a=a.userData;a.Tb.yd(this.h,this.end,a.g,this.C)&&this.i.process(a,this.C)};rl(Gk,Cj);Gk.prototype.process=function(a){a=a.userData;var b=a.Tb.Xb;0>b||5this.D.wa&&b.xa< this.D.ua&&b.ua>this.D.xa&&b.yathis.D.ya&&this.h.process(a)};bl.prototype.process=function(){};ak.prototype.beginContact=function(){};ak.prototype.preSolve=function(){};ak.prototype.postSolve=function(){};ak.prototype.endContact=function(){};Ek.prototype.process=function(){};rl(aj,Ek);aj.prototype.clear=function(){this.shape=null;this.fraction=1;this.position.$();this.normal.$();this.hit=!1};aj.prototype.process=function(a,b){if(b.fractione&&(e= -e);d=e/.5235987755982984+.5|0;0==d&&(d=1);e=f;h=(h-f)/d;c=this.h;c=0==c.h?new z:c.i[--c.h];c.x=a.x;c.y=a.y;c.z=a.z;var m=Math.cos(f);c.x+=l.x*m;c.y+=l.y*m;c.z+=l.z*m;f=Math.sin(f);c.x+=b.x*f;c.y+=b.y*f;c.z+=b.z*f;f=c;k&&this.line(a,c,g);for(c=0;cDa;){var X=Da++,fa=this.I[X],w=this.V[X];fa.x=w.x;fa.y=w.y;fa.z= -w.z;fa.x*=la;fa.y*=la;fa.z*=la;fa.y+=qa;var ja=this.I[X],ea=ja.x*p.e10+ja.y*p.e11+ja.z*p.e12,U=ja.x*p.e20+ja.y*p.e21+ja.z*p.e22;ja.x=ja.x*p.e00+ja.y*p.e01+ja.z*p.e02;ja.y=ea;ja.z=U;var ba=this.C[X],Fa=this.aa[X];ba.x=Fa.x;ba.y=Fa.y;ba.z=Fa.z;ba.x*=la;ba.y*=la;ba.z*=la;ba.y+=qa;var ka=this.C[X],Qa=ka.x*p.e10+ka.y*p.e11+ka.z*p.e12,Ka=ka.x*p.e20+ka.y*p.e21+ka.z*p.e22;ka.x=ka.x*p.e00+ka.y*p.e01+ka.z*p.e02;ka.y=Qa;ka.z=Ka;var V=this.i[X],ob=this.V[X];V.x=ob.x;V.y=ob.y;V.z=ob.z;var Za=V.x*p.e10+V.y*p.e11+ -V.z*p.e12,W=V.x*p.e20+V.y*p.e21+V.z*p.e22;V.x=V.x*p.e00+V.y*p.e01+V.z*p.e02;V.y=Za;V.z=W;V.x*=b;V.y*=b;V.z*=b;V.x+=n.x;V.y+=n.y;V.z+=n.z;var ha=this.i[X],I=-e;ha.x+=k.x*I;ha.y+=k.y*I;ha.z+=k.z*I}for(var na=0;8>na;){var ca=na++,da=this.i[ca],Z=this.i[(ca+1)%8],oa=this.C[ca];this.triangle(t,da,Z,oa,this.I[ca],this.I[(ca+1)%8],d);da=this.i[(ca+1)%8];Z=this.i[ca];var xb=this.h,hb=0==xb.h?new z:xb.i[--xb.h];hb.x=k.x;hb.y=k.y;hb.z=k.z;var fb=hb;fb.x=-fb.x;fb.y=-fb.y;fb.z=-fb.z;oa=fb;this.triangle(v,da, -Z,fb,fb,fb,d);var gb=this.h;if(null!=fb){fb.$();if(gb.h==gb.i.length){for(var pb=Array(gb.h<<1),ab=0,$a=gb.h;ab<$a;){var ua=ab++;pb[ua]=gb.i[ua];gb.i[ua]=null}gb.i=pb}gb.i[gb.h++]=fb}}}var Ya=this.h;if(null!=t){t.$();if(Ya.h==Ya.i.length){for(var Fb=Array(Ya.h<<1),Xa=0,Bb=Ya.h;Xa -pb;){var ab=pb++,$a=this.I[ab],ua=this.V[ab];$a.x=ua.x;$a.y=ua.y;$a.z=ua.z;var Ya=$a.x*p.e10+$a.y*p.e11+$a.z*p.e12,Fb=$a.x*p.e20+$a.y*p.e21+$a.z*p.e22;$a.x=$a.x*p.e00+$a.y*p.e01+$a.z*p.e02;$a.y=Ya;$a.z=Fb;var Xa=this.C[ab],Bb=this.I[ab];Xa.x=Bb.x;Xa.y=Bb.y;Xa.z=Bb.z;Xa.x*=b;Xa.y*=b;Xa.z*=b;Xa.x+=n.x;Xa.y+=n.y;Xa.z+=n.z;var Wa=this.i[ab],Cb=this.C[ab];Wa.x=Cb.x;Wa.y=Cb.y;Wa.z=Cb.z;var qb=this.C[ab];qb.x+=k.x*e;qb.y+=k.y*e;qb.z+=k.z*e;var bb=this.i[ab],ib=-e;bb.x+=k.x*ib;bb.y+=k.y*ib;bb.z+=k.z*ib}for(var rb= -0;8>rb;){var db=rb++,Db=t,jb=this.C[db],nb=this.C[(db+1)%8],cb=k;this.triangle(t,jb,nb,cb,cb,cb,d);Db=v;jb=this.i[(db+1)%8];nb=this.i[db];var Jb=this.h,Kb=0==Jb.h?new z:Jb.i[--Jb.h];Kb.x=k.x;Kb.y=k.y;Kb.z=k.z;var F=Kb;F.x=-F.x;F.y=-F.y;F.z=-F.z;cb=F;this.triangle(v,jb,nb,F,F,F,d);var ub=this.h;if(null!=F){F.$();if(ub.h==ub.i.length){for(var lb=Array(ub.h<<1),yb=0,vb=ub.h;ybx;)for(var v=x++,B=this.M[v].length,H=0;HL;){var G=L++;if(0==G)for(var P=0;3>P;)for(var K=P++,pa=this.M[K].length, -M=0;MRa;)for(var wa=Ra++,La=this.M[wa].length,Ea=0;EaVa;){var D=Va++,Aa=void 0,aa=void 0,Ua=void 0,xa=void 0,Ja=void 0,S=void 0,la=void 0, -qa=void 0;0==G?this.wireframe?(Aa=r[0][0],aa=r[1][D],this.line(Aa,aa,d)):(Aa=r[0][0],aa=r[1][D],Ua=r[1][(D+1)%8],Ja=t[0][0],S=t[1][D],la=t[1][(D+1)%8],this.triangle(Aa,aa,Ua,Ja,S,la,d)):3==G?this.wireframe?(Aa=r[4][0],aa=r[G][(D+1)%8],Ua=r[G][D],this.line(Aa,aa,d),this.line(aa,Ua,d)):(Aa=r[4][0],aa=r[G][(D+1)%8],Ua=r[G][D],Ja=t[4][0],S=t[G][(D+1)%8],la=t[G][D],this.triangle(Aa,aa,Ua,Ja,S,la,d)):this.wireframe?(Aa=r[G][D],aa=r[G][(D+1)%8],Ua=r[G+1][D],this.line(Aa,aa,d),this.line(Aa,Ua,d)):(Aa=r[G][D], -aa=r[G][(D+1)%8],Ua=r[G+1][D],xa=r[G+1][(D+1)%8],Ja=t[G][D],S=t[G][(D+1)%8],la=t[G+1][D],qa=t[G+1][(D+1)%8],this.rect(Aa,Ua,xa,aa,Ja,la,qa,S,d))}}var Da=this.h,X=0==Da.h?new z:Da.i[--Da.h];X.x=n.x;X.y=n.y;X.z=n.z;X.x+=k.x*e;X.y+=k.y*e;X.z+=k.z*e;var fa=this.h,w=0==fa.h?new z:fa.i[--fa.h];w.x=n.x;w.y=n.y;w.z=n.z;var ja=-e;w.x+=k.x*ja;w.y+=k.y*ja;w.z+=k.z*ja;if(this.wireframe){var ea=this.h,U=0==ea.h?new z:ea.i[--ea.h];U.x=X.x;U.y=X.y;U.z=X.z;var ba=-b;U.x+=f.x*ba;U.y+=f.y*ba;U.z+=f.z*ba;U.x+=0*l.x; -U.y+=0*l.y;U.z+=0*l.z;var Fa=this.h,ka=0==Fa.h?new z:Fa.i[--Fa.h];ka.x=X.x;ka.y=X.y;ka.z=X.z;ka.x+=f.x*b;ka.y+=f.y*b;ka.z+=f.z*b;ka.x+=0*l.x;ka.y+=0*l.y;ka.z+=0*l.z;var Qa=this.h,Ka=0==Qa.h?new z:Qa.i[--Qa.h];Ka.x=X.x;Ka.y=X.y;Ka.z=X.z;Ka.x+=0*f.x;Ka.y+=0*f.y;Ka.z+=0*f.z;var V=-b;Ka.x+=l.x*V;Ka.y+=l.y*V;Ka.z+=l.z*V;var ob=this.h,Za=0==ob.h?new z:ob.i[--ob.h];Za.x=X.x;Za.y=X.y;Za.z=X.z;Za.x+=0*f.x;Za.y+=0*f.y;Za.z+=0*f.z;Za.x+=l.x*b;Za.y+=l.y*b;Za.z+=l.z*b;var W=this.h,ha=0==W.h?new z:W.i[--W.h];ha.x= -w.x;ha.y=w.y;ha.z=w.z;var I=-b;ha.x+=f.x*I;ha.y+=f.y*I;ha.z+=f.z*I;ha.x+=0*l.x;ha.y+=0*l.y;ha.z+=0*l.z;var na=this.h,ca=0==na.h?new z:na.i[--na.h];ca.x=w.x;ca.y=w.y;ca.z=w.z;ca.x+=f.x*b;ca.y+=f.y*b;ca.z+=f.z*b;ca.x+=0*l.x;ca.y+=0*l.y;ca.z+=0*l.z;var da=this.h,Z=0==da.h?new z:da.i[--da.h];Z.x=w.x;Z.y=w.y;Z.z=w.z;Z.x+=0*f.x;Z.y+=0*f.y;Z.z+=0*f.z;var oa=-b;Z.x+=l.x*oa;Z.y+=l.y*oa;Z.z+=l.z*oa;var xb=this.h,hb=0==xb.h?new z:xb.i[--xb.h];hb.x=w.x;hb.y=w.y;hb.z=w.z;hb.x+=0*f.x;hb.y+=0*f.y;hb.z+=0*f.z;hb.x+= -l.x*b;hb.y+=l.y*b;hb.z+=l.z*b;this.ellipse(X,f,l,b,b,d);this.ellipse(w,f,l,b,b,d);this.line(U,ha,d);this.line(ka,ca,d);this.line(Ka,Z,d);this.line(Za,hb,d);var fb=this.h;if(null!=U){U.$();if(fb.h==fb.i.length){for(var gb=Array(fb.h<<1),pb=0,ab=fb.h;pb -sb;){var Hb=sb++,Ba=this.I[Hb],Ta=this.V[Hb];Ba.x=Ta.x;Ba.y=Ta.y;Ba.z=Ta.z;var sa=Ba.x*p.e10+Ba.y*p.e11+Ba.z*p.e12,Ga=Ba.x*p.e20+Ba.y*p.e21+Ba.z*p.e22;Ba.x=Ba.x*p.e00+Ba.y*p.e01+Ba.z*p.e02;Ba.y=sa;Ba.z=Ga;var Q=this.C[Hb],Ma=this.I[Hb];Q.x=Ma.x;Q.y=Ma.y;Q.z=Ma.z;Q.x*=b;Q.y*=b;Q.z*=b;Q.x+=n.x;Q.y+=n.y;Q.z+=n.z;var Ia=this.i[Hb],Eb=this.C[Hb];Ia.x=Eb.x;Ia.y=Eb.y;Ia.z=Eb.z;var wb=this.C[Hb];wb.x+=k.x*e;wb.y+=k.y*e;wb.z+=k.z*e;var Mb=this.i[Hb],Ib=-e;Mb.x+=k.x*Ib;Mb.y+=k.y*Ib;Mb.z+=k.z*Ib}for(var Tb= -0;8>Tb;){var Rb=Tb++,Wb=this.I[Rb],mc=this.I[(Rb+1)%8];this.rect(this.C[Rb],this.i[Rb],this.i[(Rb+1)%8],this.C[(Rb+1)%8],Wb,Wb,mc,mc,d)}}var Xb=this.h;if(null!=X){X.$();if(Xb.h==Xb.i.length){for(var ic=Array(Xb.h<<1),bc=0,$b=Xb.h;bc<$b;){var Zb=bc++;ic[Zb]=Xb.i[Zb];Xb.i[Zb]=null}Xb.i=ic}Xb.i[Xb.h++]=X}var Qb=this.h;if(null!=w){w.$();if(Qb.h==Qb.i.length){for(var jc=Array(Qb.h<<1),ac=0,ec=Qb.h;acCa;){var V=Ca++,fa=this.I[V],w=this.V[V];fa.x=w.x;fa.y=w.y;fa.z=w.z;fa.x*= +ka;fa.y*=ka;fa.z*=ka;fa.y+=pa;var ta=this.I[V],Ga=ta.x*p.e10+ta.y*p.e11+ta.z*p.e12,da=ta.x*p.e20+ta.y*p.e21+ta.z*p.e22;ta.x=ta.x*p.e00+ta.y*p.e01+ta.z*p.e02;ta.y=Ga;ta.z=da;var W=this.C[V],sa=this.aa[V];W.x=sa.x;W.y=sa.y;W.z=sa.z;W.x*=ka;W.y*=ka;W.z*=ka;W.y+=pa;var la=this.C[V],Oa=la.x*p.e10+la.y*p.e11+la.z*p.e12,ab=la.x*p.e20+la.y*p.e21+la.z*p.e22;la.x=la.x*p.e00+la.y*p.e01+la.z*p.e02;la.y=Oa;la.z=ab;var ja=this.i[V],ob=this.V[V];ja.x=ob.x;ja.y=ob.y;ja.z=ob.z;var Ha=ja.x*p.e10+ja.y*p.e11+ja.z*p.e12, +I=ja.x*p.e20+ja.y*p.e21+ja.z*p.e22;ja.x=ja.x*p.e00+ja.y*p.e01+ja.z*p.e02;ja.y=Ha;ja.z=I;ja.x*=b;ja.y*=b;ja.z*=b;ja.x+=n.x;ja.y+=n.y;ja.z+=n.z;var Ka=this.i[V],P=-e;Ka.x+=k.x*P;Ka.y+=k.y*P;Ka.z+=k.z*P}for(var na=0;8>na;){var ba=na++,ea=this.i[ba],X=this.i[(ba+1)%8];this.triangle(t,ea,X,this.C[ba],this.I[ba],this.I[(ba+1)%8],d);ea=this.i[(ba+1)%8];X=this.i[ba];var ma=this.h,xb=0==ma.h?new z:ma.i[--ma.h];xb.x=k.x;xb.y=k.y;xb.z=k.z;var Za=xb;Za.x=-Za.x;Za.y=-Za.y;Za.z=-Za.z;this.triangle(v,ea,X,Za,Za, +Za,d);var ib=this.h;if(null!=Za){Za.$();if(ib.h==ib.i.length){for(var qb=Array(ib.h<<1),lb=0,bb=ib.h;lblb;){var bb= +lb++,$a=this.I[bb],qa=this.V[bb];$a.x=qa.x;$a.y=qa.y;$a.z=qa.z;var mb=$a.x*p.e10+$a.y*p.e11+$a.z*p.e12,Db=$a.x*p.e20+$a.y*p.e21+$a.z*p.e22;$a.x=$a.x*p.e00+$a.y*p.e01+$a.z*p.e02;$a.y=mb;$a.z=Db;var Xa=this.C[bb],tb=this.I[bb];Xa.x=tb.x;Xa.y=tb.y;Xa.z=tb.z;Xa.x*=b;Xa.y*=b;Xa.z*=b;Xa.x+=n.x;Xa.y+=n.y;Xa.z+=n.z;var Ma=this.i[bb],Eb=this.C[bb];Ma.x=Eb.x;Ma.y=Eb.y;Ma.z=Eb.z;var ub=this.C[bb];ub.x+=k.x*e;ub.y+=k.y*e;ub.z+=k.z*e;var fb=this.i[bb],db=-e;fb.x+=k.x*db;fb.y+=k.y*db;fb.z+=k.z*db}for(var gb=0;8> +gb;){var jb=gb++,Bb=t,kb=this.C[jb],nb=this.C[(jb+1)%8],Ya=k;this.triangle(t,kb,nb,Ya,Ya,Ya,d);Bb=v;kb=this.i[(jb+1)%8];nb=this.i[jb];var Nb=this.h,Lb=0==Nb.h?new z:Nb.i[--Nb.h];Lb.x=k.x;Lb.y=k.y;Lb.z=k.z;var F=Lb;F.x=-F.x;F.y=-F.y;F.z=-F.z;Ya=F;this.triangle(v,kb,nb,F,F,F,d);var pb=this.h;if(null!=F){F.$();if(pb.h==pb.i.length){for(var cb=Array(pb.h<<1),Fb=0,wb=pb.h;Fbx;)for(var v=x++,B=this.M[v].length,H=0;HM;){var G=M++;if(0==G)for(var R=0;3>R;)for(var K=R++,oa=this.M[K].length, +N=0;NSa;)for(var Aa=Sa++,La=this.M[Aa].length,Fa=0;FaVa;){var D=Va++,za=void 0,aa=void 0,Ta=void 0,ca=void 0,ia=void 0,T=void 0,ka=void 0,pa=void 0; +0==G?this.wireframe?(za=r[0][0],aa=r[1][D],this.line(za,aa,d)):(za=r[0][0],aa=r[1][D],Ta=r[1][(D+1)%8],ia=t[0][0],T=t[1][D],ka=t[1][(D+1)%8],this.triangle(za,aa,Ta,ia,T,ka,d)):3==G?this.wireframe?(za=r[4][0],aa=r[G][(D+1)%8],Ta=r[G][D],this.line(za,aa,d),this.line(aa,Ta,d)):(za=r[4][0],aa=r[G][(D+1)%8],Ta=r[G][D],ia=t[4][0],T=t[G][(D+1)%8],ka=t[G][D],this.triangle(za,aa,Ta,ia,T,ka,d)):this.wireframe?(za=r[G][D],aa=r[G][(D+1)%8],Ta=r[G+1][D],this.line(za,aa,d),this.line(za,Ta,d)):(za=r[G][D],aa=r[G][(D+ +1)%8],Ta=r[G+1][D],ca=r[G+1][(D+1)%8],ia=t[G][D],T=t[G][(D+1)%8],ka=t[G+1][D],pa=t[G+1][(D+1)%8],this.rect(za,Ta,ca,aa,ia,ka,pa,T,d))}}var Ca=this.h,V=0==Ca.h?new z:Ca.i[--Ca.h];V.x=n.x;V.y=n.y;V.z=n.z;V.x+=k.x*e;V.y+=k.y*e;V.z+=k.z*e;var fa=this.h,w=0==fa.h?new z:fa.i[--fa.h];w.x=n.x;w.y=n.y;w.z=n.z;var ta=-e;w.x+=k.x*ta;w.y+=k.y*ta;w.z+=k.z*ta;if(this.wireframe){var Ga=this.h,da=0==Ga.h?new z:Ga.i[--Ga.h];da.x=V.x;da.y=V.y;da.z=V.z;var W=-b;da.x+=f.x*W;da.y+=f.y*W;da.z+=f.z*W;da.x+=0*l.x;da.y+= +0*l.y;da.z+=0*l.z;var sa=this.h,la=0==sa.h?new z:sa.i[--sa.h];la.x=V.x;la.y=V.y;la.z=V.z;la.x+=f.x*b;la.y+=f.y*b;la.z+=f.z*b;la.x+=0*l.x;la.y+=0*l.y;la.z+=0*l.z;var Oa=this.h,ab=0==Oa.h?new z:Oa.i[--Oa.h];ab.x=V.x;ab.y=V.y;ab.z=V.z;ab.x+=0*f.x;ab.y+=0*f.y;ab.z+=0*f.z;var ja=-b;ab.x+=l.x*ja;ab.y+=l.y*ja;ab.z+=l.z*ja;var ob=this.h,Ha=0==ob.h?new z:ob.i[--ob.h];Ha.x=V.x;Ha.y=V.y;Ha.z=V.z;Ha.x+=0*f.x;Ha.y+=0*f.y;Ha.z+=0*f.z;Ha.x+=l.x*b;Ha.y+=l.y*b;Ha.z+=l.z*b;var I=this.h,Ka=0==I.h?new z:I.i[--I.h];Ka.x= +w.x;Ka.y=w.y;Ka.z=w.z;var P=-b;Ka.x+=f.x*P;Ka.y+=f.y*P;Ka.z+=f.z*P;Ka.x+=0*l.x;Ka.y+=0*l.y;Ka.z+=0*l.z;var na=this.h,ba=0==na.h?new z:na.i[--na.h];ba.x=w.x;ba.y=w.y;ba.z=w.z;ba.x+=f.x*b;ba.y+=f.y*b;ba.z+=f.z*b;ba.x+=0*l.x;ba.y+=0*l.y;ba.z+=0*l.z;var ea=this.h,X=0==ea.h?new z:ea.i[--ea.h];X.x=w.x;X.y=w.y;X.z=w.z;X.x+=0*f.x;X.y+=0*f.y;X.z+=0*f.z;var ma=-b;X.x+=l.x*ma;X.y+=l.y*ma;X.z+=l.z*ma;var xb=this.h,Za=0==xb.h?new z:xb.i[--xb.h];Za.x=w.x;Za.y=w.y;Za.z=w.z;Za.x+=0*f.x;Za.y+=0*f.y;Za.z+=0*f.z;Za.x+= +l.x*b;Za.y+=l.y*b;Za.z+=l.z*b;this.ellipse(V,f,l,b,b,d);this.ellipse(w,f,l,b,b,d);this.line(da,Ka,d);this.line(la,ba,d);this.line(ab,X,d);this.line(Ha,Za,d);var ib=this.h;if(null!=da){da.$();if(ib.h==ib.i.length){for(var qb=Array(ib.h<<1),lb=0,bb=ib.h;lb +yb;){var Jb=yb++,ua=this.I[Jb],Qa=this.V[Jb];ua.x=Qa.x;ua.y=Qa.y;ua.z=Qa.z;var wa=ua.x*p.e10+ua.y*p.e11+ua.z*p.e12,Da=ua.x*p.e20+ua.y*p.e21+ua.z*p.e22;ua.x=ua.x*p.e00+ua.y*p.e01+ua.z*p.e02;ua.y=wa;ua.z=Da;var S=this.C[Jb],Na=this.I[Jb];S.x=Na.x;S.y=Na.y;S.z=Na.z;S.x*=b;S.y*=b;S.z*=b;S.x+=n.x;S.y+=n.y;S.z+=n.z;var Ia=this.i[Jb],Cb=this.C[Jb];Ia.x=Cb.x;Ia.y=Cb.y;Ia.z=Cb.z;var vb=this.C[Jb];vb.x+=k.x*e;vb.y+=k.y*e;vb.z+=k.z*e;var Kb=this.i[Jb],Gb=-e;Kb.x+=k.x*Gb;Kb.y+=k.y*Gb;Kb.z+=k.z*Gb}for(var Vb= +0;8>Vb;){var Rb=Vb++,Wb=this.I[Rb],nc=this.I[(Rb+1)%8];this.rect(this.C[Rb],this.i[Rb],this.i[(Rb+1)%8],this.C[(Rb+1)%8],Wb,Wb,nc,nc,d)}}var ac=this.h;if(null!=V){V.$();if(ac.h==ac.i.length){for(var gc=Array(ac.h<<1),cc=0,Tb=ac.h;cch;)for(var k=h++,g=this.M[k].length,l=0;lb;)for(h=b++,k=0;8>k;){var r=k++;if(0==h)if(this.wireframe)g=a[0][0], l=a[1][r],this.line(g,l,e);else{g=a[0][0];l=a[1][r];m=a[1][(r+1)%8];q=f[0][0];p=f[1][r];var t=f[1][(r+1)%8];this.triangle(g,l,m,q,p,t,e)}else 3==h?this.wireframe?(g=a[4][0],l=a[h][(r+1)%8],m=a[h][r],this.line(g,l,e),this.line(l,m,e)):(g=a[4][0],l=a[h][(r+1)%8],m=a[h][r],q=f[4][0],p=f[h][(r+1)%8],t=f[h][r],this.triangle(g,l,m,q,p,t,e)):this.wireframe?(g=a[h][r],l=a[h][(r+1)%8],m=a[h+1][r],this.line(g,l,e),this.line(g,m,e)):(g=a[h][r],l=a[h][(r+1)%8],m=a[h+1][r],n=a[h+1][(r+1)%8],q=f[h][r],p=f[h][(r+ 1)%8],t=f[h+1][r],r=f[h+1][(r+1)%8],this.rect(g,m,n,l,q,t,r,p,e))}e=this.h;if(null!=c){c.$();if(e.h==e.i.length){a=Array(e.h<<1);f=0;for(b=e.h;ft.zc)t.ve=!0,t=t.Ad,t.Hc=0,t.xc=0,t.wc=0,t.Hb=0,t.ge=0,t.he=0,t.ie=0;else{t.ve=!1;var x=b.rows[b.La++]; -x.friction=n;x.Ua=0;var v=x.Ve;v.Ba=e;v.Ca=d;v.Da=c;v.Fa=e;v.Ga=d;v.Ha=c;v.ka=t.Mb*c-t.Nb*d;v.la=t.Nb*e-t.Lb*c;v.ma=t.Lb*d-t.Mb*e;v.na=t.lc*c-t.mc*d;v.oa=t.mc*e-t.kc*c;v.pa=t.kc*d-t.lc*e;v=x.Ug;v.Ba=f;v.Ca=h;v.Da=k;v.Fa=f;v.Ga=h;v.Ha=k;v.ka=t.Mb*k-t.Nb*h;v.la=t.Nb*f-t.Lb*k;v.ma=t.Lb*h-t.Mb*f;v.na=t.lc*k-t.mc*h;v.oa=t.mc*f-t.kc*k;v.pa=t.kc*h-t.lc*f;v=x.Tg;v.Ba=g;v.Ca=l;v.Da=m;v.Fa=g;v.Ga=l;v.Ha=m;v.ka=t.Mb*m-t.Nb*l;v.la=t.Nb*g-t.Lb*m;v.ma=t.Lb*l-t.Mb*g;v.na=t.lc*m-t.mc*l;v.oa=t.mc*g-t.kc*m;v.pa=t.kc* -l-t.lc*g;v=x.Ve;v=v.Ba*this.J.ub+v.Ca*this.J.vb+v.Da*this.J.wb+(v.ka*this.J.xb+v.la*this.J.yb+v.ma*this.J.zb)-(v.Fa*this.K.ub+v.Ga*this.K.vb+v.Ha*this.K.wb+(v.na*this.K.xb+v.oa*this.K.yb+v.pa*this.K.zb));x.Na=v<-ra.contactEnableBounceThreshold&&!t.Xd?-v*q:0;this.pf==Fh.BAUMGARTE&&t.zc>ra.linearSlop&&(v=(t.zc-ra.linearSlop)*ra.velocityBaumgarte*a.invDt,x.Nak.Na&&(k.Na=0);k.Aa=h.Ad}}};af.prototype.Wh=function(){this.Ra.Di(this.Jg,this.Kg)};af.prototype.i=function(){return this.ic};af.prototype.C=function(){return this.jc};af.prototype.h= -function(){return this.Ra};af.prototype.th=function(){for(var a=0,b=this.Ra.Bd;ara.contactPersistenceThreshold?this.C(a):(e+=this.Ra.kf*-c,d+=this.Ra.lf*-c,b+=this.Ra.mf*-c,e*e+d*d+b*b>ra.contactPersistenceThreshold*ra.contactPersistenceThreshold&&this.C(a))}};$i.prototype.C=function(a){var b=--this.Ra.Bd;if(a!=b){var e=this.Ra.rc[a];this.Ra.rc[a]=this.Ra.rc[b];this.Ra.rc[b]=e}a=this.Ra.rc[b];a.we=0;a.xe=0;a.ye=0;a.ze=0;a.Ae= -0;a.Be=0;a.Lb=0;a.Mb=0;a.Nb=0;a.kc=0;a.lc=0;a.mc=0;a.od=0;a.pd=0;a.qd=0;a.rd=0;a.sd=0;a.td=0;a.zc=0;b=a.Ad;b.Hc=0;b.xc=0;b.wc=0;b.Hb=0;b.ge=0;b.he=0;b.ie=0;a.Xd=!1;a.ve=!1;a.uc=-1};$i.prototype.I=function(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++};$i.prototype.M=function(a,b){var e=this.Ra.rc[0],d=this.Ra.rc[1],c=this.Ra.rc[2],f=this.Ra.rc[3],h=e.zc,k=0;d.zc>h&&(h=d.zc,k=1);c.zc>h&&(h=c.zc,k=2);f.zc>h&&(h=f.zc,k=3);var g=a.position1;var l=g.x;var m=g.y;var n=g.z;l-=b.F; -m-=b.G;n-=b.H;var q=d.Lb,p=d.Mb,r=d.Nb,t=c.Lb,x=c.Mb,v=c.Nb,B=f.Lb,H=f.Mb,C=f.Nb;var N=t-q;var y=x-p;var A=v-r;var E=l-B;var L=m-H;var G=n-C;var P=B-q;var K=H-p;var pa=C-r;var M=l-t;var Sa=m-x;var Pa=n-v;var Ca=l-q;var Ra=m-p;var wa=n-r;var La=B-t;var Ea=H-x;var O=C-v;var ma=y*G-A*L;var Y=A*E-N*G;var ta=N*L-y*E;var Va=K*Pa-pa*Sa;var D=pa*M-P*Pa;var Aa=P*Sa-K*M;var aa=Ra*O-wa*Ea;var Ua=wa*La-Ca*O;var xa=Ca*Ea-Ra*La;var Ja=ma*ma+Y*Y+ta*ta,S=Va*Va+D*D+Aa*Aa,la=aa*aa+Ua*Ua+xa*xa,qa=e.Lb,Da=e.Mb,X=e.Nb, -fa=c.Lb,w=c.Mb,ja=c.Nb,ea=f.Lb,U=f.Mb,ba=f.Nb;var Fa=fa-qa;var ka=w-Da;var Qa=ja-X;var Ka=l-ea;var V=m-U;var ob=n-ba;var Za=ea-qa;var W=U-Da;var ha=ba-X;var I=l-fa;var na=m-w;var ca=n-ja;var da=l-qa;var Z=m-Da;var oa=n-X;var xb=ea-fa;var hb=U-w;var fb=ba-ja;var gb=ka*ob-Qa*V;var pb=Qa*Ka-Fa*ob;var ab=Fa*V-ka*Ka;var $a=W*ca-ha*na;var ua=ha*I-Za*ca;var Ya=Za*na-W*I;var Fb=Z*fb-oa*hb;var Xa=oa*xb-da*fb;var Bb=da*hb-Z*xb;var Wa=gb*gb+pb*pb+ab*ab,Cb=$a*$a+ua*ua+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c-ed*Kc;var fd=sc*sc+Lc*Lc+zd*zd,Sc=Rc*Rc+Wc*Wc+Dc*Dc,pd=Ec*Ec+od*od+hc*hc,Gd=fd>Sc?fd>pd?fd:pd:Sc>pd?Sc:pd,Tc=Ja>S?Ja>la?Ja:la:S>la?S:la,Pd=0;if(bb>Tc&&1!=k||0==k)Tc=bb,Pd=1;Tb>Tc&&2!=k&&(Tc=Tb,Pd=2);Gd>Tc&&3!=k&&(Tc=Gd,Pd=3);return Pd};$i.prototype.V=function(a,b,e){for(var d=ra.contactPersistenceThreshold*ra.contactPersistenceThreshold,c=-1,f=0,h=this.Ra.Bd;fb){a=this.i;var e=this.C;var d=this.I;b=a*a;var c=e*e;var f=d*d;bd?(a=this.i,b=this.C,e=this.I,d=a*a,c=b*b,f=e*e,dg?b=l=e=0:f==g?(e=-Infinity,l=Infinity,b-=f):bg?(e=0,l=Infinity,b=b-g-k,0>b&&(b=0)):b=l=e=0;a.Qa=e;a.Pa=l;a.Ua=c*(0==d?0:1/d);a.Na=b*h};za.prototype.Ed=function(a,b,e,d,c,f,h){var k=ra.angularSlop;if(h)c=0,h=1;else{if(0e?b=g=l=0:f==e?(l=-Infinity,g=Infinity,b-=f):be?(l=0,g=Infinity,b=b-e-k,0>b&&(b=0)):b=g=l=0;a.Qa=l;a.Pa=g;a.Ua=c*(0==d?0:1/d);a.Na=b*h};za.prototype.ce=function(a, -b){return b?1:this.pf==Fh.BAUMGARTE?a.invDt*ra.velocityBaumgarte:0};za.prototype.Sc=function(a,b,e){var d=(this.J.ba*a+this.J.ca*b+this.J.da*e)*a+(this.J.ea*a+this.J.fa*b+this.J.ga*e)*b+(this.J.ha*a+this.J.ia*b+this.J.ja*e)*e,c=(this.K.ba*a+this.K.ca*b+this.K.da*e)*a+(this.K.ea*a+this.K.fa*b+this.K.ga*e)*b+(this.K.ha*a+this.K.ia*b+this.K.ja*e)*e;if(0this.rf*this.rf?this.pc.wi(this):0this.sf*this.sf&&this.pc.wi(this)};za.prototype.ei=function(){return this.J};za.prototype.fi=function(){return this.K};za.prototype.yi=function(){return this.Xb};za.prototype.zh=function(){var a=new z;a.x=this.ke;a.y=this.le;a.z=this.me;return a}; -za.prototype.Bh=function(){var a=new z;a.x=this.ne;a.y=this.oe;a.z=this.pe;return a};za.prototype.Ah=function(a){a.x=this.ke;a.y=this.le;a.z=this.me};za.prototype.Ch=function(a){a.x=this.ne;a.y=this.oe;a.z=this.pe};za.prototype.vh=function(){var a=new z;a.x=this.tf;a.y=this.uf;a.z=this.vf;return a};za.prototype.ai=function(){var a=new z;a.x=this.wf;a.y=this.yf;a.z=this.zf;return a};za.prototype.$h=function(a){a.x=this.tf;a.y=this.uf;a.z=this.vf};za.prototype.bi=function(a){a.x=this.wf;a.y=this.yf; -a.z=this.zf};za.prototype.Hh=function(){var a=new ia;var b=this.pb;var e=this.Bc;var d=this.Id;var c=this.qb;var f=this.Cc;var h=this.Jd;var k=this.rb;var g=this.Dc;var l=this.Kd;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l;return a};za.prototype.Jh=function(){var a=new ia;var b=this.cc;var e=this.Fd;var d=this.se;var c=this.dc;var f=this.Gd;var h=this.te;var k=this.ec;var g=this.Hd;var l=this.ue;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l;return a}; -za.prototype.Ih=function(a){var b=this.pb;var e=this.Bc;var d=this.Id;var c=this.qb;var f=this.Cc;var h=this.Jd;var k=this.rb;var g=this.Dc;var l=this.Kd;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l};za.prototype.Kh=function(a){var b=this.cc;var e=this.Fd;var d=this.se;var c=this.dc;var f=this.Gd;var h=this.te;var k=this.ec;var g=this.Hd;var l=this.ue;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l};za.prototype.yh=function(){return this.Nh};za.prototype.Oi= -function(a){this.Nh=a};za.prototype.Lh=function(){return this.rf};za.prototype.Pi=function(a){this.rf=a};za.prototype.Mh=function(){return this.sf};za.prototype.Qi=function(a){this.sf=a};za.prototype.di=function(){return this.pf};za.prototype.Ri=function(a){switch(a){case 0:case 1:case 2:break;default:throw Error("invalid position correction algorithm id: "+a);}this.pf=a};za.prototype.Dh=function(){var a=new z;a.x=this.vg;a.y=this.wg;a.z=this.xg;return a};za.prototype.Eh=function(a){a.x=this.vg;a.y= -this.wg;a.z=this.xg};za.prototype.Fh=function(){var a=new z;a.x=this.yg;a.y=this.zg;a.z=this.Ag;return a};za.prototype.Gh=function(a){a.x=this.yg;a.y=this.zg;a.z=this.Ag};za.prototype.xi=function(){return this.sa};za.prototype.Vg=function(){return this.U};rl(dc,za);dc.prototype.Gb=function(a,b,e){var d=this.ce(b,e),c=this.ac*d,f=this.bc*d,h=this.tc*d;d=this.vd*d;var k=1/(this.J.Ab+this.K.Ab);var g=this.Sc(this.h.i,this.h.C,this.h.I);if(0>=this.Fb.frequency||!e){var l=this.M[0],m=a.rows[a.La++],n= -m.Ea;n.Ba=0;n.Ca=0;n.Da=0;n.Fa=0;n.Ga=0;n.Ha=0;n.ka=0;n.la=0;n.ma=0;n.na=0;n.oa=0;n.pa=0;m.Na=0;m.Ua=0;m.Qa=0;m.Pa=0;m.motorSpeed=0;m.Db=0;m.Aa=l;this.Af(m,this.Xa,this.Yh,k,this.Fb,b,e);k=m.Ea;k.Ba=this.h.i;k.Ca=this.h.C;k.Da=this.h.I;k.Fa=this.h.i;k.Ga=this.h.C;k.Ha=this.h.I;k.ka=this.qa*this.h.I-this.Ma*this.h.C;k.la=this.Ma*this.h.i-this.aa*this.h.I;k.ma=this.aa*this.h.C-this.qa*this.h.i;k.na=this.Sa*this.h.I-this.Wa*this.h.C;k.oa=this.Wa*this.h.i-this.Oa*this.h.I;k.pa=this.Oa*this.h.C-this.Sa* -this.h.i}k=this.M[1];l=a.rows[a.La++];m=l.Ea;m.Ba=0;m.Ca=0;m.Da=0;m.Fa=0;m.Ga=0;m.Ha=0;m.ka=0;m.la=0;m.ma=0;m.na=0;m.oa=0;m.pa=0;l.Na=0;l.Ua=0;l.Qa=0;l.Pa=0;l.motorSpeed=0;l.Db=0;l.Aa=null;l.Aa=k;l.Na=c;l.Ua=0;l.Qa=-Infinity;l.Pa=Infinity;k=l.Ea;k.Ba=this.h.M;k.Ca=this.h.V;k.Da=this.h.W;k.Fa=this.h.M;k.Ga=this.h.V;k.Ha=this.h.W;k.ka=this.qa*this.h.W-this.Ma*this.h.V;k.la=this.Ma*this.h.M-this.aa*this.h.W;k.ma=this.aa*this.h.V-this.qa*this.h.M;k.na=this.Sa*this.h.W-this.Wa*this.h.V;k.oa=this.Wa*this.h.M- -this.Oa*this.h.W;k.pa=this.Oa*this.h.V-this.Sa*this.h.M;c=this.M[2];k=a.rows[a.La++];l=k.Ea;l.Ba=0;l.Ca=0;l.Da=0;l.Fa=0;l.Ga=0;l.Ha=0;l.ka=0;l.la=0;l.ma=0;l.na=0;l.oa=0;l.pa=0;k.Na=0;k.Ua=0;k.Qa=0;k.Pa=0;k.motorSpeed=0;k.Db=0;k.Aa=c;k.Na=f;k.Ua=0;k.Qa=-Infinity;k.Pa=Infinity;k=k.Ea;k.Ba=this.h.Y;k.Ca=this.h.aa;k.Da=this.h.qa;k.Fa=this.h.Y;k.Ga=this.h.aa;k.Ha=this.h.qa;k.ka=this.qa*this.h.qa-this.Ma*this.h.aa;k.la=this.Ma*this.h.Y-this.aa*this.h.qa;k.ma=this.aa*this.h.aa-this.qa*this.h.Y;k.na=this.Sa* -this.h.qa-this.Wa*this.h.aa;k.oa=this.Wa*this.h.Y-this.Oa*this.h.qa;k.pa=this.Oa*this.h.aa-this.Sa*this.h.Y;if(0>=this.tb.frequency||!e)f=this.M[3],c=a.rows[a.La++],k=c.Ea,k.Ba=0,k.Ca=0,k.Da=0,k.Fa=0,k.Ga=0,k.Ha=0,k.ka=0,k.la=0,k.ma=0,k.na=0,k.oa=0,k.pa=0,c.Na=0,c.Ua=0,c.Qa=0,c.Pa=0,c.motorSpeed=0,c.Db=0,c.Aa=f,this.Ed(c,this.Va,this.Vh,g,this.tb,b,e),k=c.Ea,k.ka=this.h.i,k.la=this.h.C,k.ma=this.h.I,k.na=this.h.i,k.oa=this.h.C,k.pa=this.h.I;b=this.M[4];e=a.rows[a.La++];g=e.Ea;g.Ba=0;g.Ca=0;g.Da=0; -g.Fa=0;g.Ga=0;g.Ha=0;g.ka=0;g.la=0;g.ma=0;g.na=0;g.oa=0;g.pa=0;e.Na=0;e.Ua=0;e.Qa=0;e.Pa=0;e.motorSpeed=0;e.Db=0;e.Aa=b;e.Na=h;e.Ua=0;e.Qa=-Infinity;e.Pa=Infinity;k=e.Ea;k.ka=this.h.M;k.la=this.h.V;k.ma=this.h.W;k.na=this.h.M;k.oa=this.h.V;k.pa=this.h.W;h=this.M[5];a=a.rows[a.La++];b=a.Ea;b.Ba=0;b.Ca=0;b.Da=0;b.Fa=0;b.Ga=0;b.Ha=0;b.ka=0;b.la=0;b.ma=0;b.na=0;b.oa=0;b.pa=0;a.Na=0;a.Ua=0;a.Qa=0;a.Pa=0;a.motorSpeed=0;a.Db=0;a.Aa=h;a.Na=d;a.Ua=0;a.Qa=-Infinity;a.Pa=Infinity;k=a.Ea;k.ka=this.h.Y;k.la=this.h.aa; -k.ma=this.h.qa;k.na=this.h.Y;k.oa=this.h.aa;k.pa=this.h.qa};dc.prototype.Gc=function(){za.prototype.Gc.call(this);var a=this.h,b=a.h.J.Ab,e=a.h.K.Ab,d=a.h.pb*a.h.cc+a.h.qb*a.h.dc+a.h.rb*a.h.ec;if(-.999999999>d){var c=a.h.pb,f=a.h.qb,h=a.h.rb,k=c*c,g=f*f,l=h*h;if(kM&&(M=-M,G=-G,P=-P,K=-K,pa=-pa);if(.999999gb){var pb=da*da,ab=Z*Z,$a=oa*oa;if(pb=Q?3.14159265358979:1<=Q?0:Math.acos(Q),Ia=Ta*Ta+sa*sa+Ga*Ga;0=Q?3.14159265358979: -1<=Q?0:Math.acos(Q);0>Eb*this.h.i+wb*this.h.C+Mb*this.h.I&&(this.Va=-this.Va);var Ib=this.ne-this.ke;var Tb=this.oe-this.le;var Rb=this.pe-this.me;this.Xa=Ib*this.h.i+Tb*this.h.C+Rb*this.h.I;this.ac=Ib*this.h.M+Tb*this.h.V+Rb*this.h.W;this.bc=Ib*this.h.Y+Tb*this.h.aa+Rb*this.h.qa};dc.prototype.nd=function(a,b){za.prototype.nd.call(this,a,b);this.Gb(b,a,!1)};dc.prototype.Ec=function(a){za.prototype.Ec.call(this,a);this.Gb(a,null,!0)};dc.prototype.gd=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z= -this.rb;return a};dc.prototype.jd=function(){var a=new z;a.x=this.cc;a.y=this.dc;a.z=this.ec;return a};dc.prototype.hd=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};dc.prototype.wd=function(a){a.x=this.cc;a.y=this.dc;a.z=this.ec};dc.prototype.$d=function(){var a=new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};dc.prototype.be=function(){var a=new z;a.x=this.V;a.y=this.W;a.z=this.Y;return a};dc.prototype.ae=function(a){a.x=this.i;a.y=this.C;a.z=this.I};dc.prototype.Qd=function(a){a.x=this.V;a.y= -this.W;a.z=this.Y};dc.prototype.Ze=function(){return this.Fb};dc.prototype.Xe=function(){return this.tb};dc.prototype.Ye=function(){return this.Yh};dc.prototype.We=function(){return this.Vh};dc.prototype.yc=function(){return this.Va};dc.prototype.Rd=function(){return this.Xa};qf.prototype.h=function(a,b,e){this.rigidBody1=a;this.rigidBody2=b;var d=this.rigidBody1;a=this.localAnchor1;var c=e.x;var f=e.y;var h=e.z;c-=d.g.F;f-=d.g.G;h-=d.g.H;b=d.g.A*c+d.g.o*f+d.g.u*h;var k=d.g.j*c+d.g.v*f+d.g.l*h;d= -d.g.m*c+d.g.s*f+d.g.B*h;a.x=b;a.y=k;a.z=d;b=this.rigidBody2;a=this.localAnchor2;k=e.x;d=e.y;f=e.z;k-=b.g.F;d-=b.g.G;f-=b.g.H;e=b.g.A*k+b.g.o*d+b.g.u*f;c=b.g.j*k+b.g.v*d+b.g.l*f;b=b.g.m*k+b.g.s*d+b.g.B*f;a.x=e;a.y=c;a.z=b};rl(Yj,qf);Yj.prototype.Ia=function(a,b,e,d){this.h(a,b,e);e=this.localAxis1;var c=d.x;var f=d.y;var h=d.z;var k=a.g.A*c+a.g.o*f+a.g.u*h;var g=a.g.j*c+a.g.v*f+a.g.l*h;a=a.g.m*c+a.g.s*f+a.g.B*h;e.x=k;e.y=g;e.z=a;a=this.localAxis2;e=d.x;k=d.y;c=d.z;d=b.g.A*e+b.g.o*k+b.g.u*c;g=b.g.j* -e+b.g.v*k+b.g.l*c;b=b.g.m*e+b.g.s*k+b.g.B*c;a.x=d;a.y=g;a.z=b;return this};rl(Pc,za);Pc.prototype.gd=function(a,b,e){var d=1/(this.J.Ab+this.K.Ab),c=this.Sc(this.h,this.Va,this.Xa),f=this.Sc(this.Mc,this.Nc,this.Oc),h=this.Sc(this.tb,this.Fb,this.Gb);if(0>=this.bc[0].frequency||!e){var k=this.M[0];var g=a.rows[a.La++],l=g.Ea;l.Ba=0;l.Ca=0;l.Da=0;l.Fa=0;l.Ga=0;l.Ha=0;l.ka=0;l.la=0;l.ma=0;l.na=0;l.oa=0;l.pa=0;g.Na=0;g.Ua=0;g.Qa=0;g.Pa=0;g.motorSpeed=0;g.Db=0;g.Aa=k;this.Af(g,this.tc,this.Oe[0],d,this.bc[0], +k=this.h,g=0==k.h?new z:k.i[--k.h],l=this.h,m=0==l.h?new z:l.i[--l.h],n=this.h,q=0==n.I?new ha:n.C[--n.I];m.x=a.F;m.y=a.G;m.z=a.H;q.e00=a.A;q.e01=a.j;q.e02=a.m;q.e10=a.o;q.e11=a.v;q.e12=a.s;q.e20=a.u;q.e21=a.l;q.e22=a.B;c.Ia(q.e00,q.e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p;Fa.z+=c.z*p;var L=-r;Fa.x+=h.x*L;Fa.y+=h.y*L;Fa.z+=h.z*L;Fa.x+=g.x*t;Fa.y+=g.y*t;Fa.z+=g.z*t;var Z=this.h,Y=0==Z.h?new z:Z.i[--Z.h];Y.x=m.x;Y.y=m.y;Y.z=m.z;Y.x+=c.x*p;Y.y+=c.y* +p;Y.z+=c.z*p;Y.x+=h.x*r;Y.y+=h.y*r;Y.z+=h.z*r;var va=-t;Y.x+=g.x*va;Y.y+=g.y*va;Y.z+=g.z*va;var Va=this.h,D=0==Va.h?new z:Va.i[--Va.h];D.x=m.x;D.y=m.y;D.z=m.z;D.x+=c.x*p;D.y+=c.y*p;D.z+=c.z*p;D.x+=h.x*r;D.y+=h.y*r;D.z+=h.z*r;D.x+=g.x*t;D.y+=g.y*t;D.z+=g.z*t;if(this.wireframe)this.line(v,y,e),this.line(G,N,e),this.line(Ja,Fa,e),this.line(Y,D,e),this.line(v,G,e),this.line(y,N,e),this.line(Ja,Y,e),this.line(Fa,D,e),this.line(v,Ja,e),this.line(y,Fa,e),this.line(G,Y,e),this.line(N,D,e);else{var za=this.h, +aa=0==za.h?new z:za.i[--za.h];aa.x=c.x;aa.y=c.y;aa.z=c.z;aa.x=-aa.x;aa.y=-aa.y;aa.z=-aa.z;var Ta=this.h,ca=0==Ta.h?new z:Ta.i[--Ta.h];ca.x=h.x;ca.y=h.y;ca.z=h.z;ca.x=-ca.x;ca.y=-ca.y;ca.z=-ca.z;var ia=this.h,T=0==ia.h?new z:ia.i[--ia.h];T.x=g.x;T.y=g.y;T.z=g.z;T.x=-T.x;T.y=-T.y;T.z=-T.z;this.rect(v,y,N,G,aa,aa,aa,aa,e);this.rect(Ja,Y,D,Fa,c,c,c,c,e);this.rect(v,Ja,Fa,y,ca,ca,ca,ca,e);this.rect(G,N,D,Y,h,h,h,h,e);this.rect(v,G,Y,Ja,T,T,T,T,e);this.rect(y,Fa,D,N,g,g,g,g,e);var ka=this.h;if(null!=aa){aa.$(); +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)};Ve.prototype.i=function(){return this.ic};Ve.prototype.C=function(){return this.jc};Ve.prototype.h=function(){return this.Ra}; +Ve.prototype.vh=function(){for(var a=0,b=this.Ra.Bd;aBa.contactPersistenceThreshold?this.C(a):(e+=this.Ra.kf*-c,d+=this.Ra.lf*-c,b+=this.Ra.mf*-c,e*e+d*d+b*b>Ba.contactPersistenceThreshold*Ba.contactPersistenceThreshold&&this.C(a))}};$i.prototype.C=function(a){var b=--this.Ra.Bd;if(a!=b){var e=this.Ra.rc[a];this.Ra.rc[a]=this.Ra.rc[b];this.Ra.rc[b]=e}a=this.Ra.rc[b];a.we=0;a.xe=0;a.ye=0;a.ze=0;a.Ae=0;a.Be=0;a.Lb=0;a.Mb=0;a.Nb=0;a.kc= +0;a.lc=0;a.mc=0;a.od=0;a.pd=0;a.qd=0;a.rd=0;a.sd=0;a.td=0;a.Dc=0;b=a.Ad;b.Hc=0;b.xc=0;b.wc=0;b.Hb=0;b.ge=0;b.he=0;b.ie=0;a.Xd=!1;a.ve=!1;a.uc=-1};$i.prototype.I=function(a,b,e){var d=this.Ra.Bd;if(d==Ba.maxManifoldPoints){d=this.Ra.rc[this.M(a,b)];var c=a.position1;d.od=c.x;d.pd=c.y;d.qd=c.z;c=a.position2;d.rd=c.x;d.sd=c.y;d.td=c.z;d.Lb=d.od-b.F;d.Mb=d.pd-b.G;d.Nb=d.qd-b.H;d.kc=d.rd-e.F;d.lc=d.sd-e.G;d.mc=d.td-e.H;c=b.A*d.Lb+b.o*d.Mb+b.u*d.Nb;var f=b.j*d.Lb+b.v*d.Mb+b.l*d.Nb;b=b.m*d.Lb+b.s*d.Mb+b.B* +d.Nb;d.we=c;d.xe=f;d.ye=b;b=e.A*d.kc+e.o*d.lc+e.u*d.mc;c=e.j*d.kc+e.v*d.lc+e.l*d.mc;e=e.m*d.kc+e.s*d.lc+e.B*d.mc;d.ze=b;d.Ae=c;d.Be=e;d.Dc=a.depth;e=d.Ad;e.Hc=0;e.xc=0;e.wc=0;e.Hb=0;e.ge=0;e.he=0;e.ie=0;d.uc=a.id;d.Xd=!1;d.ve=!1}else d=this.Ra.rc[d],c=a.position1,d.od=c.x,d.pd=c.y,d.qd=c.z,c=a.position2,d.rd=c.x,d.sd=c.y,d.td=c.z,d.Lb=d.od-b.F,d.Mb=d.pd-b.G,d.Nb=d.qd-b.H,d.kc=d.rd-e.F,d.lc=d.sd-e.G,d.mc=d.td-e.H,c=b.A*d.Lb+b.o*d.Mb+b.u*d.Nb,f=b.j*d.Lb+b.v*d.Mb+b.l*d.Nb,b=b.m*d.Lb+b.s*d.Mb+b.B*d.Nb, +d.we=c,d.xe=f,d.ye=b,b=e.A*d.kc+e.o*d.lc+e.u*d.mc,c=e.j*d.kc+e.v*d.lc+e.l*d.mc,e=e.m*d.kc+e.s*d.lc+e.B*d.mc,d.ze=b,d.Ae=c,d.Be=e,d.Dc=a.depth,e=d.Ad,e.Hc=0,e.xc=0,e.wc=0,e.Hb=0,e.ge=0,e.he=0,e.ie=0,d.uc=a.id,d.Xd=!1,d.ve=!1,this.Ra.Bd++};$i.prototype.M=function(a,b){var e=this.Ra.rc[0],d=this.Ra.rc[1],c=this.Ra.rc[2],f=this.Ra.rc[3],h=e.Dc,k=0;d.Dc>h&&(h=d.Dc,k=1);c.Dc>h&&(h=c.Dc,k=2);f.Dc>h&&(k=3);var g=a.position1;var l=g.x;var m=g.y;var n=g.z;l-=b.F;m-=b.G;n-=b.H;var q=d.Lb,p=d.Mb,r=d.Nb,t=c.Lb, +x=c.Mb,v=c.Nb,B=f.Lb,H=f.Mb,C=f.Nb;var O=t-q;var y=x-p;var A=v-r;var E=l-B;var M=m-H;var G=n-C;var R=B-q;var K=H-p;var oa=C-r;var N=l-t;var Ra=m-x;var Wa=n-v;var Ja=l-q;var Sa=m-p;var Aa=n-r;var La=B-t;var Fa=H-x;var L=C-v;var Z=y*G-A*M;var Y=A*E-O*G;var va=O*M-y*E;var Va=K*Wa-oa*Ra;var D=oa*N-R*Wa;var za=R*Ra-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;var vb=Jb*Jb+ua*ua+Qa*Qa,Kb=wa*wa+Da*Da+S*S,Gb=Na*Na+Ia*Ia+Cb*Cb,Vb=vb>Kb?vb>Gb? +vb:Gb:Kb>Gb?Kb:Gb,Rb=e.Lb,Wb=e.Mb,nc=e.Nb,ac=d.Lb,gc=d.Mb,cc=d.Nb,Tb=c.Lb,Ub=c.Mb,Qb=c.Nb;var hc=ac-Rb;var bc=gc-Wb;var jc=cc-nc;var Xb=l-Tb;var ic=m-Ub;var vc=n-Qb;var Yb=Tb-Rb;var Sc=Ub-Wb;var Mb=Qb-nc;var mc=l-ac;var fc=m-gc;var Zb=n-cc;var lc=l-Rb;var ed=m-Wb;var Cc=n-nc;var wc=Tb-ac;var sc=Ub-gc;var Kc=Qb-cc;var tc=bc*vc-jc*ic;var Lc=jc*Xb-hc*vc;var Id=hc*ic-bc*Xb;var fd=Sc*Zb-Mb*fc;var Xc=Mb*mc-Yb*Zb;var Dc=Yb*fc-Sc*mc;var oc=ed*Kc-Cc*sc;var gd=Cc*wc-lc*Kc;var kc=lc*sc-ed*wc;var hd=tc*tc+Lc* +Lc+Id*Id,Tc=fd*fd+Xc*Xc+Dc*Dc,zd=oc*oc+gd*gd+kc*kc,Ad=ia>T?ia>ka?ia:ka:T>ka?T:ka,id=0;if(fb>Ad&&1!=k||0==k)Ad=fb,id=1;Vb>Ad&&2!=k&&(Ad=Vb,id=2);(hd>Tc?hd>zd?hd:zd:Tc>zd?Tc:zd)>Ad&&3!=k&&(id=3);return id};$i.prototype.V=function(a,b,e){for(var d=Ba.contactPersistenceThreshold*Ba.contactPersistenceThreshold,c=-1,f=0,h=this.Ra.Bd;fb){a=this.i;var e=this.C;var d=this.I;b=a*a;var c=e*e;var f=d*d;bd?(a=this.i,b=this.C,e=this.I,d=a*a,c=b*b,f=e*e,dg?b=l=e=0:f==g?(e=-Infinity,l=Infinity,b-=f):bg?(e=0,l=Infinity,b=b-g-k,0>b&&(b=0)):b=l=e=0;a.Qa=e;a.Pa=l;a.Ua=c*(0==d?0:1/d);a.Na=b*h};ya.prototype.Ed=function(a,b,e,d,c,f,h){var k=Ba.angularSlop;if(h)c=0,h=1;else{if(0e?b=g=l=0:f==e?(l=-Infinity,g=Infinity,b-=f):be?(l=0,g=Infinity,b=b-e-k,0>b&&(b=0)):b=g=l=0;a.Qa=l;a.Pa=g;a.Ua=c*(0==d?0:1/d);a.Na=b*h};ya.prototype.ce=function(a,b){return b?1:this.pf== +Jh.BAUMGARTE?a.invDt*Ba.velocityBaumgarte:0};ya.prototype.Sc=function(a,b,e){var d=(this.J.ba*a+this.J.ca*b+this.J.da*e)*a+(this.J.ea*a+this.J.fa*b+this.J.ga*e)*b+(this.J.ha*a+this.J.ia*b+this.J.ja*e)*e,c=(this.K.ba*a+this.K.ca*b+this.K.da*e)*a+(this.K.ea*a+this.K.fa*b+this.K.ga*e)*b+(this.K.ha*a+this.K.ia*b+this.K.ja*e)*e;if(0this.rf*this.rf?this.pc.yi(this):0this.sf*this.sf&&this.pc.yi(this)};ya.prototype.gi=function(){return this.J};ya.prototype.hi=function(){return this.K};ya.prototype.Ai=function(){return this.Xb};ya.prototype.Bh=function(){var a=new z;a.x=this.ke;a.y=this.le;a.z=this.me;return a};ya.prototype.Dh=function(){var a= +new z;a.x=this.ne;a.y=this.oe;a.z=this.pe;return a};ya.prototype.Ch=function(a){a.x=this.ke;a.y=this.le;a.z=this.me};ya.prototype.Eh=function(a){a.x=this.ne;a.y=this.oe;a.z=this.pe};ya.prototype.xh=function(){var a=new z;a.x=this.tf;a.y=this.uf;a.z=this.vf;return a};ya.prototype.ci=function(){var a=new z;a.x=this.wf;a.y=this.yf;a.z=this.zf;return a};ya.prototype.bi=function(a){a.x=this.tf;a.y=this.uf;a.z=this.vf};ya.prototype.di=function(a){a.x=this.wf;a.y=this.yf;a.z=this.zf};ya.prototype.Jh=function(){var a= +new ha;var b=this.pb;var e=this.Ac;var d=this.Id;var c=this.qb;var f=this.Bc;var h=this.Jd;var k=this.rb;var g=this.Cc;var l=this.Kd;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l;return a};ya.prototype.Lh=function(){var a=new ha;var b=this.cc;var e=this.Fd;var d=this.se;var c=this.dc;var f=this.Gd;var h=this.te;var k=this.ec;var g=this.Hd;var l=this.ue;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l;return a};ya.prototype.Kh=function(a){var b=this.pb; +var e=this.Ac;var d=this.Id;var c=this.qb;var f=this.Bc;var h=this.Jd;var k=this.rb;var g=this.Cc;var l=this.Kd;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l};ya.prototype.Mh=function(a){var b=this.cc;var e=this.Fd;var d=this.se;var c=this.dc;var f=this.Gd;var h=this.te;var k=this.ec;var g=this.Hd;var l=this.ue;a.e00=b;a.e01=e;a.e02=d;a.e10=c;a.e11=f;a.e12=h;a.e20=k;a.e21=g;a.e22=l};ya.prototype.Ah=function(){return this.Ph};ya.prototype.Ri=function(a){this.Ph=a};ya.prototype.Nh= +function(){return this.rf};ya.prototype.Si=function(a){this.rf=a};ya.prototype.Oh=function(){return this.sf};ya.prototype.Ti=function(a){this.sf=a};ya.prototype.fi=function(){return this.pf};ya.prototype.Ui=function(a){switch(a){case 0:case 1:case 2:break;default:throw Error("invalid position correction algorithm id: "+a);}this.pf=a};ya.prototype.Fh=function(){var a=new z;a.x=this.vg;a.y=this.wg;a.z=this.xg;return a};ya.prototype.Gh=function(a){a.x=this.vg;a.y=this.wg;a.z=this.xg};ya.prototype.Hh= +function(){var a=new z;a.x=this.yg;a.y=this.zg;a.z=this.Ag;return a};ya.prototype.Ih=function(a){a.x=this.yg;a.y=this.zg;a.z=this.Ag};ya.prototype.zi=function(){return this.sa};ya.prototype.Vg=function(){return this.U};rl(ec,ya);ec.prototype.Gb=function(a,b,e){var d=this.ce(b,e),c=this.ac*d,f=this.bc*d,h=this.tc*d;d=this.vd*d;var k=1/(this.J.Ab+this.K.Ab);var g=this.Sc(this.h.i,this.h.C,this.h.I);if(0>=this.Fb.frequency||!e){var l=this.M[0],m=a.rows[a.La++],n=m.Ea;n.Ba=0;n.Ca=0;n.Da=0;n.Fa=0;n.Ga= +0;n.Ha=0;n.ka=0;n.la=0;n.ma=0;n.na=0;n.oa=0;n.pa=0;m.Na=0;m.Ua=0;m.Qa=0;m.Pa=0;m.motorSpeed=0;m.Db=0;m.Aa=l;this.Af(m,this.Xa,this.$h,k,this.Fb,b,e);k=m.Ea;k.Ba=this.h.i;k.Ca=this.h.C;k.Da=this.h.I;k.Fa=this.h.i;k.Ga=this.h.C;k.Ha=this.h.I;k.ka=this.qa*this.h.I-this.Ma*this.h.C;k.la=this.Ma*this.h.i-this.aa*this.h.I;k.ma=this.aa*this.h.C-this.qa*this.h.i;k.na=this.Sa*this.h.I-this.Wa*this.h.C;k.oa=this.Wa*this.h.i-this.Oa*this.h.I;k.pa=this.Oa*this.h.C-this.Sa*this.h.i}k=this.M[1];l=a.rows[a.La++]; +m=l.Ea;m.Ba=0;m.Ca=0;m.Da=0;m.Fa=0;m.Ga=0;m.Ha=0;m.ka=0;m.la=0;m.ma=0;m.na=0;m.oa=0;m.pa=0;l.Na=0;l.Ua=0;l.Qa=0;l.Pa=0;l.motorSpeed=0;l.Db=0;l.Aa=null;l.Aa=k;l.Na=c;l.Ua=0;l.Qa=-Infinity;l.Pa=Infinity;k=l.Ea;k.Ba=this.h.M;k.Ca=this.h.V;k.Da=this.h.W;k.Fa=this.h.M;k.Ga=this.h.V;k.Ha=this.h.W;k.ka=this.qa*this.h.W-this.Ma*this.h.V;k.la=this.Ma*this.h.M-this.aa*this.h.W;k.ma=this.aa*this.h.V-this.qa*this.h.M;k.na=this.Sa*this.h.W-this.Wa*this.h.V;k.oa=this.Wa*this.h.M-this.Oa*this.h.W;k.pa=this.Oa*this.h.V- +this.Sa*this.h.M;c=this.M[2];k=a.rows[a.La++];l=k.Ea;l.Ba=0;l.Ca=0;l.Da=0;l.Fa=0;l.Ga=0;l.Ha=0;l.ka=0;l.la=0;l.ma=0;l.na=0;l.oa=0;l.pa=0;k.Na=0;k.Ua=0;k.Qa=0;k.Pa=0;k.motorSpeed=0;k.Db=0;k.Aa=c;k.Na=f;k.Ua=0;k.Qa=-Infinity;k.Pa=Infinity;k=k.Ea;k.Ba=this.h.Y;k.Ca=this.h.aa;k.Da=this.h.qa;k.Fa=this.h.Y;k.Ga=this.h.aa;k.Ha=this.h.qa;k.ka=this.qa*this.h.qa-this.Ma*this.h.aa;k.la=this.Ma*this.h.Y-this.aa*this.h.qa;k.ma=this.aa*this.h.aa-this.qa*this.h.Y;k.na=this.Sa*this.h.qa-this.Wa*this.h.aa;k.oa=this.Wa* +this.h.Y-this.Oa*this.h.qa;k.pa=this.Oa*this.h.aa-this.Sa*this.h.Y;if(0>=this.tb.frequency||!e)f=this.M[3],c=a.rows[a.La++],k=c.Ea,k.Ba=0,k.Ca=0,k.Da=0,k.Fa=0,k.Ga=0,k.Ha=0,k.ka=0,k.la=0,k.ma=0,k.na=0,k.oa=0,k.pa=0,c.Na=0,c.Ua=0,c.Qa=0,c.Pa=0,c.motorSpeed=0,c.Db=0,c.Aa=f,this.Ed(c,this.Va,this.Xh,g,this.tb,b,e),k=c.Ea,k.ka=this.h.i,k.la=this.h.C,k.ma=this.h.I,k.na=this.h.i,k.oa=this.h.C,k.pa=this.h.I;b=this.M[4];e=a.rows[a.La++];g=e.Ea;g.Ba=0;g.Ca=0;g.Da=0;g.Fa=0;g.Ga=0;g.Ha=0;g.ka=0;g.la=0;g.ma= +0;g.na=0;g.oa=0;g.pa=0;e.Na=0;e.Ua=0;e.Qa=0;e.Pa=0;e.motorSpeed=0;e.Db=0;e.Aa=b;e.Na=h;e.Ua=0;e.Qa=-Infinity;e.Pa=Infinity;k=e.Ea;k.ka=this.h.M;k.la=this.h.V;k.ma=this.h.W;k.na=this.h.M;k.oa=this.h.V;k.pa=this.h.W;h=this.M[5];a=a.rows[a.La++];b=a.Ea;b.Ba=0;b.Ca=0;b.Da=0;b.Fa=0;b.Ga=0;b.Ha=0;b.ka=0;b.la=0;b.ma=0;b.na=0;b.oa=0;b.pa=0;a.Na=0;a.Ua=0;a.Qa=0;a.Pa=0;a.motorSpeed=0;a.Db=0;a.Aa=h;a.Na=d;a.Ua=0;a.Qa=-Infinity;a.Pa=Infinity;k=a.Ea;k.ka=this.h.Y;k.la=this.h.aa;k.ma=this.h.qa;k.na=this.h.Y;k.oa= +this.h.aa;k.pa=this.h.qa};ec.prototype.Gc=function(){ya.prototype.Gc.call(this);var a=this.h,b=a.h.J.Ab,e=a.h.K.Ab,d=a.h.pb*a.h.cc+a.h.qb*a.h.dc+a.h.rb*a.h.ec;if(-.999999999>d){var c=a.h.pb,f=a.h.qb,h=a.h.rb,k=c*c,g=f*f,l=h*h;if(kN&&(N=-N,G=-G,R=-R,K=-K,oa=-oa);if(.999999qb){var lb=ea*ea,bb=X*X,$a=ma*ma;if(lb=S?3.14159265358979:1<=S?0:Math.acos(S),Ia=Qa*Qa+wa*wa+Da*Da;0=S?3.14159265358979:1<=S?0: +Math.acos(S);0>Cb*this.h.i+vb*this.h.C+Kb*this.h.I&&(this.Va=-this.Va);var Gb=this.ne-this.ke;var Vb=this.oe-this.le;var Rb=this.pe-this.me;this.Xa=Gb*this.h.i+Vb*this.h.C+Rb*this.h.I;this.ac=Gb*this.h.M+Vb*this.h.V+Rb*this.h.W;this.bc=Gb*this.h.Y+Vb*this.h.aa+Rb*this.h.qa};ec.prototype.nd=function(a,b){ya.prototype.nd.call(this,a,b);this.Gb(b,a,!1)};ec.prototype.Ec=function(a){ya.prototype.Ec.call(this,a);this.Gb(a,null,!0)};ec.prototype.gd=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb; +return a};ec.prototype.jd=function(){var a=new z;a.x=this.cc;a.y=this.dc;a.z=this.ec;return a};ec.prototype.hd=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};ec.prototype.wd=function(a){a.x=this.cc;a.y=this.dc;a.z=this.ec};ec.prototype.$d=function(){var a=new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};ec.prototype.be=function(){var a=new z;a.x=this.V;a.y=this.W;a.z=this.Y;return a};ec.prototype.ae=function(a){a.x=this.i;a.y=this.C;a.z=this.I};ec.prototype.Qd=function(a){a.x=this.V;a.y=this.W; +a.z=this.Y};ec.prototype.Ze=function(){return this.Fb};ec.prototype.Xe=function(){return this.tb};ec.prototype.Ye=function(){return this.$h};ec.prototype.We=function(){return this.Xh};ec.prototype.yc=function(){return this.Va};ec.prototype.Rd=function(){return this.Xa};jf.prototype.h=function(a,b,e){this.rigidBody1=a;this.rigidBody2=b;var d=this.rigidBody1;a=this.localAnchor1;var c=e.x;var f=e.y;var h=e.z;c-=d.g.F;f-=d.g.G;h-=d.g.H;b=d.g.A*c+d.g.o*f+d.g.u*h;var k=d.g.j*c+d.g.v*f+d.g.l*h;d=d.g.m*c+ +d.g.s*f+d.g.B*h;a.x=b;a.y=k;a.z=d;b=this.rigidBody2;a=this.localAnchor2;k=e.x;d=e.y;f=e.z;k-=b.g.F;d-=b.g.G;f-=b.g.H;e=b.g.A*k+b.g.o*d+b.g.u*f;c=b.g.j*k+b.g.v*d+b.g.l*f;b=b.g.m*k+b.g.s*d+b.g.B*f;a.x=e;a.y=c;a.z=b};rl(Yj,jf);Yj.prototype.Ia=function(a,b,e,d){this.h(a,b,e);e=this.localAxis1;var c=d.x;var f=d.y;var h=d.z;var k=a.g.A*c+a.g.o*f+a.g.u*h;var g=a.g.j*c+a.g.v*f+a.g.l*h;a=a.g.m*c+a.g.s*f+a.g.B*h;e.x=k;e.y=g;e.z=a;a=this.localAxis2;e=d.x;k=d.y;c=d.z;d=b.g.A*e+b.g.o*k+b.g.u*c;g=b.g.j*e+b.g.v* +k+b.g.l*c;b=b.g.m*e+b.g.s*k+b.g.B*c;a.x=d;a.y=g;a.z=b;return this};rl(Qc,ya);Qc.prototype.gd=function(a,b,e){var d=1/(this.J.Ab+this.K.Ab),c=this.Sc(this.h,this.Va,this.Xa),f=this.Sc(this.Mc,this.Nc,this.Oc),h=this.Sc(this.tb,this.Fb,this.Gb);if(0>=this.bc[0].frequency||!e){var k=this.M[0];var g=a.rows[a.La++],l=g.Ea;l.Ba=0;l.Ca=0;l.Da=0;l.Fa=0;l.Ga=0;l.Ha=0;l.ka=0;l.la=0;l.ma=0;l.na=0;l.oa=0;l.pa=0;g.Na=0;g.Ua=0;g.Qa=0;g.Pa=0;g.motorSpeed=0;g.Db=0;g.Aa=k;this.Af(g,this.tc,this.Oe[0],d,this.bc[0], b,e);k=g.Ea;k.Ba=this.pb;k.Ca=this.qb;k.Da=this.rb;k.Fa=this.pb;k.Ga=this.qb;k.Ha=this.rb;k.ka=this.qa*this.rb-this.Ma*this.qb;k.la=this.Ma*this.pb-this.aa*this.rb;k.ma=this.aa*this.qb-this.qa*this.pb;k.na=this.Sa*this.rb-this.Wa*this.qb;k.oa=this.Wa*this.pb-this.Oa*this.rb;k.pa=this.Oa*this.qb-this.Sa*this.pb}if(0>=this.bc[1].frequency||!e)k=this.M[1],g=a.rows[a.La++],l=g.Ea,l.Ba=0,l.Ca=0,l.Da=0,l.Fa=0,l.Ga=0,l.Ha=0,l.ka=0,l.la=0,l.ma=0,l.na=0,l.oa=0,l.pa=0,g.Na=0,g.Ua=0,g.Qa=0,g.Pa=0,g.motorSpeed= -0,g.Db=0,g.Aa=k,this.Af(g,this.vd,this.Oe[1],d,this.bc[1],b,e),k=g.Ea,k.Ba=this.Bc,k.Ca=this.Cc,k.Da=this.Dc,k.Fa=this.Bc,k.Ga=this.Cc,k.Ha=this.Dc,k.ka=this.qa*this.Dc-this.Ma*this.Cc,k.la=this.Ma*this.Bc-this.aa*this.Dc,k.ma=this.aa*this.Cc-this.qa*this.Bc,k.na=this.Sa*this.Dc-this.Wa*this.Cc,k.oa=this.Wa*this.Bc-this.Oa*this.Dc,k.pa=this.Oa*this.Cc-this.Sa*this.Bc;if(0>=this.bc[2].frequency||!e)k=this.M[2],g=a.rows[a.La++],l=g.Ea,l.Ba=0,l.Ca=0,l.Da=0,l.Fa=0,l.Ga=0,l.Ha=0,l.ka=0,l.la=0,l.ma=0,l.na= +0,g.Db=0,g.Aa=k,this.Af(g,this.vd,this.Oe[1],d,this.bc[1],b,e),k=g.Ea,k.Ba=this.Ac,k.Ca=this.Bc,k.Da=this.Cc,k.Fa=this.Ac,k.Ga=this.Bc,k.Ha=this.Cc,k.ka=this.qa*this.Cc-this.Ma*this.Bc,k.la=this.Ma*this.Ac-this.aa*this.Cc,k.ma=this.aa*this.Bc-this.qa*this.Ac,k.na=this.Sa*this.Cc-this.Wa*this.Bc,k.oa=this.Wa*this.Ac-this.Oa*this.Cc,k.pa=this.Oa*this.Bc-this.Sa*this.Ac;if(0>=this.bc[2].frequency||!e)k=this.M[2],g=a.rows[a.La++],l=g.Ea,l.Ba=0,l.Ca=0,l.Da=0,l.Fa=0,l.Ga=0,l.Ha=0,l.ka=0,l.la=0,l.ma=0,l.na= 0,l.oa=0,l.pa=0,g.Na=0,g.Ua=0,g.Qa=0,g.Pa=0,g.motorSpeed=0,g.Db=0,g.Aa=k,this.Af(g,this.yc,this.Oe[2],d,this.bc[2],b,e),k=g.Ea,k.Ba=this.Id,k.Ca=this.Jd,k.Da=this.Kd,k.Fa=this.Id,k.Ga=this.Jd,k.Ha=this.Kd,k.ka=this.qa*this.Kd-this.Ma*this.Jd,k.la=this.Ma*this.Id-this.aa*this.Kd,k.ma=this.aa*this.Jd-this.qa*this.Id,k.na=this.Sa*this.Kd-this.Wa*this.Jd,k.oa=this.Wa*this.Id-this.Oa*this.Kd,k.pa=this.Oa*this.Jd-this.Sa*this.Id;this.hd||!(0>=this.ac[0].frequency)&&e||(d=this.M[3],k=a.rows[a.La++],g=k.Ea, g.Ba=0,g.Ca=0,g.Da=0,g.Fa=0,g.Ga=0,g.Ha=0,g.ka=0,g.la=0,g.ma=0,g.na=0,g.oa=0,g.pa=0,k.Na=0,k.Ua=0,k.Qa=0,k.Pa=0,k.motorSpeed=0,k.Db=0,k.Aa=d,this.Ed(k,this.qe,this.Ne[0],c,this.ac[0],b,e),k=k.Ea,k.ka=this.h,k.la=this.Va,k.ma=this.Xa,k.na=this.h,k.oa=this.Va,k.pa=this.Xa);this.jd||!(0>=this.ac[1].frequency)&&e||(c=this.M[4],d=a.rows[a.La++],k=d.Ea,k.Ba=0,k.Ca=0,k.Da=0,k.Fa=0,k.Ga=0,k.Ha=0,k.ka=0,k.la=0,k.ma=0,k.na=0,k.oa=0,k.pa=0,d.Na=0,d.Ua=0,d.Qa=0,d.Pa=0,d.motorSpeed=0,d.Db=0,d.Aa=c,this.Ed(d,this.Df, -this.Ne[1],f,this.ac[1],b,e),k=d.Ea,k.ka=this.Mc,k.la=this.Nc,k.ma=this.Oc,k.na=this.Mc,k.oa=this.Nc,k.pa=this.Oc);this.wd||!(0>=this.ac[2].frequency)&&e||(f=this.M[5],a=a.rows[a.La++],c=a.Ea,c.Ba=0,c.Ca=0,c.Da=0,c.Fa=0,c.Ga=0,c.Ha=0,c.ka=0,c.la=0,c.ma=0,c.na=0,c.oa=0,c.pa=0,a.Na=0,a.Ua=0,a.Qa=0,a.Pa=0,a.motorSpeed=0,a.Db=0,a.Aa=f,this.Ed(a,this.re,this.Ne[2],h,this.ac[2],b,e),k=a.Ea,k.ka=this.tb,k.la=this.Fb,k.ma=this.Gb,k.na=this.tb,k.oa=this.Fb,k.pa=this.Gb)};Pc.prototype.Gc=function(){za.prototype.Gc.call(this); +this.Ne[1],f,this.ac[1],b,e),k=d.Ea,k.ka=this.Mc,k.la=this.Nc,k.ma=this.Oc,k.na=this.Mc,k.oa=this.Nc,k.pa=this.Oc);this.wd||!(0>=this.ac[2].frequency)&&e||(f=this.M[5],a=a.rows[a.La++],c=a.Ea,c.Ba=0,c.Ca=0,c.Da=0,c.Fa=0,c.Ga=0,c.Ha=0,c.ka=0,c.la=0,c.ma=0,c.na=0,c.oa=0,c.pa=0,a.Na=0,a.Ua=0,a.Qa=0,a.Pa=0,a.motorSpeed=0,a.Db=0,a.Aa=f,this.Ed(a,this.re,this.Ne[2],h,this.ac[2],b,e),k=a.Ea,k.ka=this.tb,k.la=this.Fb,k.ma=this.Gb,k.na=this.tb,k.oa=this.Fb,k.pa=this.Gb)};Qc.prototype.Gc=function(){ya.prototype.Gc.call(this); var a=this.pb;var b=this.qb;var e=this.rb;var d=this.se;var c=this.te;var f=this.ue;var h=c*e-f*b;var k=f*a-d*e;var g=d*b-c*a;this.h=k*f-g*c;this.Va=g*d-h*f;this.Xa=h*c-k*d;this.Mc=h;this.Nc=k;this.Oc=g;this.tb=b*g-e*k;this.Fb=e*h-a*g;this.Gb=a*k-b*h;a=this.h*this.h+this.Va*this.Va+this.Xa*this.Xa;0=B?(a=Math.atan2(C,H),l=.5*a,B=-1.570796326794895,a=.5*-a):1<=B?(a=Math.atan2(C,H),l=.5*a,B=1.570796326794895,a*=.5):(l=Math.atan2(-(l*t+n*x+p*v),m*t+q*x+r*v),B=Math.asin(B),a=Math.atan2(-(a*k+b*d+e*f),a*h+b*g+e*c));this.qe=l;this.Df=B;this.re=a;a=this.ne-this.ke;b=this.oe-this.le;e=this.pe-this.me;this.tc=a*this.pb+b*this.qb+e*this.rb;this.vd=a*this.Bc+b*this.Cc+e*this.Dc;this.yc=a*this.Id+b*this.Jd+e*this.Kd};Pc.prototype.nd=function(a,b){za.prototype.nd.call(this,a,b);this.gd(b,a,!1)}; -Pc.prototype.Ec=function(a){za.prototype.Ec.call(this,a);this.gd(a,null,!0)};Pc.prototype.ae=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};Pc.prototype.be=function(){var a=new z;a.x=this.Mc;a.y=this.Nc;a.z=this.Oc;return a};Pc.prototype.Qd=function(){var a=new z;a.x=this.se;a.y=this.te;a.z=this.ue;return a};Pc.prototype.Ye=function(){return this.bc.slice(0)};Pc.prototype.We=function(){return this.ac.slice(0)};Pc.prototype.Xe=function(){return this.Oe.slice(0)};Pc.prototype.Rd= -function(){return this.Ne.slice(0)};Pc.prototype.$d=function(){return new z(this.qe,this.Df,this.re)};Pc.prototype.Ze=function(){return new z(this.tc,this.vd,this.yc)};rl(Xj,qf);Xj.prototype.Ia=function(a,b,e,d,c){this.h(a,b,e);var f=a.g;b=b.g;var h=d.e00;var k=d.e01;var g=d.e02;var l=d.e10;var m=d.e11;var n=d.e12;var q=d.e20;var p=d.e21;var r=d.e22;var t=c.e00;var x=c.e01;var v=c.e02;var B=c.e10;var H=c.e11;var C=c.e12;var N=c.e20;var y=c.e21;var A=c.e22;c=f.A*h+f.o*l+f.u*q;d=f.A*k+f.o*m+f.u*p;a= -f.A*g+f.o*n+f.u*r;e=f.j*h+f.v*l+f.l*q;var E=f.j*k+f.v*m+f.l*p;var L=f.j*g+f.v*n+f.l*r;h=f.m*h+f.s*l+f.B*q;k=f.m*k+f.s*m+f.B*p;l=f.m*g+f.s*n+f.B*r;f=b.A*t+b.o*B+b.u*N;g=b.A*x+b.o*H+b.u*y;n=b.A*v+b.o*C+b.u*A;m=b.j*t+b.v*B+b.l*N;p=b.j*x+b.v*H+b.l*y;r=b.j*v+b.v*C+b.l*A;t=b.m*t+b.s*B+b.B*N;x=b.m*x+b.s*H+b.B*y;b=b.m*v+b.s*C+b.B*A;v=this.localBasis1;v.e00=c;v.e01=d;v.e02=a;v.e10=e;v.e11=E;v.e12=L;v.e20=h;v.e21=k;v.e22=l;c=this.localBasis2;c.e00=f;c.e01=g;c.e02=n;c.e10=m;c.e11=p;c.e12=r;c.e20=t;c.e21=x;c.e22= -b;return this};Gf.prototype.h=function(){return this.Rh};Gf.prototype.C=function(){return this.Fc};Gf.prototype.I=function(){return this.sa};Gf.prototype.i=function(){return this.U};rl(rc,za);rc.prototype.tc=function(a,b,e){var d=this.ce(b,e),c=this.ac*d,f=this.bc*d,h=this.tb*d,k=this.Va*d;d=this.Xa*d;if(0>=this.Fb.frequency||!e){var g=this.M[0],l=a.rows[a.La++],m=l.Ea;m.Ba=0;m.Ca=0;m.Da=0;m.Fa=0;m.Ga=0;m.Ha=0;m.ka=0;m.la=0;m.ma=0;m.na=0;m.oa=0;m.pa=0;l.Na=0;l.Ua=0;l.Qa=0;l.Pa=0;l.motorSpeed=0;l.Db= +this.Gb;0=B?(a=Math.atan2(C,H),l=.5*a,B=-1.570796326794895,a=.5*-a):1<=B?(a=Math.atan2(C,H),l=.5*a,B=1.570796326794895,a*=.5):(l=Math.atan2(-(l*t+n*x+p*v),m*t+q*x+r*v),B=Math.asin(B),a=Math.atan2(-(a*k+b*d+e*f),a*h+b*g+e*c));this.qe=l;this.Df=B;this.re=a;a=this.ne-this.ke;b=this.oe-this.le;e=this.pe-this.me;this.tc=a*this.pb+b*this.qb+e*this.rb;this.vd=a*this.Ac+b*this.Bc+e*this.Cc;this.yc=a*this.Id+b*this.Jd+e*this.Kd};Qc.prototype.nd=function(a,b){ya.prototype.nd.call(this,a,b);this.gd(b,a,!1)}; +Qc.prototype.Ec=function(a){ya.prototype.Ec.call(this,a);this.gd(a,null,!0)};Qc.prototype.ae=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};Qc.prototype.be=function(){var a=new z;a.x=this.Mc;a.y=this.Nc;a.z=this.Oc;return a};Qc.prototype.Qd=function(){var a=new z;a.x=this.se;a.y=this.te;a.z=this.ue;return a};Qc.prototype.Ye=function(){return this.bc.slice(0)};Qc.prototype.We=function(){return this.ac.slice(0)};Qc.prototype.Xe=function(){return this.Oe.slice(0)};Qc.prototype.Rd= +function(){return this.Ne.slice(0)};Qc.prototype.$d=function(){return new z(this.qe,this.Df,this.re)};Qc.prototype.Ze=function(){return new z(this.tc,this.vd,this.yc)};rl(Xj,jf);Xj.prototype.Ia=function(a,b,e,d,c){this.h(a,b,e);var f=a.g;b=b.g;var h=d.e00;var k=d.e01;var g=d.e02;var l=d.e10;var m=d.e11;var n=d.e12;var q=d.e20;var p=d.e21;var r=d.e22;var t=c.e00;var x=c.e01;var v=c.e02;var B=c.e10;var H=c.e11;var C=c.e12;var O=c.e20;var y=c.e21;var A=c.e22;c=f.A*h+f.o*l+f.u*q;d=f.A*k+f.o*m+f.u*p;a= +f.A*g+f.o*n+f.u*r;e=f.j*h+f.v*l+f.l*q;var E=f.j*k+f.v*m+f.l*p;var M=f.j*g+f.v*n+f.l*r;h=f.m*h+f.s*l+f.B*q;k=f.m*k+f.s*m+f.B*p;l=f.m*g+f.s*n+f.B*r;f=b.A*t+b.o*B+b.u*O;g=b.A*x+b.o*H+b.u*y;n=b.A*v+b.o*C+b.u*A;m=b.j*t+b.v*B+b.l*O;p=b.j*x+b.v*H+b.l*y;r=b.j*v+b.v*C+b.l*A;t=b.m*t+b.s*B+b.B*O;x=b.m*x+b.s*H+b.B*y;b=b.m*v+b.s*C+b.B*A;v=this.localBasis1;v.e00=c;v.e01=d;v.e02=a;v.e10=e;v.e11=E;v.e12=M;v.e20=h;v.e21=k;v.e22=l;c=this.localBasis2;c.e00=f;c.e01=g;c.e02=n;c.e10=m;c.e11=p;c.e12=r;c.e20=t;c.e21=x;c.e22= +b;return this};Df.prototype.h=function(){return this.Th};Df.prototype.C=function(){return this.Fc};Df.prototype.I=function(){return this.sa};Df.prototype.i=function(){return this.U};rl(rc,ya);rc.prototype.tc=function(a,b,e){var d=this.ce(b,e),c=this.ac*d,f=this.bc*d,h=this.tb*d,k=this.Va*d;d=this.Xa*d;if(0>=this.Fb.frequency||!e){var g=this.M[0],l=a.rows[a.La++],m=l.Ea;m.Ba=0;m.Ca=0;m.Da=0;m.Fa=0;m.Ga=0;m.Ha=0;m.ka=0;m.la=0;m.ma=0;m.na=0;m.oa=0;m.pa=0;l.Na=0;l.Ua=0;l.Qa=0;l.Pa=0;l.motorSpeed=0;l.Db= 0;l.Aa=g;this.Af(l,this.Gb,this.cg,1/(this.J.Ab+this.K.Ab),this.Fb,b,e);b=l.Ea;b.Ba=this.h.i;b.Ca=this.h.C;b.Da=this.h.I;b.Fa=this.h.i;b.Ga=this.h.C;b.Ha=this.h.I;b.ka=this.qa*this.h.I-this.Ma*this.h.C;b.la=this.Ma*this.h.i-this.aa*this.h.I;b.ma=this.aa*this.h.C-this.qa*this.h.i;b.na=this.Sa*this.h.I-this.Wa*this.h.C;b.oa=this.Wa*this.h.i-this.Oa*this.h.I;b.pa=this.Oa*this.h.C-this.Sa*this.h.i}b=this.M[1];e=a.rows[a.La++];g=e.Ea;g.Ba=0;g.Ca=0;g.Da=0;g.Fa=0;g.Ga=0;g.Ha=0;g.ka=0;g.la=0;g.ma=0;g.na= 0;g.oa=0;g.pa=0;e.Na=0;e.Ua=0;e.Qa=0;e.Pa=0;e.motorSpeed=0;e.Db=0;e.Aa=b;e.Na=c;e.Ua=0;e.Qa=-Infinity;e.Pa=Infinity;b=e.Ea;b.Ba=this.h.M;b.Ca=this.h.V;b.Da=this.h.W;b.Fa=this.h.M;b.Ga=this.h.V;b.Ha=this.h.W;b.ka=this.qa*this.h.W-this.Ma*this.h.V;b.la=this.Ma*this.h.M-this.aa*this.h.W;b.ma=this.aa*this.h.V-this.qa*this.h.M;b.na=this.Sa*this.h.W-this.Wa*this.h.V;b.oa=this.Wa*this.h.M-this.Oa*this.h.W;b.pa=this.Oa*this.h.V-this.Sa*this.h.M;c=this.M[2];b=a.rows[a.La++];e=b.Ea;e.Ba=0;e.Ca=0;e.Da=0;e.Fa= 0;e.Ga=0;e.Ha=0;e.ka=0;e.la=0;e.ma=0;e.na=0;e.oa=0;e.pa=0;b.Na=0;b.Ua=0;b.Qa=0;b.Pa=0;b.motorSpeed=0;b.Db=0;b.Aa=c;b.Na=f;b.Ua=0;b.Qa=-Infinity;b.Pa=Infinity;b=b.Ea;b.Ba=this.h.Y;b.Ca=this.h.aa;b.Da=this.h.qa;b.Fa=this.h.Y;b.Ga=this.h.aa;b.Ha=this.h.qa;b.ka=this.qa*this.h.qa-this.Ma*this.h.aa;b.la=this.Ma*this.h.Y-this.aa*this.h.qa;b.ma=this.aa*this.h.aa-this.qa*this.h.Y;b.na=this.Sa*this.h.qa-this.Wa*this.h.aa;b.oa=this.Wa*this.h.Y-this.Oa*this.h.qa;b.pa=this.Oa*this.h.aa-this.Sa*this.h.Y;f=this.M[3]; c=a.rows[a.La++];b=c.Ea;b.Ba=0;b.Ca=0;b.Da=0;b.Fa=0;b.Ga=0;b.Ha=0;b.ka=0;b.la=0;b.ma=0;b.na=0;b.oa=0;b.pa=0;c.Na=0;c.Ua=0;c.Qa=0;c.Pa=0;c.motorSpeed=0;c.Db=0;c.Aa=f;c.Na=h;c.Ua=0;c.Qa=-Infinity;c.Pa=Infinity;b=c.Ea;b.ka=1;b.la=0;b.ma=0;b.na=1;b.oa=0;b.pa=0;h=this.M[4];f=a.rows[a.La++];c=f.Ea;c.Ba=0;c.Ca=0;c.Da=0;c.Fa=0;c.Ga=0;c.Ha=0;c.ka=0;c.la=0;c.ma=0;c.na=0;c.oa=0;c.pa=0;f.Na=0;f.Ua=0;f.Qa=0;f.Pa=0;f.motorSpeed=0;f.Db=0;f.Aa=h;f.Na=k;f.Ua=0;f.Qa=-Infinity;f.Pa=Infinity;b=f.Ea;b.ka=0;b.la=1;b.ma= -0;b.na=0;b.oa=1;b.pa=0;k=this.M[5];a=a.rows[a.La++];h=a.Ea;h.Ba=0;h.Ca=0;h.Da=0;h.Fa=0;h.Ga=0;h.Ha=0;h.ka=0;h.la=0;h.ma=0;h.na=0;h.oa=0;h.pa=0;a.Na=0;a.Ua=0;a.Qa=0;a.Pa=0;a.motorSpeed=0;a.Db=0;a.Aa=k;a.Na=d;a.Ua=0;a.Qa=-Infinity;a.Pa=Infinity;b=a.Ea;b.ka=0;b.la=0;b.ma=1;b.na=0;b.oa=0;b.pa=1};rc.prototype.Gc=function(){za.prototype.Gc.call(this);var a=this.h,b=a.h.J.Ab,e=a.h.K.Ab,d=a.h.pb*a.h.cc+a.h.qb*a.h.dc+a.h.rb*a.h.ec;if(-.999999999>d){var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)*Mb,mc=(hc-ic)*Mb):(Mb=Math.sqrt(Yb-Ub-jc+1),lc=.5*Mb,Mb=.5/Mb,fc=(hc+ic)*Mb,Zb=(Xb+vc)*Mb,mc=(bc-Qb)*Mb);var ed=mc,Cc=2*(-1>=ed?3.14159265358979:1<=ed?0:Math.acos(ed));this.tb=fc;this.Va=Zb;this.Xa=lc;var wc=this.tb*this.tb+this.Va*this.Va+this.Xa*this.Xa;0=this.gd.frequency||!e)&&(h=this.M[3],n=a.rows[a.La++],q=n.Ea,q.Ba=0,q.Ca=0,q.Da=0,q.Fa=0,q.Ga=0,q.Ha=0,q.ka=0,q.la=0,q.ma=0,q.na=0,q.oa=0,q.pa=0,n.Na=0,n.Ua=0,n.Qa=0,n.Pa=0,n.motorSpeed=0,n.Db=0,n.Aa=h,this.Ed(n,this.yc,this.jd,H,this.gd,b,e),c=n.Ea,c.ka=this.h,c.la=this.Va,c.ma=this.Xa,c.na=this.h,c.oa=this.Va,c.pa=this.Xa);if(0>=this.hd.frequency||!e)H=this.M[4],a=a.rows[a.La++],h=a.Ea, -h.Ba=0,h.Ca=0,h.Da=0,h.Fa=0,h.Ga=0,h.Ha=0,h.ka=0,h.la=0,h.ma=0,h.na=0,h.oa=0,h.pa=0,a.Na=0,a.Ua=0,a.Qa=0,a.Pa=0,a.motorSpeed=0,a.Db=0,a.Aa=H,this.Ed(a,this.Mg,this.Zh,d,this.hd,b,e),c=a.Ea,c.ka=this.tb,c.la=this.Fb,c.ma=this.Gb,c.na=this.tb,c.oa=this.Fb,c.pa=this.Gb};Yb.prototype.Gc=function(){za.prototype.Gc.call(this);var a=this.pb;var b=this.qb;var e=this.rb;var d=this.cc;var c=this.dc;var f=this.ec;var h=this.pb;var k=this.Bc;var g=this.Id;var l=this.qb;var m=this.Cc;var n=this.Jd;var q=this.rb; -var p=this.Dc;var r=this.Kd;var t=a*d+b*c+e*f;if(-.999999999>t){var x=a*a;d=b*b;c=e*e;x=C?3.14159265358979:1<=C?0:Math.acos(C));C=v;y=H;H=a*this.Fd+x*this.Gd+t*this.Hd;A=b*this.Fd+d*this.Gd+f*this.Hd;v=e*this.Fd+c*this.Gd+N*this.Hd;this.Mg=Math.atan2(this.Id*H+this.Jd*A+this.Kd*v,this.Bc*H+this.Cc*A+this.Dc*v);this.tb=this.pb+this.cc;this.Fb=this.qb+this.dc;this.Gb=this.rb+this.ec;v=this.tb*this.tb+this.Fb*this.Fb+this.Gb*this.Gb;0t){var x=a*a;d=b*b;c=e*e;x=C?3.14159265358979:1<=C?0:Math.acos(C));C=v;y=H;H=a*this.Fd+x*this.Gd+t*this.Hd;A=b*this.Fd+d*this.Gd+f*this.Hd;v=e*this.Fd+c*this.Gd+O*this.Hd;this.Mg=Math.atan2(this.Id*H+this.Jd*A+this.Kd*v,this.Ac*H+this.Bc*A+this.Cc*v);this.tb=this.pb+this.cc;this.Fb=this.qb+this.dc;this.Gb=this.rb+this.ec;v=this.tb*this.tb+this.Fb*this.Fb+this.Gb*this.Gb;0=this.Xa.frequency||!e)h=this.M[3], q=a.rows[a.La++],p=q.Ea,p.Ba=0,p.Ca=0,p.Da=0,p.Fa=0,p.Ga=0,p.Ha=0,p.ka=0,p.la=0,p.ma=0,p.na=0,p.oa=0,p.pa=0,q.Na=0,q.Ua=0,q.Qa=0,q.Pa=0,q.motorSpeed=0,q.Db=0,q.Aa=h,this.Ed(q,this.Va,this.cg,C,this.Xa,b,e),c=q.Ea,c.ka=this.h.i,c.la=this.h.C,c.ma=this.h.I,c.na=this.h.i,c.oa=this.h.C,c.pa=this.h.I;b=this.M[4];e=a.rows[a.La++];C=e.Ea;C.Ba=0;C.Ca=0;C.Da=0;C.Fa=0;C.Ga=0;C.Ha=0;C.ka=0;C.la=0;C.ma=0;C.na=0;C.oa=0;C.pa=0;e.Na=0;e.Ua=0;e.Qa=0;e.Pa=0;e.motorSpeed=0;e.Db=0;e.Aa=b;e.Na=k;e.Ua=0;e.Qa=-Infinity; -e.Pa=Infinity;c=e.Ea;c.ka=this.h.M;c.la=this.h.V;c.ma=this.h.W;c.na=this.h.M;c.oa=this.h.V;c.pa=this.h.W;k=this.M[5];a=a.rows[a.La++];b=a.Ea;b.Ba=0;b.Ca=0;b.Da=0;b.Fa=0;b.Ga=0;b.Ha=0;b.ka=0;b.la=0;b.ma=0;b.na=0;b.oa=0;b.pa=0;a.Na=0;a.Ua=0;a.Qa=0;a.Pa=0;a.motorSpeed=0;a.Db=0;a.Aa=k;a.Na=d;a.Ua=0;a.Qa=-Infinity;a.Pa=Infinity;c=a.Ea;c.ka=this.h.Y;c.la=this.h.aa;c.ma=this.h.qa;c.na=this.h.Y;c.oa=this.h.aa;c.pa=this.h.qa};qc.prototype.Gc=function(){za.prototype.Gc.call(this);var a=this.h,b=a.h.J.Ab,e= -a.h.K.Ab,d=a.h.pb*a.h.cc+a.h.qb*a.h.dc+a.h.rb*a.h.ec;if(-.999999999>d){var c=a.h.pb,f=a.h.qb,h=a.h.rb,k=c*c,g=f*f,l=h*h;if(kM&&(M=-M,G=-G,P=-P,K=-K,pa=-pa);if(.999999gb){var pb=da*da,ab=Z*Z,$a=oa*oa;if(pb=Q?3.14159265358979:1<=Q?0:Math.acos(Q), -Ia=Ta*Ta+sa*sa+Ga*Ga;0=Q?3.14159265358979:1<=Q?0:Math.acos(Q);0>Eb*this.h.i+wb*this.h.C+Mb*this.h.I&&(this.Va=-this.Va);this.vd=this.ne-this.ke;this.ac=this.oe-this.le; -this.bc=this.pe-this.me};qc.prototype.nd=function(a,b){za.prototype.nd.call(this,a,b);this.tb(b,a,!1)};qc.prototype.Ec=function(a){za.prototype.Ec.call(this,a);this.tb(a,null,!0)};qc.prototype.yc=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};qc.prototype.hd=function(){var a=new z;a.x=this.cc;a.y=this.dc;a.z=this.ec;return a};qc.prototype.gd=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};qc.prototype.jd=function(a){a.x=this.cc;a.y=this.dc;a.z=this.ec};qc.prototype.$d=function(){var a= -new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};qc.prototype.be=function(){var a=new z;a.x=this.V;a.y=this.W;a.z=this.Y;return a};qc.prototype.ae=function(a){a.x=this.i;a.y=this.C;a.z=this.I};qc.prototype.Qd=function(a){a.x=this.V;a.y=this.W;a.z=this.Y};qc.prototype.Rd=function(){return this.Xa};qc.prototype.wd=function(){return this.cg};qc.prototype.tc=function(){return this.Va};rl(Uj,qf);Uj.prototype.Ia=function(a,b,e,d){this.h(a,b,e);e=this.localAxis1;var c=d.x;var f=d.y;var h=d.z;var k=a.g.A* -c+a.g.o*f+a.g.u*h;var g=a.g.j*c+a.g.v*f+a.g.l*h;a=a.g.m*c+a.g.s*f+a.g.B*h;e.x=k;e.y=g;e.z=a;a=this.localAxis2;e=d.x;k=d.y;c=d.z;d=b.g.A*e+b.g.o*k+b.g.u*c;g=b.g.j*e+b.g.v*k+b.g.l*c;b=b.g.m*e+b.g.s*k+b.g.B*c;a.x=d;a.y=g;a.z=b;return this};te.prototype.h=function(a,b){this.lowerLimit=a;this.upperLimit=b;return this};te.prototype.i=function(a,b){this.motorSpeed=a;this.motorTorque=b;return this};te.prototype.clone=function(){var a=new te;a.lowerLimit=this.lowerLimit;a.upperLimit=this.upperLimit;a.motorSpeed= -this.motorSpeed;a.motorTorque=this.motorTorque;return a};rl(Zi,za);Zi.prototype.Va=function(a,b,e){if(!(0d){var c=a.h.pb,f=a.h.qb,h=a.h.rb,k=c*c,g=f*f,l=h*h;if(kN&&(N=-N,G=-G,R=-R,K=-K,oa=-oa);if(.999999qb){var lb=ea*ea,bb=X*X,$a=ma*ma;if(lb=S?3.14159265358979:1<=S?0:Math.acos(S), +Ia=Qa*Qa+wa*wa+Da*Da;0=S?3.14159265358979:1<=S?0:Math.acos(S);0>Cb*this.h.i+vb*this.h.C+Kb*this.h.I&&(this.Va=-this.Va);this.vd=this.ne-this.ke;this.ac=this.oe-this.le; +this.bc=this.pe-this.me};qc.prototype.nd=function(a,b){ya.prototype.nd.call(this,a,b);this.tb(b,a,!1)};qc.prototype.Ec=function(a){ya.prototype.Ec.call(this,a);this.tb(a,null,!0)};qc.prototype.yc=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};qc.prototype.hd=function(){var a=new z;a.x=this.cc;a.y=this.dc;a.z=this.ec;return a};qc.prototype.gd=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};qc.prototype.jd=function(a){a.x=this.cc;a.y=this.dc;a.z=this.ec};qc.prototype.$d=function(){var a= +new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};qc.prototype.be=function(){var a=new z;a.x=this.V;a.y=this.W;a.z=this.Y;return a};qc.prototype.ae=function(a){a.x=this.i;a.y=this.C;a.z=this.I};qc.prototype.Qd=function(a){a.x=this.V;a.y=this.W;a.z=this.Y};qc.prototype.Rd=function(){return this.Xa};qc.prototype.wd=function(){return this.cg};qc.prototype.tc=function(){return this.Va};rl(Uj,jf);Uj.prototype.Ia=function(a,b,e,d){this.h(a,b,e);e=this.localAxis1;var c=d.x;var f=d.y;var h=d.z;var k=a.g.A* +c+a.g.o*f+a.g.u*h;var g=a.g.j*c+a.g.v*f+a.g.l*h;a=a.g.m*c+a.g.s*f+a.g.B*h;e.x=k;e.y=g;e.z=a;a=this.localAxis2;e=d.x;k=d.y;c=d.z;d=b.g.A*e+b.g.o*k+b.g.u*c;g=b.g.j*e+b.g.v*k+b.g.l*c;b=b.g.m*e+b.g.s*k+b.g.B*c;a.x=d;a.y=g;a.z=b;return this};ne.prototype.h=function(a,b){this.lowerLimit=a;this.upperLimit=b;return this};ne.prototype.i=function(a,b){this.motorSpeed=a;this.motorTorque=b;return this};ne.prototype.clone=function(){var a=new ne;a.lowerLimit=this.lowerLimit;a.upperLimit=this.upperLimit;a.motorSpeed= +this.motorSpeed;a.motorTorque=this.motorTorque;return a};rl(Zi,ya);Zi.prototype.Va=function(a,b,e){if(!(0=this.tc.frequency)&&e||(h=this.M[3],q=a.rows[a.La++],p=q.Ea,p.Ba=0,p.Ca=0,p.Da=0,p.Fa=0,p.Ga=0,p.Ha=0,p.ka=0,p.la=0,p.ma=0,p.na=0,p.oa=0,p.pa=0,q.Na=0,q.Ua=0,q.Qa=0,q.Pa= -0,q.motorSpeed=0,q.Db=0,q.Aa=h,this.Ed(q,this.qe,this.Sh,C,this.tc,b,e),c=q.Ea,c.ka=this.h,c.la=this.Va,c.ma=this.Xa,c.na=this.h,c.oa=this.Va,c.pa=this.Xa);this.jd||(C=this.M[4],h=a.rows[a.La++],q=h.Ea,q.Ba=0,q.Ca=0,q.Da=0,q.Fa=0,q.Ga=0,q.Ha=0,q.ka=0,q.la=0,q.ma=0,q.na=0,q.oa=0,q.pa=0,h.Na=0,h.Ua=0,h.Qa=0,h.Pa=0,h.motorSpeed=0,h.Db=0,h.Aa=C,h.Na=k,h.Ua=0,h.Qa=-Infinity,h.Pa=Infinity,c=h.Ea,c.ka=this.Mc,c.la=this.Nc,c.ma=this.Oc,c.na=this.Mc,c.oa=this.Nc,c.pa=this.Oc);this.wd||!(0>=this.yc.frequency)&& -e||(k=this.M[5],a=a.rows[a.La++],C=a.Ea,C.Ba=0,C.Ca=0,C.Da=0,C.Fa=0,C.Ga=0,C.Ha=0,C.ka=0,C.la=0,C.ma=0,C.na=0,C.oa=0,C.pa=0,a.Na=0,a.Ua=0,a.Qa=0,a.Pa=0,a.motorSpeed=0,a.Db=0,a.Aa=k,this.Ed(a,this.re,this.Th,d,this.yc,b,e),c=a.Ea,c.ka=this.tb,c.la=this.Fb,c.ma=this.Gb,c.na=this.tb,c.oa=this.Fb,c.pa=this.Gb)};cc.prototype.Gc=function(){za.prototype.Gc.call(this);var a=this.pb;var b=this.qb;var e=this.rb;var d=this.se;var c=this.te;var f=this.ue;var h=c*e-f*b;var k=f*a-d*e;var g=d*b-c*a;this.h=k*f-g* +0,q.motorSpeed=0,q.Db=0,q.Aa=h,this.Ed(q,this.qe,this.Uh,C,this.tc,b,e),c=q.Ea,c.ka=this.h,c.la=this.Va,c.ma=this.Xa,c.na=this.h,c.oa=this.Va,c.pa=this.Xa);this.jd||(C=this.M[4],h=a.rows[a.La++],q=h.Ea,q.Ba=0,q.Ca=0,q.Da=0,q.Fa=0,q.Ga=0,q.Ha=0,q.ka=0,q.la=0,q.ma=0,q.na=0,q.oa=0,q.pa=0,h.Na=0,h.Ua=0,h.Qa=0,h.Pa=0,h.motorSpeed=0,h.Db=0,h.Aa=C,h.Na=k,h.Ua=0,h.Qa=-Infinity,h.Pa=Infinity,c=h.Ea,c.ka=this.Mc,c.la=this.Nc,c.ma=this.Oc,c.na=this.Mc,c.oa=this.Nc,c.pa=this.Oc);this.wd||!(0>=this.yc.frequency)&& +e||(k=this.M[5],a=a.rows[a.La++],C=a.Ea,C.Ba=0,C.Ca=0,C.Da=0,C.Fa=0,C.Ga=0,C.Ha=0,C.ka=0,C.la=0,C.ma=0,C.na=0,C.oa=0,C.pa=0,a.Na=0,a.Ua=0,a.Qa=0,a.Pa=0,a.motorSpeed=0,a.Db=0,a.Aa=k,this.Ed(a,this.re,this.Vh,d,this.yc,b,e),c=a.Ea,c.ka=this.tb,c.la=this.Fb,c.ma=this.Gb,c.na=this.tb,c.oa=this.Fb,c.pa=this.Gb)};dc.prototype.Gc=function(){ya.prototype.Gc.call(this);var a=this.pb;var b=this.qb;var e=this.rb;var d=this.se;var c=this.te;var f=this.ue;var h=c*e-f*b;var k=f*a-d*e;var g=d*b-c*a;this.h=k*f-g* c;this.Va=g*d-h*f;this.Xa=h*c-k*d;this.Mc=h;this.Nc=k;this.Oc=g;this.tb=b*g-e*k;this.Fb=e*h-a*g;this.Gb=a*k-b*h;a=this.h*this.h+this.Va*this.Va+this.Xa*this.Xa;0=B?(a=Math.atan2(C,H),l=.5*a,B=-1.570796326794895,a=.5*-a):1<=B?(a=Math.atan2(C,H),l=.5*a,B=1.570796326794895,a*=.5):(l=Math.atan2(-(l* -t+n*x+p*v),m*t+q*x+r*v),B=Math.asin(B),a=Math.atan2(-(a*k+b*d+e*f),a*h+b*g+e*c));this.qe=l;this.Df=B;this.re=a;this.vd=this.ne-this.ke;this.ac=this.oe-this.le;this.bc=this.pe-this.me};cc.prototype.nd=function(a,b){za.prototype.nd.call(this,a,b);this.gd(b,a,!1)};cc.prototype.Ec=function(a){za.prototype.Ec.call(this,a);this.gd(a,null,!0)};cc.prototype.$d=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};cc.prototype.be=function(){var a=new z;a.x=this.se;a.y=this.te;a.z=this.ue;return a}; -cc.prototype.ae=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};cc.prototype.Qd=function(a){a.x=this.se;a.y=this.te;a.z=this.ue};cc.prototype.Rd=function(){var a=new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};cc.prototype.Xe=function(){var a=new z;a.x=this.Rb;a.y=this.Sb;a.z=this.Wb;return a};cc.prototype.We=function(a){a.x=this.i;a.y=this.C;a.z=this.I};cc.prototype.Ye=function(a){a.x=this.Rb;a.y=this.Sb;a.z=this.Wb};cc.prototype.gi=function(){return this.tc};cc.prototype.hi=function(){return this.yc}; -cc.prototype.tg=function(){return this.Sh};cc.prototype.ug=function(){return this.Th};cc.prototype.Ze=function(){return this.qe};cc.prototype.sg=function(){return this.re};rl(Sj,qf);Sj.prototype.Ia=function(a,b,e,d,c){this.h(a,b,e);e=this.localAxis1;var f=d.x;var h=d.y;var k=d.z;d=a.g.A*f+a.g.o*h+a.g.u*k;var g=a.g.j*f+a.g.v*h+a.g.l*k;a=a.g.m*f+a.g.s*h+a.g.B*k;e.x=d;e.y=g;e.z=a;a=this.localAxis2;e=c.x;f=c.y;d=c.z;c=b.g.A*e+b.g.o*f+b.g.u*d;h=b.g.j*e+b.g.v*f+b.g.l*d;b=b.g.m*e+b.g.s*f+b.g.B*d;a.x=c;a.y= -h;a.z=b;return this};Bk.prototype.Ia=function(a){this.Ic=a.Ic;for(var b=0,e=this.Ic;bm?n.Qa:0q.Pa+ra.directMlcpSolverEps){b=!1;break}c[n]=r-p}if(!b)return!1;k=0;for(g=this.Ic;k -n&&l>ra.directMlcpSolverEps||0e.Pa;0==e.Qa&&0==e.Pa?(c=this.h,c.Qf[c.Ic]=b,c.Sf[c.Ic]=0,c.Ic++,this.I(a,b+1),this.h.Ic--):(e=this.h,e.xf[e.Md]=b,e.Md++,this.I(a,b+1),this.h.Md--,d&&(d=this.h,d.Qf[d.Ic]=b,d.Sf[d.Ic]=-1,d.Ic++,this.I(a,b+1),this.h.Ic--),c&&(c=this.h,c.Qf[c.Ic]=b, -c.Sf[c.Ic]=1,c.Ic++,this.I(a,b+1),this.h.Ic--))}};rl(yd,bd);yd.prototype.Rf=function(a){this.h.Gc();this.h.nd(a,this.info);this.J=this.info.Yd;this.K=this.info.Zd;this.W.I(this.info,this.I);a=this.i;a.i=0;var b=a.h;b.Ic=0;b.Md=0;a.I(this.info,0);a=this.qa;b=this.i.i;for(var e=0,d=0,c=0,f=a.C;c=B?(a=Math.atan2(C,H),l=.5*a,B=-1.570796326794895,a=.5*-a):1<=B?(a=Math.atan2(C,H),l=.5*a,B=1.570796326794895,a*=.5):(l=Math.atan2(-(l* +t+n*x+p*v),m*t+q*x+r*v),B=Math.asin(B),a=Math.atan2(-(a*k+b*d+e*f),a*h+b*g+e*c));this.qe=l;this.Df=B;this.re=a;this.vd=this.ne-this.ke;this.ac=this.oe-this.le;this.bc=this.pe-this.me};dc.prototype.nd=function(a,b){ya.prototype.nd.call(this,a,b);this.gd(b,a,!1)};dc.prototype.Ec=function(a){ya.prototype.Ec.call(this,a);this.gd(a,null,!0)};dc.prototype.$d=function(){var a=new z;a.x=this.pb;a.y=this.qb;a.z=this.rb;return a};dc.prototype.be=function(){var a=new z;a.x=this.se;a.y=this.te;a.z=this.ue;return a}; +dc.prototype.ae=function(a){a.x=this.pb;a.y=this.qb;a.z=this.rb};dc.prototype.Qd=function(a){a.x=this.se;a.y=this.te;a.z=this.ue};dc.prototype.Rd=function(){var a=new z;a.x=this.i;a.y=this.C;a.z=this.I;return a};dc.prototype.Xe=function(){var a=new z;a.x=this.Rb;a.y=this.Sb;a.z=this.Wb;return a};dc.prototype.We=function(a){a.x=this.i;a.y=this.C;a.z=this.I};dc.prototype.Ye=function(a){a.x=this.Rb;a.y=this.Sb;a.z=this.Wb};dc.prototype.ii=function(){return this.tc};dc.prototype.ji=function(){return this.yc}; +dc.prototype.tg=function(){return this.Uh};dc.prototype.ug=function(){return this.Vh};dc.prototype.Ze=function(){return this.qe};dc.prototype.sg=function(){return this.re};rl(Sj,jf);Sj.prototype.Ia=function(a,b,e,d,c){this.h(a,b,e);e=this.localAxis1;var f=d.x;var h=d.y;var k=d.z;d=a.g.A*f+a.g.o*h+a.g.u*k;var g=a.g.j*f+a.g.v*h+a.g.l*k;a=a.g.m*f+a.g.s*h+a.g.B*k;e.x=d;e.y=g;e.z=a;a=this.localAxis2;e=c.x;f=c.y;d=c.z;c=b.g.A*e+b.g.o*f+b.g.u*d;h=b.g.j*e+b.g.v*f+b.g.l*d;b=b.g.m*e+b.g.s*f+b.g.B*d;a.x=c;a.y= +h;a.z=b;return this};Bk.prototype.Ia=function(a){this.Ic=a.Ic;for(var b=0,e=this.Ic;bm?n.Qa:0q.Pa+Ba.directMlcpSolverEps){b=!1;break}c[n]=r-p}if(!b)return!1;k=0;for(g=this.Ic;k +n&&l>Ba.directMlcpSolverEps||0e.Pa;0==e.Qa&&0==e.Pa?(c=this.h,c.Qf[c.Ic]=b,c.Sf[c.Ic]=0,c.Ic++,this.I(a,b+1),this.h.Ic--):(e=this.h,e.xf[e.Md]=b,e.Md++,this.I(a,b+1),this.h.Md--,d&&(d=this.h,d.Qf[d.Ic]=b,d.Sf[d.Ic]=-1,d.Ic++,this.I(a,b+1),this.h.Ic--),c&&(c=this.h,c.Qf[c.Ic]=b, +c.Sf[c.Ic]=1,c.Ic++,this.I(a,b+1),this.h.Ic--))}};rl(yd,cd);yd.prototype.Rf=function(a){this.h.Gc();this.h.nd(a,this.info);this.J=this.info.Yd;this.K=this.info.Zd;this.W.I(this.info,this.I);a=this.i;a.i=0;var b=a.h;b.Ic=0;b.Md=0;a.I(this.info,0);a=this.qa;b=this.i.i;for(var e=0,d=0,c=0,f=a.C;c=b)for(b=0,a=this.info.La;bc.Pa&&(h=c.Pa);f.Aa=h;0c&&(h=c),f.Tc=h):f.Tc=0;this.C[d]=f.Aa+f.Tc}b=this.C;e=a=!1;d=this.J.ub;f=this.J.vb;c=this.J.wb;h=this.K.ub;var k=this.K.vb;var g=this.K.wb;var l=this.J.xb;var m=this.J.yb;var n=this.J.zb;var q=this.K.xb;var p=this.K.yb;var r=this.K.zb;for(var t=0,x=this.info.La;t< x;){var v=t++,B=this.info.rows[v].Ea,H=this.I[v];v=b[v];0!=(B.sc&1)&&(d+=H.$c*v,f+=H.ad*v,c+=H.bd*v,h+=H.cd*-v,k+=H.dd*-v,g+=H.ed*-v,a=!0);0!=(B.sc&2)&&(l+=H.Uc*v,m+=H.Vc*v,n+=H.Wc*v,q+=H.Xc*-v,p+=H.Yc*-v,r+=H.Zc*-v,e=!0)}a&&(this.J.ub=d,this.J.vb=f,this.J.wb=c,this.K.ub=h,this.K.vb=k,this.K.wb=g);e&&(this.J.xb=l,this.J.yb=m,this.J.zb=n,this.K.xb=q,this.K.yb=p,this.K.zb=r)}};yd.prototype.Vf=function(){var a=this.info.La;var b=this.J.ub;var e=this.J.vb;var d=this.J.wb;var c=this.K.ub;var f=this.K.vb; var h=this.K.wb;var k=this.J.xb;var g=this.J.yb;var l=this.J.zb;var m=this.K.xb;var n=this.K.yb;var q=this.K.zb;for(var p=0;pk&&(h=k),c.Tc=h,c=h-f,this.Y[d]=c,f=0;faa){var Ja=aa*aa;Ua=.5*(1-.16666666666666666*Ja+Ja*Ja*.008333333333333333);xa=1-.5*Ja+Ja*Ja*.041666666666666664}else Ua=Math.sin(aa)/Aa,xa=Math.cos(aa);var S=void 0,la=void 0,qa=void 0;S=pa*Ua;la=M*Ua;qa=Sa*Ua;var Da=void 0,X=void 0,fa=void 0, -w=void 0;Da=S;X=la;fa=qa;w=xa;var ja=void 0,ea=void 0,U=void 0,ba=void 0,Fa=D.g.A,ka=D.g.v,Qa=D.g.B,Ka=Fa+ka+Qa,V=void 0;0ka?Fa>Qa?(V=Math.sqrt(Fa-ka-Qa+1),ja=.5*V,V=.5/V,ea=(D.g.j+D.g.o)*V,U=(D.g.m+D.g.u)*V,ba=(D.g.l-D.g.s)*V):(V=Math.sqrt(Qa-Fa-ka+1),U=.5*V,V=.5/V,ja=(D.g.m+D.g.u)*V,ea=(D.g.s+D.g.l)*V,ba=(D.g.o-D.g.j)*V):ka>Qa?(V=Math.sqrt(ka-Qa-Fa+1),ea=.5*V,V=.5/V,ja=(D.g.j+D.g.o)*V,U=(D.g.s+D.g.l)* -V,ba=(D.g.m-D.g.u)*V):(V=Math.sqrt(Qa-Fa-ka+1),U=.5*V,V=.5/V,ja=(D.g.m+D.g.u)*V,ea=(D.g.s+D.g.l)*V,ba=(D.g.o-D.g.j)*V);ja=w*ja+Da*ba+X*U-fa*ea;ea=w*ea-Da*U+X*ba+fa*ja;U=w*U+Da*ea-X*ja+fa*ba;ba=w*ba-Da*ja-X*ea-fa*U;var ob=ja*ja+ea*ea+U*U+ba*ba;1E-32lb){var eb=lb*lb;yb=.5*(1-.16666666666666666*eb+eb*eb*.008333333333333333);vb=1-.5*eb+eb*eb*.041666666666666664}else yb=Math.sin(lb)/ub,vb=Math.cos(lb);var Lb=void 0,mb=void 0,zb=void 0;Lb=Pa*yb;mb=Ca*yb;zb=Ra*yb;var u=void 0,T=void 0,R=void 0,va=void 0;u=Lb;T=mb;R=zb;va=vb;var Na=void 0,ya=void 0,Oa=void 0, -kb=void 0,sb=F.g.A,Hb=F.g.v,Ba=F.g.B,Ta=sb+Hb+Ba,sa=void 0;0Hb?sb>Ba?(sa=Math.sqrt(sb-Hb-Ba+1),Na=.5*sa,sa=.5/sa,ya=(F.g.j+F.g.o)*sa,Oa=(F.g.m+F.g.u)*sa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k;this.J.zb=g;this.K.xb=l;this.K.yb=m;this.K.zb=n};Nd.prototype.Bf=function(){this.i.Wh();this.i.Ec(this.info);var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba;var q=this.K.ca;var p=this.K.da;var r=this.K.ea;var t=this.K.fa;var x=this.K.ga;var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C=0,N=this.info.La;Cx.Hb&&(x.Hb=0);t=x.Hb-v;a+=r.gg*t;b+=r.hg*t;e+=r.ig*t;d+=r.jg*-t;c+=r.kg*-t;f+=r.lg*-t;h+=r.Pe*t;k+=r.Qe*t;g+=r.Re* -t;l+=r.Se*-t;m+=r.Te*-t;n+=r.Ue*-t}this.J.Pc=a;this.J.Qc=b;this.J.Rc=e;this.K.Pc=d;this.K.Qc=c;this.K.Rc=f;this.J.Jc=h;this.J.Kc=k;this.J.Lc=g;this.K.Jc=l;this.K.Kc=m;this.K.Lc=n};Nd.prototype.Tf=function(){this.i.Wh();this.i.Ec(this.info);var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba;var q=this.K.ca;var p=this.K.da;var r=this.K.ea;var t=this.K.fa;var x=this.K.ga; -var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C=0,N=this.info.La;CJa.Hb&&(Ja.Hb=0);qa=Ja.Hb-Da;Sa+=xa.gg*qa;Pa+=xa.hg*qa;Ca+=xa.ig*qa;Ra+=xa.jg*-qa;wa+=xa.kg*-qa;La+=xa.lg*-qa;Ea+=xa.Pe* -qa;O+=xa.Qe*qa;ma+=xa.Re*qa;Y+=xa.Se*-qa;ta+=xa.Te*-qa;Va+=xa.Ue*-qa}var X=this.J;X.g.F+=Sa;X.g.G+=Pa;X.g.H+=Ca;var fa=this.K;fa.g.F+=Ra;fa.g.G+=wa;fa.g.H+=La;var w=this.J,ja=Math.sqrt(Ea*Ea+O*O+ma*ma),ea=.5*ja;if(.5>ea){var U=ea*ea;var ba=.5*(1-.16666666666666666*U+U*U*.008333333333333333);var Fa=1-.5*U+U*U*.041666666666666664}else ba=Math.sin(ea)/ja,Fa=Math.cos(ea);var ka=Ea*ba;var Qa=O*ba;var Ka=ma*ba;var V=Fa;var ob=w.g.A,Za=w.g.v,W=w.g.B,ha=ob+Za+W;if(0Za?ob>W?(I=Math.sqrt(ob-Za-W+1),ca=.5*I,I=.5/I,da=(w.g.j+w.g.o)*I,Z=(w.g.m+w.g.u)*I,na=(w.g.l-w.g.s)*I):(I=Math.sqrt(W-ob-Za+1),Z=.5*I,I=.5/I,ca=(w.g.m+w.g.u)*I,da=(w.g.s+w.g.l)*I,na=(w.g.o-w.g.j)*I):Za>W?(I=Math.sqrt(Za-W-ob+1),da=.5*I,I=.5/I,ca=(w.g.j+w.g.o)*I,Z=(w.g.s+w.g.l)*I,na=(w.g.m-w.g.u)*I):(I=Math.sqrt(W-ob-Za+1),Z=.5*I,I=.5/I,ca=(w.g.m+w.g.u)*I,da=(w.g.s+w.g.l)*I,na=(w.g.o-w.g.j)*I);ca=V*ca+ka*na+Qa*Z-Ka* -da;da=V*da-ka*Z+Qa*na+Ka*ca;Z=V*Z+ka*da-Qa*ca+Ka*na;na=V*na-ka*ca-Qa*da-Ka*Z;var oa=ca*ca+da*da+Z*Z+na*na;1E-32R){var va=R*R;var Na=.5*(1-.16666666666666666*va+va*va*.008333333333333333); -var ya=1-.5*va+va*va*.041666666666666664}else Na=Math.sin(R)/T,ya=Math.cos(R);var Oa=Y*Na;var kb=ta*Na;var sb=Va*Na;var Hb=ya;var Ba=u.g.A,Ta=u.g.v,sa=u.g.B,Ga=Ba+Ta+sa;if(0Ta?Ba>sa?(Q=Math.sqrt(Ba-Ta-sa+1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=d;this.K.vb=c;this.K.wb=f;this.J.xb=h;this.J.yb=k;this.J.zb=g;this.K.xb=l;this.K.yb=m;this.K.zb=n};xd.prototype.rg=function(a){for(var b,e,d,c,f,h,k=h=f=c=d= -e=b=0,g=this.info.La;kt.Pa&&(x.Hb=t.Pa);v=x.Hb-B;a+=r.$c*v;b+=r.ad*v;e+=r.bd*v;d+=r.cd*-v;c+=r.dd*-v;f+=r.ed*-v;h+=r.Uc*v;k+=r.Vc*v;g+=r.Wc*v;l+=r.Xc*-v;m+=r.Yc*-v;n+=r.Zc*-v}this.J.Pc=a;this.J.Qc=b;this.J.Rc=e;this.K.Pc=d;this.K.Qc=c;this.K.Rc=f;this.J.Jc= -h;this.J.Kc=k;this.J.Lc=g;this.K.Jc=l;this.K.Kc=m;this.K.Lc=n};xd.prototype.Tf=function(){this.h.Gc();this.h.Ec(this.info);this.J=this.info.Yd;this.K=this.info.Zd;var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba;var q=this.K.ca;var p=this.K.da;var r=this.K.ea;var t=this.K.fa;var x=this.K.ga;var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C=0,N=this.info.La;C< -N;){var y=C++,A=this.i[y],E=this.info.rows[y].Ea;A.$c=E.Ba*a;A.ad=E.Ca*a;A.bd=E.Da*a;A.cd=E.Fa*b;A.dd=E.Ga*b;A.ed=E.Ha*b;var L=void 0,G=void 0,P=void 0;L=e*E.ka+d*E.la+c*E.ma;G=f*E.ka+h*E.la+k*E.ma;P=g*E.ka+l*E.la+m*E.ma;A.Uc=L;A.Vc=G;A.Wc=P;var K=void 0,pa=void 0,M=void 0;K=n*E.na+q*E.oa+p*E.pa;pa=r*E.na+t*E.oa+x*E.pa;M=v*E.na+B*E.oa+H*E.pa;A.Xc=K;A.Yc=pa;A.Zc=M;A.mass=A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*Eb+wb*wb+Ma*Ma;1E-32 -ra.maxTranslationPerStep*ra.maxTranslationPerStep&&(h=ra.maxTranslationPerStep/Math.sqrt(h),this.ub*=h,this.vb*=h,this.wb*=h,b*=h,e*=h,d*=h);k>ra.maxRotationPerStep*ra.maxRotationPerStep&&(k=ra.maxRotationPerStep/Math.sqrt(k),this.xb*=k,this.yb*=k,this.zb*=k,c*=k,f*=k,a*=k);this.g.F+=b;this.g.G+=e;this.g.H+=d;b=Math.sqrt(c*c+f*f+a*a);e=.5*b;.5>e?(e*=e,b=.5*(1-.16666666666666666*e+e*e*.008333333333333333),e=1-.5*e+e*e*.041666666666666664):(b=Math.sin(e)/b,e=Math.cos(e));c*=b;f*=b;a*=b;b=e;e=this.g.A; -d=this.g.v;k=this.g.B;h=e+d+k;if(0d?e>k?(g=Math.sqrt(e-d-k+1),h=.5*g,g=.5/g,k=(this.g.j+this.g.o)*g,d=(this.g.m+this.g.u)*g,e=(this.g.l-this.g.s)*g):(g=Math.sqrt(k-e-d+1),d=.5*g,g=.5/g,h=(this.g.m+this.g.u)*g,k=(this.g.s+this.g.l)*g,e=(this.g.o-this.g.j)*g):d>k?(g=Math.sqrt(d-k-e+1),k=.5*g,g=.5/g,h=(this.g.j+this.g.o)*g,d=(this.g.s+this.g.l)*g,e=(this.g.m-this.g.u)*g):(g=Math.sqrt(k- -e-d+1),d=.5*g,g=.5/g,h=(this.g.m+this.g.u)*g,k=(this.g.s+this.g.l)*g,e=(this.g.o-this.g.j)*g);h=b*h+c*e+f*d-a*k;k=b*k-c*d+f*e+a*h;d=b*d+c*k-f*h+a*e;e=b*e-c*h-f*k-a*d;a=h*h+k*k+d*d+e*e;1E-32b?(b*=b,a=.5*(1-.16666666666666666*b+b*b*.008333333333333333),b=1-.5*b+b*b*.041666666666666664):(a=Math.sin(b)/a,b=Math.cos(b));d*=a;c*=a;f*=a;a=b;b=this.g.A;e=this.g.v;var h=this.g.B;var k=b+e+h;if(0e?b>h?(g=Math.sqrt(b-e-h+1),k=.5*g,g=.5/g,h=(this.g.j+ -this.g.o)*g,e=(this.g.m+this.g.u)*g,b=(this.g.l-this.g.s)*g):(g=Math.sqrt(h-b-e+1),e=.5*g,g=.5/g,k=(this.g.m+this.g.u)*g,h=(this.g.s+this.g.l)*g,b=(this.g.o-this.g.j)*g):e>h?(g=Math.sqrt(e-h-b+1),h=.5*g,g=.5/g,k=(this.g.j+this.g.o)*g,e=(this.g.s+this.g.l)*g,b=(this.g.m-this.g.u)*g):(g=Math.sqrt(h-b-e+1),e=.5*g,g=.5/g,k=(this.g.m+this.g.u)*g,h=(this.g.s+this.g.l)*g,b=(this.g.o-this.g.j)*g);k=a*k+d*b+c*e-f*h;h=a*h-d*e+c*b+f*k;e=a*e+d*h-c*k+f*b;b=a*b-d*k-c*h-f*e;c=k*k+h*h+e*e+b*b;1E-32d||1E-32a.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,e=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=e,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}this.Ob=!1;this.Kb=0};J.prototype.tf=function(a){var b=a.x;var e=a.y;a=a.z;this.g.F+=b;this.g.G+=e;this.g.H+=a;b=this.za;e=this.g;b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;for(b=this.vc;null!= -b;){e=b.U;var d=this.za;a=this.g;var c=b.za,f=b.ra;var h=d.A*f.A+d.j*f.o+d.m*f.u;var k=d.A*f.j+d.j*f.v+d.m*f.l;var g=d.A*f.m+d.j*f.s+d.m*f.B;var l=d.o*f.A+d.v*f.o+d.s*f.u;var m=d.o*f.j+d.v*f.v+d.s*f.l;var n=d.o*f.m+d.v*f.s+d.s*f.B;var q=d.u*f.A+d.l*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11=this.g.v;a.e12=this.g.s;a.e20=this.g.u;a.e21=this.g.l;a.e22=this.g.B;return a};J.prototype.Gb=function(a){a.e00= -this.g.A;a.e01=this.g.j;a.e02=this.g.m;a.e10=this.g.o;a.e11=this.g.v;a.e12=this.g.s;a.e20=this.g.u;a.e21=this.g.l;a.e22=this.g.B};J.prototype.Ie=function(a){this.g.A=a.e00;this.g.j=a.e01;this.g.m=a.e02;this.g.o=a.e10;this.g.v=a.e11;this.g.s=a.e12;this.g.u=a.e20;this.g.l=a.e21;this.g.B=a.e22;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;var b=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;var e=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;var d=this.g.o*this.bb+this.g.v*this.fb+this.g.s* -this.ib;var c=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;var f=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;b=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;e=this.ba*this.g.u+ -this.ca*this.g.l+this.da*this.g.B;d=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;c=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;f=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*= -this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;a=this.za;b=this.g;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B;for(a=this.vc;null!=a;){b=a.U;d=this.za;e=this.g;c=a.za;f=a.ra;h=d.A*f.A+d.j*f.o+d.m*f.u;k=d.A*f.j+d.j*f.v+d.m*f.l;g=d.A*f.m+d.j*f.s+d.m*f.B;var l=d.o*f.A+d.v*f.o+d.s*f.u;var m=d.o*f.j+d.v*f.v+d.s*f.l;var n=d.o*f.m+d.v*f.s+d.s*f.B;var q=d.u*f.A+d.l*f.o+d.B*f.u;var p=d.u*f.j+d.l*f.v+d.B* -f.l;var r=d.u*f.m+d.l*f.s+d.B*f.B;c.A=h;c.j=k;c.m=g;c.o=l;c.v=m;c.s=n;c.u=q;c.l=p;c.B=r;h=d.A*f.F+d.j*f.G+d.m*f.H;k=d.o*f.F+d.v*f.G+d.s*f.H;f=d.u*f.F+d.l*f.G+d.B*f.H;c.F=h;c.G=k;c.H=f;c.F+=d.F;c.G+=d.G;c.H+=d.H;d=a.g;c=a.ra;f=e.A*c.A+e.j*c.o+e.m*c.u;h=e.A*c.j+e.j*c.v+e.m*c.l;k=e.A*c.m+e.j*c.s+e.m*c.B;g=e.o*c.A+e.v*c.o+e.s*c.u;l=e.o*c.j+e.v*c.v+e.s*c.l;m=e.o*c.m+e.v*c.s+e.s*c.B;n=e.u*c.A+e.l*c.o+e.B*c.u;q=e.u*c.j+e.l*c.v+e.B*c.l;p=e.u*c.m+e.l*c.s+e.B*c.B;d.A=f;d.j=h;d.m=k;d.o=g;d.v=l;d.s=m;d.u=n;d.l= -q;d.B=p;f=e.A*c.F+e.j*c.G+e.m*c.H;h=e.o*c.F+e.v*c.G+e.s*c.H;c=e.u*c.F+e.l*c.G+e.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=e.F;d.G+=e.G;d.H+=e.H;a.Tb.Yb(a.D,a.za);e=a.D.wa;d=a.D.xa;c=a.D.ya;f=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=ea.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(e=a.g.F-a.za.F,d=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=e,f.y=d,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}this.Ob=!1;this.Kb= -0};J.prototype.rf=function(a){var b=a.x;var e=a.y;var d=a.z;a=Math.sin(b);var c=Math.sin(e),f=Math.sin(d);b=Math.cos(b);e=Math.cos(e);d=Math.cos(d);this.g.A=e*d;this.g.j=-e*f;this.g.m=c;this.g.o=b*f+d*a*c;this.g.v=b*d-a*c*f;this.g.s=-e*a;this.g.u=a*f-b*d*c;this.g.l=d*a+b*c*f;this.g.B=b*e;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;c=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;f=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;e=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib; -d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;b=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=c;this.da=f;this.ea=e;this.fa=d;this.ga=b;this.ha=h;this.ia=k;this.ja=g;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;c=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;f=this.ba*this.g.u+this.ca*this.g.l+ -this.da*this.g.B;e=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;b=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=c;this.da=f;this.ea=e;this.fa=d;this.ga=b;this.ha=h;this.ia=k;this.ja=g;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*= -this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;a=this.za;c=this.g;a.F=c.F;a.G=c.G;a.H=c.H;a.A=c.A;a.j=c.j;a.m=c.m;a.o=c.o;a.v=c.v;a.s=c.s;a.u=c.u;a.l=c.l;a.B=c.B;for(a=this.vc;null!=a;){c=a.U;e=this.za;f=this.g;d=a.za;b=a.ra;h=e.A*b.A+e.j*b.o+e.m*b.u;k=e.A*b.j+e.j*b.v+e.m*b.l;g=e.A*b.m+e.j*b.s+e.m*b.B;var l=e.o*b.A+e.v*b.o+e.s*b.u;var m=e.o*b.j+e.v*b.v+e.s*b.l;var n=e.o*b.m+e.v*b.s+e.s*b.B;var q=e.u*b.A+e.l*b.o+e.B*b.u;var p=e.u*b.j+e.l*b.v+e.B*b.l;var r=e.u*b.m+ -e.l*b.s+e.B*b.B;d.A=h;d.j=k;d.m=g;d.o=l;d.v=m;d.s=n;d.u=q;d.l=p;d.B=r;h=e.A*b.F+e.j*b.G+e.m*b.H;k=e.o*b.F+e.v*b.G+e.s*b.H;b=e.u*b.F+e.l*b.G+e.B*b.H;d.F=h;d.G=k;d.H=b;d.F+=e.F;d.G+=e.G;d.H+=e.H;e=a.g;d=a.ra;b=f.A*d.A+f.j*d.o+f.m*d.u;h=f.A*d.j+f.j*d.v+f.m*d.l;k=f.A*d.m+f.j*d.s+f.m*d.B;g=f.o*d.A+f.v*d.o+f.s*d.u;l=f.o*d.j+f.v*d.v+f.s*d.l;m=f.o*d.m+f.v*d.s+f.s*d.B;n=f.u*d.A+f.l*d.o+f.B*d.u;q=f.u*d.j+f.l*d.v+f.B*d.l;p=f.u*d.m+f.l*d.s+f.B*d.B;e.A=b;e.j=h;e.m=k;e.o=g;e.v=l;e.s=m;e.u=n;e.l=q;e.B=p;b=f.A*d.F+ -f.j*d.G+f.m*d.H;h=f.o*d.F+f.v*d.G+f.s*d.H;d=f.u*d.F+f.l*d.G+f.B*d.H;e.F=b;e.G=h;e.H=d;e.F+=f.F;e.G+=f.G;e.H+=f.H;a.Tb.Yb(a.D,a.za);f=a.D.wa;e=a.D.xa;d=a.D.ya;b=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=fa.D.ta?b:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(f=a.g.F-a.za.F,e=a.g.G-a.za.G,d=a.g.H-a.za.H,b=a.qc,b.x=f,b.y=e,b.z=d,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=c}this.Ob=!1;this.Kb=0};J.prototype.Ed= -function(a){var b=a.e00;var e=a.e01;var d=a.e02;var c=a.e10;var f=a.e11;var h=a.e12;var k=a.e20;var g=a.e21;var l=a.e22;a=b*this.g.A+e*this.g.o+d*this.g.u;var m=b*this.g.j+e*this.g.v+d*this.g.l;b=b*this.g.m+e*this.g.s+d*this.g.B;e=c*this.g.A+f*this.g.o+h*this.g.u;d=c*this.g.j+f*this.g.v+h*this.g.l;c=c*this.g.m+f*this.g.s+h*this.g.B;f=k*this.g.A+g*this.g.o+l*this.g.u;h=k*this.g.j+g*this.g.v+l*this.g.l;k=k*this.g.m+g*this.g.s+l*this.g.B;this.g.A=a;this.g.j=m;this.g.m=b;this.g.o=e;this.g.v=d;this.g.s= -c;this.g.u=f;this.g.l=h;this.g.B=k;k=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;g=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;a=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;m=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;l=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;c=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;f=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;h=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;b=this.g.u*this.eb+this.g.l*this.hb+this.g.B* -this.kb;this.ba=k;this.ca=g;this.da=a;this.ea=m;this.fa=l;this.ga=c;this.ha=f;this.ia=h;this.ja=b;k=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;g=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;a=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;m=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;l=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;c=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;f=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;h=this.ha*this.g.o+this.ia*this.g.v+ -this.ja*this.g.s;b=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=k;this.ca=g;this.da=a;this.ea=m;this.fa=l;this.ga=c;this.ha=f;this.ia=h;this.ja=b;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;k=this.za;g=this.g;k.F=g.F;k.G=g.G;k.H=g.H;k.A=g.A;k.j=g.j;k.m=g.m;k.o=g.o;k.v=g.v;k.s=g.s;k.u=g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ua=f>k.D.ua?f:k.D.ua;k.D.va=h>k.D.va?h:k.D.va;null!=k.Eb&&(a=k.g.F-k.za.F,m=k.g.G-k.za.G,l=k.g.H-k.za.H,c=k.qc,c.x=a,c.y=m,c.z=l,k.hc.pc.nc.fd(k.Eb,k.D,k.qc));k=g}this.Ob=!1;this.Kb=0};J.prototype.ce=function(a){var b=a.x;var e=a.y;a=a.z;var d=Math.sin(b);var c=Math.sin(e),f=Math.sin(a),h=Math.cos(b);var k=Math.cos(e);var g=Math.cos(a);var l=k*g;var m=-k*f;a=h*f+g*d*c;b=h*g-d*c*f;var n=-k*d;e=d*f-h*g*c;d=g*d+h*c*f;k*=h;f=l*this.g.A+m*this.g.o+c*this.g.u;h=l*this.g.j+ -m*this.g.v+c*this.g.l;c=l*this.g.m+m*this.g.s+c*this.g.B;l=a*this.g.A+b*this.g.o+n*this.g.u;m=a*this.g.j+b*this.g.v+n*this.g.l;a=a*this.g.m+b*this.g.s+n*this.g.B;b=e*this.g.A+d*this.g.o+k*this.g.u;n=e*this.g.j+d*this.g.v+k*this.g.l;e=e*this.g.m+d*this.g.s+k*this.g.B;this.g.A=f;this.g.j=h;this.g.m=c;this.g.o=l;this.g.v=m;this.g.s=a;this.g.u=b;this.g.l=n;this.g.B=e;e=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;a=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;b=this.g.A*this.eb+this.g.j*this.hb+ -this.g.m*this.kb;n=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;c=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;f=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;h=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;k=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=e;this.ca=a;this.da=b;this.ea=n;this.fa=d;this.ga=c;this.ha=f;this.ia=h;this.ja=k;e=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;a=this.ba*this.g.o+this.ca* -this.g.v+this.da*this.g.s;b=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;n=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;c=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;f=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;h=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;k=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=e;this.ca=a;this.da=b;this.ea=n;this.fa=d;this.ga=c;this.ha=f;this.ia=h;this.ja=k;this.ba*=this.X.x; -this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;e=this.za;a=this.g;e.F=a.F;e.G=a.G;e.H=a.H;e.A=a.A;e.j=a.j;e.m=a.m;e.o=a.o;e.v=a.v;e.s=a.s;e.u=a.u;e.l=a.l;e.B=a.B;for(e=this.vc;null!=e;){a=e.U;n=this.za;b=this.g;d=e.za;c=e.ra;f=n.A*c.A+n.j*c.o+n.m*c.u;h=n.A*c.j+n.j*c.v+n.m*c.l;k=n.A*c.m+n.j*c.s+n.m*c.B;l=n.o*c.A+n.v*c.o+n.s*c.u;m=n.o*c.j+n.v*c.v+n.s*c.l;g=n.o*c.m+n.v*c.s+n.s*c.B;var q=n.u*c.A+n.l*c.o+n.B* -c.u;var p=n.u*c.j+n.l*c.v+n.B*c.l;var r=n.u*c.m+n.l*c.s+n.B*c.B;d.A=f;d.j=h;d.m=k;d.o=l;d.v=m;d.s=g;d.u=q;d.l=p;d.B=r;f=n.A*c.F+n.j*c.G+n.m*c.H;h=n.o*c.F+n.v*c.G+n.s*c.H;c=n.u*c.F+n.l*c.G+n.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=n.F;d.G+=n.G;d.H+=n.H;n=e.g;d=e.ra;c=b.A*d.A+b.j*d.o+b.m*d.u;f=b.A*d.j+b.j*d.v+b.m*d.l;h=b.A*d.m+b.j*d.s+b.m*d.B;k=b.o*d.A+b.v*d.o+b.s*d.u;l=b.o*d.j+b.v*d.v+b.s*d.l;m=b.o*d.m+b.v*d.s+b.s*d.B;g=b.u*d.A+b.l*d.o+b.B*d.u;q=b.u*d.j+b.l*d.v+b.B*d.l;p=b.u*d.m+b.l*d.s+b.B*d.B;n.A=c;n.j=f;n.m= -h;n.o=k;n.v=l;n.s=m;n.u=g;n.l=q;n.B=p;c=b.A*d.F+b.j*d.G+b.m*d.H;f=b.o*d.F+b.v*d.G+b.s*d.H;d=b.u*d.F+b.l*d.G+b.B*d.H;n.F=c;n.G=f;n.H=d;n.F+=b.F;n.G+=b.G;n.H+=b.H;e.Tb.Yb(e.D,e.za);b=e.D.wa;n=e.D.xa;d=e.D.ya;c=e.D.ta;f=e.D.ua;h=e.D.va;e.Tb.Yb(e.D,e.g);e.D.wa=be.D.ta?c:e.D.ta;e.D.ua=f>e.D.ua?f:e.D.ua;e.D.va=h>e.D.va?h:e.D.va;null!=e.Eb&&(b=e.g.F-e.za.F,n=e.g.G-e.za.G,d=e.g.H-e.za.H,c=e.qc,c.x=b,c.y=n,c.z=d,e.hc.pc.nc.fd(e.Eb, -e.D,e.qc));e=a}this.Ob=!1;this.Kb=0};J.prototype.Sb=function(){var a=new Gb;var b=this.g.A;var e=this.g.v;var d=this.g.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.g.j+this.g.o)*f,d=(this.g.m+this.g.u)*f,c=(this.g.l-this.g.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f):e>d?(f=Math.sqrt(e-d-b+ -1),e=.5*f,f=.5/f,b=(this.g.j+this.g.o)*f,d=(this.g.s+this.g.l)*f,c=(this.g.m-this.g.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f);a.x=b;a.y=e;a.z=d;a.w=c;return a};J.prototype.Wb=function(a){var b=this.g.A;var e=this.g.v;var d=this.g.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.g.j+this.g.o)* -f,d=(this.g.m+this.g.u)*f,c=(this.g.l-this.g.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.g.j+this.g.o)*f,d=(this.g.s+this.g.l)*f,c=(this.g.m-this.g.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f);a.x=b;a.y=e;a.z=d;a.w=c};J.prototype.je=function(a){var b=a.x;var e=a.y;var d=a.z;var c=a.w,f=2*b,h=2*e,k=2*d;a=b*f;var g= -e*h;d*=k;var l=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;this.g.A=1-g-d;this.g.j=l-c;this.g.m=b+h;this.g.o=l+c;this.g.v=1-a-d;this.g.s=e-f;this.g.u=b-h;this.g.l=e+f;this.g.B=1-a-g;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;g=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;c=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;k=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;l=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;h=this.g.u*this.bb+ -this.g.l*this.fb+this.g.B*this.ib;e=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;b=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=g;this.da=c;this.ea=k;this.fa=d;this.ga=l;this.ha=h;this.ia=e;this.ja=b;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;g=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;c=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;k=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;l=this.ea* -this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;e=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;b=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=g;this.da=c;this.ea=k;this.fa=d;this.ga=l;this.ha=h;this.ia=e;this.ja=b;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;a=this.za;g=this.g;a.F=g.F;a.G=g.G;a.H=g.H;a.A= -g.A;a.j=g.j;a.m=g.m;a.o=g.o;a.v=g.v;a.s=g.s;a.u=g.u;a.l=g.l;a.B=g.B;for(a=this.vc;null!=a;){g=a.U;k=this.za;c=this.g;d=a.za;l=a.ra;h=k.A*l.A+k.j*l.o+k.m*l.u;e=k.A*l.j+k.j*l.v+k.m*l.l;b=k.A*l.m+k.j*l.s+k.m*l.B;f=k.o*l.A+k.v*l.o+k.s*l.u;var m=k.o*l.j+k.v*l.v+k.s*l.l;var n=k.o*l.m+k.v*l.s+k.s*l.B;var q=k.u*l.A+k.l*l.o+k.B*l.u;var p=k.u*l.j+k.l*l.v+k.B*l.l;var r=k.u*l.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b.B=a.B; -return b};J.prototype.bc=function(a){var b=this.g;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};J.prototype.sf=function(a){this.g.F=a.F;this.g.G=a.G;this.g.H=a.H;this.g.A=a.A;this.g.j=a.j;this.g.m=a.m;this.g.o=a.o;this.g.v=a.v;this.g.s=a.s;this.g.u=a.u;this.g.l=a.l;this.g.B=a.B;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;var b=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;var e=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;var d= -this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;var c=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;var f=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;b=this.ba*this.g.o+this.ca* -this.g.v+this.da*this.g.s;e=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;d=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;c=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;f=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;this.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+e.s*c.H;c=e.u*c.F+e.l*c.G+e.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=e.F;d.G+=e.G;d.H+=e.H;a.Tb.Yb(a.D,a.za);e=a.D.wa;d=a.D.xa;c=a.D.ya;f=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=ea.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(e=a.g.F-a.za.F,d=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=e,f.y=d,f.z=c,a.hc.pc.nc.fd(a.Eb, -a.D,a.qc));a=b}this.Ob=!1;this.Kb=0};J.prototype.zh=function(){return this.Ce};J.prototype.We=function(){var a=new ia;a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12=this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa;return a};J.prototype.Xe=function(a){a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12=this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa};J.prototype.Ah=function(){var a=new Vk;a.mass=this.Ce;var b=a.localInertia;b.e00=this.h;b.e01=this.i;b.e02=this.C; -b.e10=this.I;b.e11=this.M;b.e12=this.V;b.e20=this.W;b.e21=this.Y;b.e22=this.aa;return a};J.prototype.Bh=function(a){a.mass=this.Ce;a=a.localInertia;a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12=this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa};J.prototype.ai=function(a){this.Ce=a.mass;a=a.localInertia;this.h=a.e00;this.i=a.e01;this.C=a.e02;this.I=a.e10;this.M=a.e11;this.V=a.e12;this.W=a.e20;this.Y=a.e21;this.aa=a.e22;if(0d||1E-32a.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d= -a.g.F-a.za.F,e=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=e,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}};J.prototype.Kh=function(a){if(null!=this.pc){var b=this.pc;b.nc.fg(a.Eb);a.Eb=null;a.uc=-1;for(var e=a.hc.Zb;null!=e;){var d=e.U,c=e.zd;if(c.ic==a||c.jc==a){e=e.Fc;e.Ob=!1;e.Kb=0;e=b.Xf;var f=c.sa,h=c.U;null!=f&&(f.U=h);null!=h&&(h.sa=f);c==e.md&&(e.md=e.md.U);c==e.Nd&&(e.Nd=e.Nd.sa);c.U=null;c.sa=null;c.xd&&(f=c.ic.ld,h=c.jc.ld,f==h&&(h=null),null!=f&&f.endContact(c),null!=h&&h.endContact(c)); -f=c.Bb.sa;h=c.Bb.U;null!=f&&(f.U=h);null!=h&&(h.sa=f);c.Bb==c.J.Zb&&(c.J.Zb=c.J.Zb.U);c.Bb==c.J.oc&&(c.J.oc=c.J.oc.sa);c.Bb.U=null;c.Bb.sa=null;f=c.Cb.sa;h=c.Cb.U;null!=f&&(f.U=h);null!=h&&(h.sa=f);c.Cb==c.K.Zb&&(c.K.Zb=c.K.Zb.U);c.Cb==c.K.oc&&(c.K.oc=c.K.oc.sa);c.Cb.U=null;c.Cb.sa=null;c.J.Pd--;c.K.Pd--;c.Bb.Fc=null;c.Cb.Fc=null;c.Bb.zd=null;c.Cb.zd=null;c.ic=null;c.jc=null;c.J=null;c.K=null;c.xd=!1;c.Eg.de();c.Ra.de();c.Yf=null;f=c.ee;f.ic=null;f.jc=null;f.J=null;f.K=null;f.Jg=null;f.Kg=null;c.U= -e.$e;e.$e=c;e.pg--}e=d}b.nf--}b=a.sa;d=a.U;null!=b&&(b.U=d);null!=d&&(d.sa=b);a==this.vc&&(this.vc=this.vc.U);a==this.Jb&&(this.Jb=this.Jb.sa);a.U=null;a.sa=null;this.nf--;a.hc=null;this.Wg();for(a=this.vc;null!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>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,c=a.g.G-a.za.G,e=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=c,f.z=e,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}};J.prototype.Sc=function(){return this.Xb}; -J.prototype.di=function(a){this.Xb=a;this.Wg()};J.prototype.fi=function(){this.Ob=!1;this.Kb=0};J.prototype.ei=function(){this.Ob=!0;this.Kb=0};J.prototype.Jh=function(){return this.Ob};J.prototype.Eh=function(){return this.Kb};J.prototype.tg=function(a){this.Oh=a;this.Ob=!1;this.Kb=0};J.prototype.be=function(){return this.gh};J.prototype.vh=function(a){this.gh=a};J.prototype.mg=function(){return this.Xg};J.prototype.Lh=function(a){this.Xg=a};J.prototype.tb=function(){return this.sa};J.prototype.Pb= -function(){return this.U};Ab.prototype.Ma=function(){return this.dh};Ab.prototype.Rb=function(a){this.dh=a};Ab.prototype.Ya=function(){return this.kh};Ab.prototype.Wb=function(a){this.kh=a};Ab.prototype.Sa=function(){var a=this.ra,b=new Ob;b.F=a.F;b.G=a.G;b.H=a.H;b.A=a.A;b.j=a.j;b.m=a.m;b.o=a.o;b.v=a.v;b.s=a.s;b.u=a.u;b.l=a.l;b.B=a.B;return b};Ab.prototype.Wa=function(a){var b=this.ra;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};Ab.prototype.C=function(){var a= -this.g,b=new Ob;b.F=a.F;b.G=a.G;b.H=a.H;b.A=a.A;b.j=a.j;b.m=a.m;b.o=a.o;b.v=a.v;b.s=a.s;b.u=a.u;b.l=a.l;b.B=a.B;return b};Ab.prototype.I=function(a){var b=this.g;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};Ab.prototype.Sb=function(a){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*f.l;r=c.u*f.m+c.l*f.s+c.B*f.B;d.A=h;d.j=k;d.m=g;d.o=l;d.v=m;d.s=n;d.u=q;d.l=p;d.B=r;h=c.A*f.F+c.j*f.G+c.m*f.H;k=c.o*f.F+c.v*f.G+c.s*f.H;f=c.u*f.F+c.l*f.G+c.B*f.H;d.F=h;d.G=k;d.H=f;d.F+=c.F;d.G+=c.G;d.H+=c.H;b.Tb.Yb(b.D,b.za);c=b.D.wa;d=b.D.xa;f=b.D.ya;h=b.D.ta;k=b.D.ua;g=b.D.va;b.Tb.Yb(b.D,b.g);b.D.wa=cb.D.ta?h:b.D.ta;b.D.ua=k>b.D.ua?k:b.D.ua;b.D.va=g>b.D.va?g:b.D.va;null!=b.Eb&& -(c=b.g.F-b.za.F,d=b.g.G-b.za.G,f=b.g.H-b.za.H,h=b.qc,h.x=c,h.y=d,h.z=f,b.hc.pc.nc.fd(b.Eb,b.D,b.qc));b=e}}};Ab.prototype.M=function(){return this.D.clone()};Ab.prototype.V=function(a){a.Dd(this.D)};Ab.prototype.Oa=function(){return this.Tb};Ab.prototype.nb=function(){return this.hc};Ab.prototype.W=function(){return this.$g};Ab.prototype.ob=function(a){this.$g=a};Ab.prototype.Y=function(){return this.ah};Ab.prototype.Ib=function(a){this.ah=a};Ab.prototype.aa=function(){return this.ld};Ab.prototype.Jb= -function(a){this.ld=a};Ab.prototype.i=function(){return this.sa};Ab.prototype.h=function(){return this.U};"undefined"!=typeof performance&&"function"==typeof performance.now&&(Jh.h=performance.now.bind(performance));Kk.BRUTE_FORCE=1;Kk.BVH=2;Bj.SPHERE=0;Bj.BOX=1;Bj.CYLINDER=2;Bj.CONE=3;Bj.CAPSULE=4;Bj.CONVEX_HULL=5;Hh.h=0;z.numCreations=0;ra.defaultFriction=.2;ra.defaultRestitution=.2;ra.defaultDensity=1;ra.defaultCollisionGroup=1;ra.defaultCollisionMask=1;ra.maxTranslationPerStep=20;ra.maxRotationPerStep= -3.14159265358979;ra.bvhProxyPadding=.1;ra.bvhIncrementalCollisionThreshold=.45;ra.defaultGJKMargin=.05;ra.enableGJKCaching=!0;ra.maxEPAVertices=128;ra.maxEPAPolyhedronFaces=128;ra.contactEnableBounceThreshold=.5;ra.velocityBaumgarte=.2;ra.positionSplitImpulseBaumgarte=.4;ra.positionNgsBaumgarte=1;ra.contactUseAlternativePositionCorrectionAlgorithmDepthThreshold=.05;ra.defaultContactPositionCorrectionAlgorithm=0;ra.alternativeContactPositionCorrectionAlgorithm=1;ra.contactPersistenceThreshold=.05; -ra.maxManifoldPoints=4;ra.defaultJointConstraintSolverType=0;ra.defaultJointPositionCorrectionAlgorithm=0;ra.jointWarmStartingFactorForBaungarte=.8;ra.jointWarmStartingFactor=.95;ra.minSpringDamperDampingRatio=1E-6;ra.minRagdollMaxSwingAngle=1E-6;ra.maxJacobianRows=6;ra.directMlcpSolverEps=1E-9;ra.islandInitialRigidBodyArraySize=128;ra.islandInitialConstraintArraySize=128;ra.sleepingVelocityThreshold=.2;ra.sleepingAngularVelocityThreshold=.5;ra.sleepingTimeThreshold=1;ra.disableSleeping=!1;ra.linearSlop= -.005;ra.angularSlop=.017453292519943278;yc.instance=new yc;Xg.SUCCEEDED=0;Xg.GJK_FAILED_TO_MAKE_TETRAHEDRON=1;Xg.GJK_DID_NOT_CONVERGE=2;Xg.EPA_FAILED_TO_INIT=257;Xg.EPA_FAILED_TO_ADD_VERTEX=258;Xg.EPA_DID_NOT_CONVERGE=259;ia.numCreations=0;Ha.numCreations=0;Sb.POSITIVE_INFINITY=Infinity;Sb.NEGATIVE_INFINITY=-Infinity;Sb.PI=3.14159265358979;Sb.TWO_PI=6.28318530717958;Sb.HALF_PI=1.570796326794895;Sb.TO_RADIANS=.017453292519943278;Sb.TO_DEGREES=57.29577951308238;Gb.numCreations=0;ii.broadPhaseCollisionTime= -0;ii.narrowPhaseCollisionTime=0;ii.dynamicsTime=0;ii.totalTime=0;Fh.BAUMGARTE=0;Fh.SPLIT_IMPULSE=1;Fh.NGS=2;Wg.SPHERICAL=0;Wg.REVOLUTE=1;Wg.CYLINDRICAL=2;Wg.PRISMATIC=3;Wg.UNIVERSAL=4;Wg.RAGDOLL=5;Wg.GENERIC=6;Ck.ITERATIVE=0;Ck.DIRECT=1;Eh.DYNAMIC=0;Eh.STATIC=1;Eh.KINEMATIC=2;il.h()})({}); +if(this.i.C[v].ei(this.info,this.W,this.M,this.V,this.C,Ba.positionNgsBaumgarte)){for(var B=0;Baa){var ia=aa*aa;Ta=.5*(1-.16666666666666666*ia+ia*ia*.008333333333333333);ca=1-.5*ia+ia*ia*.041666666666666664}else Ta=Math.sin(aa)/za,ca=Math.cos(aa);var T=void 0,ka=void 0,pa=void 0;T=oa*Ta;ka=N*Ta;pa=Ra*Ta;var Ca=void 0,V=void 0,fa=void 0,w=void 0;Ca= +T;V=ka;fa=pa;w=ca;var ta=void 0,Ga=void 0,da=void 0,W=void 0,sa=D.g.A,la=D.g.v,Oa=D.g.B,ab=sa+la+Oa,ja=void 0;0la?sa>Oa?(ja=Math.sqrt(sa-la-Oa+1),ta=.5*ja,ja=.5/ja,Ga=(D.g.j+D.g.o)*ja,da=(D.g.m+D.g.u)*ja,W=(D.g.l-D.g.s)*ja):(ja=Math.sqrt(Oa-sa-la+1),da=.5*ja,ja=.5/ja,ta=(D.g.m+D.g.u)*ja,Ga=(D.g.s+D.g.l)*ja,W=(D.g.o-D.g.j)*ja):la>Oa?(ja=Math.sqrt(la-Oa-sa+1),Ga=.5*ja,ja=.5/ja,ta=(D.g.j+D.g.o)*ja, +da=(D.g.s+D.g.l)*ja,W=(D.g.m-D.g.u)*ja):(ja=Math.sqrt(Oa-sa-la+1),da=.5*ja,ja=.5/ja,ta=(D.g.m+D.g.u)*ja,Ga=(D.g.s+D.g.l)*ja,W=(D.g.o-D.g.j)*ja);ta=w*ta+Ca*W+V*da-fa*Ga;Ga=w*Ga-Ca*da+V*W+fa*ta;da=w*da+Ca*Ga-V*ta+fa*W;W=w*W-Ca*ta-V*Ga-fa*da;var ob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ui*-B;c+=r.vi*-B;f+=r.wi*-B;d+=r.ni*-C;c+=r.oi*-C;f+=r.pi*-C;h+= +r.Ng*B;k+=r.Og*B;g+=r.Pg*B;h+=r.ph*C;k+=r.qh*C;g+=r.rh*C;l+=r.Qg*-B;m+=r.Rg*-B;n+=r.Sg*-B;l+=r.sh*-C;m+=r.th*-C;n+=r.uh*-C}q=0;for(p=this.info.La;qx.Hc&&(x.Hc=0),t=x.Hc-v,a+=r.gg*t,b+=r.hg*t,e+=r.ig*t,d+=r.jg*-t,c+=r.kg*-t,f+=r.lg*-t,h+=r.Pe*t,k+=r.Qe*t,g+=r.Re*t,l+=r.Se*-t,m+=r.Te*-t,n+=r.Ue*-t;this.J.ub=a;this.J.vb= +b;this.J.wb=e;this.K.ub=d;this.K.vb=c;this.K.wb=f;this.J.xb=h;this.J.yb=k;this.J.zb=g;this.K.xb=l;this.K.yb=m;this.K.zb=n};Nd.prototype.Bf=function(){this.i.Yh();this.i.Ec(this.info);var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba;var q=this.K.ca;var p=this.K.da;var r=this.K.ea;var t=this.K.fa;var x=this.K.ga;var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C= +0,O=this.info.La;Cx.Hb&&(x.Hb=0);t=x.Hb-v;a+=r.gg*t;b+=r.hg* +t;e+=r.ig*t;d+=r.jg*-t;c+=r.kg*-t;f+=r.lg*-t;h+=r.Pe*t;k+=r.Qe*t;g+=r.Re*t;l+=r.Se*-t;m+=r.Te*-t;n+=r.Ue*-t}this.J.Pc=a;this.J.Qc=b;this.J.Rc=e;this.K.Pc=d;this.K.Qc=c;this.K.Rc=f;this.J.Jc=h;this.J.Kc=k;this.J.Lc=g;this.K.Jc=l;this.K.Kc=m;this.K.Lc=n};Nd.prototype.Tf=function(){this.i.Yh();this.i.Ec(this.info);var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba; +var q=this.K.ca;var p=this.K.da;var r=this.K.ea;var t=this.K.fa;var x=this.K.ga;var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C=0,O=this.info.La;Cia.Hb&&(ia.Hb=0);pa=ia.Hb-Ca;Ra+=ca.gg* +pa;Wa+=ca.hg*pa;Ja+=ca.ig*pa;Sa+=ca.jg*-pa;Aa+=ca.kg*-pa;La+=ca.lg*-pa;Fa+=ca.Pe*pa;L+=ca.Qe*pa;Z+=ca.Re*pa;Y+=ca.Se*-pa;va+=ca.Te*-pa;Va+=ca.Ue*-pa}var V=this.J;V.g.F+=Ra;V.g.G+=Wa;V.g.H+=Ja;var fa=this.K;fa.g.F+=Sa;fa.g.G+=Aa;fa.g.H+=La;var w=this.J,ta=Math.sqrt(Fa*Fa+L*L+Z*Z),Ga=.5*ta;if(.5>Ga){var da=Ga*Ga;var W=.5*(1-.16666666666666666*da+da*da*.008333333333333333);var sa=1-.5*da+da*da*.041666666666666664}else W=Math.sin(Ga)/ta,sa=Math.cos(Ga);var la=Fa*W;var Oa=L*W;var ab=Z*W;var ja=sa;var ob= +w.g.A,Ha=w.g.v,I=w.g.B,Ka=ob+Ha+I;if(0Ha?ob>I?(P=Math.sqrt(ob-Ha-I+1),ba=.5*P,P=.5/P,ea=(w.g.j+w.g.o)*P,X=(w.g.m+w.g.u)*P,na=(w.g.l-w.g.s)*P):(P=Math.sqrt(I-ob-Ha+1),X=.5*P,P=.5/P,ba=(w.g.m+w.g.u)*P,ea=(w.g.s+w.g.l)*P,na=(w.g.o-w.g.j)*P):Ha>I?(P=Math.sqrt(Ha-I-ob+1),ea=.5*P,P=.5/P,ba=(w.g.j+w.g.o)*P,X=(w.g.s+w.g.l)*P,na=(w.g.m-w.g.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ype.Tf=function(){this.h.Gc();this.h.Ec(this.info);this.J=this.info.Yd;this.K=this.info.Zd;var a=this.J.Ab,b=this.K.Ab;var e=this.J.ba;var d=this.J.ca;var c=this.J.da;var f=this.J.ea;var h=this.J.fa;var k=this.J.ga;var g=this.J.ha;var l=this.J.ia;var m=this.J.ja;var n=this.K.ba;var q=this.K.ca;var p=this.K.da;var r=this.K.ea; +var t=this.K.fa;var x=this.K.ga;var v=this.K.ha;var B=this.K.ia;var H=this.K.ja;for(var C=0,O=this.info.La;CTa.Pa&&(ia.Hb=Ta.Pa);pa=ia.Hb-Ca;Ra+=ca.$c*pa;Wa+=ca.ad*pa;Ja+=ca.bd*pa;Sa+=ca.cd*-pa;Aa+=ca.dd*-pa;La+=ca.ed*-pa;Fa+=ca.Uc*pa;L+=ca.Vc*pa;Z+=ca.Wc*pa;Y+=ca.Xc*-pa;va+=ca.Yc*-pa;Va+=ca.Zc*-pa}var V=this.J;V.g.F+=Ra;V.g.G+=Wa;V.g.H+=Ja;var fa=this.K;fa.g.F+=Sa;fa.g.G+=Aa;fa.g.H+=La;var w=this.J,ta=Math.sqrt(Fa*Fa+L*L+Z*Z),Ga=.5*ta;if(.5>Ga){var da=Ga*Ga;var W=.5*(1-.16666666666666666*da+da*da*.008333333333333333);var sa=1-.5*da+da*da*.041666666666666664}else W=Math.sin(Ga)/ta,sa=Math.cos(Ga); +var la=Fa*W;var Oa=L*W;var ab=Z*W;var ja=sa;var ob=w.g.A,Ha=w.g.v,I=w.g.B,Ka=ob+Ha+I;if(0Ha?ob>I?(P=Math.sqrt(ob-Ha-I+1),ba=.5*P,P=.5/P,ea=(w.g.j+w.g.o)*P,X=(w.g.m+w.g.u)*P,na=(w.g.l-w.g.s)*P):(P=Math.sqrt(I-ob-Ha+1),X=.5*P,P=.5/P,ba=(w.g.m+w.g.u)*P,ea=(w.g.s+w.g.l)*P,na=(w.g.o-w.g.j)*P):Ha>I?(P=Math.sqrt(Ha-I-ob+1),ea=.5*P,P=.5/P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b+Na*Na;1E-32Ba.maxTranslationPerStep*Ba.maxTranslationPerStep&&(h=Ba.maxTranslationPerStep/Math.sqrt(h),this.ub*=h,this.vb*=h,this.wb*=h,b*=h,e*=h,d*=h);k>Ba.maxRotationPerStep*Ba.maxRotationPerStep&&(k=Ba.maxRotationPerStep/Math.sqrt(k),this.xb*=k,this.yb*=k,this.zb*=k,c*=k,f*=k,a*=k);this.g.F+=b;this.g.G+=e;this.g.H+=d;b=Math.sqrt(c*c+f*f+a*a);e=.5*b;.5>e?(e*=e,b=.5*(1-.16666666666666666*e+e*e*.008333333333333333), +e=1-.5*e+e*e*.041666666666666664):(b=Math.sin(e)/b,e=Math.cos(e));c*=b;f*=b;a*=b;b=e;e=this.g.A;d=this.g.v;k=this.g.B;h=e+d+k;if(0d?e>k?(g=Math.sqrt(e-d-k+1),h=.5*g,g=.5/g,k=(this.g.j+this.g.o)*g,d=(this.g.m+this.g.u)*g,e=(this.g.l-this.g.s)*g):(g=Math.sqrt(k-e-d+1),d=.5*g,g=.5/g,h=(this.g.m+this.g.u)*g,k=(this.g.s+this.g.l)*g,e=(this.g.o-this.g.j)*g):d>k?(g=Math.sqrt(d-k-e+1),k=.5* +g,g=.5/g,h=(this.g.j+this.g.o)*g,d=(this.g.s+this.g.l)*g,e=(this.g.m-this.g.u)*g):(g=Math.sqrt(k-e-d+1),d=.5*g,g=.5/g,h=(this.g.m+this.g.u)*g,k=(this.g.s+this.g.l)*g,e=(this.g.o-this.g.j)*g);h=b*h+c*e+f*d-a*k;k=b*k-c*d+f*e+a*h;d=b*d+c*k-f*h+a*e;e=b*e-c*h-f*k-a*d;a=h*h+k*k+d*d+e*e;1E-32b?(b*=b,a=.5*(1-.16666666666666666*b+b*b*.008333333333333333),b=1-.5*b+b*b*.041666666666666664):(a=Math.sin(b)/a,b=Math.cos(b));d*=a;c*=a;f*=a;a=b;b=this.g.A;e=this.g.v;var h=this.g.B;var k=b+e+h;if(0e?b>h?(g=Math.sqrt(b-e-h+1),k=.5*g,g=.5/g,h=(this.g.j+this.g.o)*g,e=(this.g.m+this.g.u)*g,b=(this.g.l-this.g.s)*g):(g=Math.sqrt(h-b-e+1),e=.5*g,g=.5/g,k=(this.g.m+this.g.u)*g,h=(this.g.s+this.g.l)*g,b=(this.g.o-this.g.j)*g):e>h?(g=Math.sqrt(e-h-b+1),h=.5*g,g=.5/g,k=(this.g.j+this.g.o)*g,e=(this.g.s+this.g.l)*g,b=(this.g.m-this.g.u)*g):(g=Math.sqrt(h-b-e+1),e=.5*g,g=.5/g,k=(this.g.m+this.g.u)*g,h=(this.g.s+this.g.l)*g,b=(this.g.o-this.g.j)*g);k=a*k+d*b+c* +e-f*h;h=a*h-d*e+c*b+f*k;e=a*e+d*h-c*k+f*b;b=a*b-d*k-c*h-f*e;c=k*k+h*h+e*e+b*b;1E-32d||1E-32a.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,e=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=e,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}this.Ob=!1;this.Kb=0};J.prototype.tf=function(a){var b=a.x;var e=a.y;a=a.z;this.g.F+=b;this.g.G+=e;this.g.H+=a;b=this.za;e=this.g; +b.F=e.F;b.G=e.G;b.H=e.H;b.A=e.A;b.j=e.j;b.m=e.m;b.o=e.o;b.v=e.v;b.s=e.s;b.u=e.u;b.l=e.l;b.B=e.B;for(b=this.vc;null!=b;){e=b.U;var d=this.za;a=this.g;var c=b.za,f=b.ra;var h=d.A*f.A+d.j*f.o+d.m*f.u;var k=d.A*f.j+d.j*f.v+d.m*f.l;var g=d.A*f.m+d.j*f.s+d.m*f.B;var l=d.o*f.A+d.v*f.o+d.s*f.u;var m=d.o*f.j+d.v*f.v+d.s*f.l;var n=d.o*f.m+d.v*f.s+d.s*f.B;var q=d.u*f.A+d.l*f.o+d.B*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v;a.e12=this.g.s;a.e20=this.g.u;a.e21=this.g.l;a.e22=this.g.B;return a};J.prototype.Gb=function(a){a.e00=this.g.A;a.e01=this.g.j;a.e02=this.g.m;a.e10=this.g.o;a.e11=this.g.v;a.e12=this.g.s;a.e20=this.g.u;a.e21=this.g.l;a.e22=this.g.B};J.prototype.Ie=function(a){this.g.A=a.e00;this.g.j=a.e01;this.g.m=a.e02;this.g.o=a.e10;this.g.v=a.e11;this.g.s=a.e12;this.g.u=a.e20;this.g.l=a.e21;this.g.B=a.e22;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;var b=this.g.A*this.cb+this.g.j* +this.gb+this.g.m*this.jb;var e=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;var d=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;var c=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;var f=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia= +k;this.ja=g;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;b=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;e=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;d=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;c=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;f=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca= +b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this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e.o*c.F+e.v*c.G+e.s*c.H;c=e.u*c.F+e.l*c.G+e.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=e.F;d.G+=e.G;d.H+=e.H;a.Tb.Yb(a.D,a.za);e=a.D.wa;d=a.D.xa;c=a.D.ya;f=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=ea.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va; +null!=a.Eb&&(e=a.g.F-a.za.F,d=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=e,f.y=d,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}this.Ob=!1;this.Kb=0};J.prototype.rf=function(a){var b=a.x;var e=a.y;var d=a.z;a=Math.sin(b);var c=Math.sin(e),f=Math.sin(d);b=Math.cos(b);e=Math.cos(e);d=Math.cos(d);this.g.A=e*d;this.g.j=-e*f;this.g.m=c;this.g.o=b*f+d*a*c;this.g.v=b*d-a*c*f;this.g.s=-e*a;this.g.u=a*f-b*d*c;this.g.l=d*a+b*c*f;this.g.B=b*e;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;c=this.g.A*this.cb+this.g.j* +this.gb+this.g.m*this.jb;f=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;e=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;b=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=c;this.da=f;this.ea=e;this.fa=d;this.ga=b;this.ha=h;this.ia=k;this.ja=g;a=this.ba* +this.g.A+this.ca*this.g.j+this.da*this.g.m;c=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;f=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;e=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;b=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=c;this.da=f;this.ea= +e;this.fa=d;this.ga=b;this.ha=h;this.ia=k;this.ja=g;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;a=this.za;c=this.g;a.F=c.F;a.G=c.G;a.H=c.H;a.A=c.A;a.j=c.j;a.m=c.m;a.o=c.o;a.v=c.v;a.s=c.s;a.u=c.u;a.l=c.l;a.B=c.B;for(a=this.vc;null!=a;){c=a.U;e=this.za;f=this.g;d=a.za;b=a.ra;h=e.A*b.A+e.j*b.o+e.m*b.u;k=e.A*b.j+e.j*b.v+e.m*b.l;g=e.A*b.m+e.j*b.s+e.m*b.B;var l=e.o*b.A+e.v*b.o+e.s*b.u;var m= +e.o*b.j+e.v*b.v+e.s*b.l;var n=e.o*b.m+e.v*b.s+e.s*b.B;var q=e.u*b.A+e.l*b.o+e.B*b.u;var p=e.u*b.j+e.l*b.v+e.B*b.l;var r=e.u*b.m+e.l*b.s+e.B*b.B;d.A=h;d.j=k;d.m=g;d.o=l;d.v=m;d.s=n;d.u=q;d.l=p;d.B=r;h=e.A*b.F+e.j*b.G+e.m*b.H;k=e.o*b.F+e.v*b.G+e.s*b.H;b=e.u*b.F+e.l*b.G+e.B*b.H;d.F=h;d.G=k;d.H=b;d.F+=e.F;d.G+=e.G;d.H+=e.H;e=a.g;d=a.ra;b=f.A*d.A+f.j*d.o+f.m*d.u;h=f.A*d.j+f.j*d.v+f.m*d.l;k=f.A*d.m+f.j*d.s+f.m*d.B;g=f.o*d.A+f.v*d.o+f.s*d.u;l=f.o*d.j+f.v*d.v+f.s*d.l;m=f.o*d.m+f.v*d.s+f.s*d.B;n=f.u*d.A+f.l* +d.o+f.B*d.u;q=f.u*d.j+f.l*d.v+f.B*d.l;p=f.u*d.m+f.l*d.s+f.B*d.B;e.A=b;e.j=h;e.m=k;e.o=g;e.v=l;e.s=m;e.u=n;e.l=q;e.B=p;b=f.A*d.F+f.j*d.G+f.m*d.H;h=f.o*d.F+f.v*d.G+f.s*d.H;d=f.u*d.F+f.l*d.G+f.B*d.H;e.F=b;e.G=h;e.H=d;e.F+=f.F;e.G+=f.G;e.H+=f.H;a.Tb.Yb(a.D,a.za);f=a.D.wa;e=a.D.xa;d=a.D.ya;b=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=fa.D.ta?b:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(f=a.g.F- +a.za.F,e=a.g.G-a.za.G,d=a.g.H-a.za.H,b=a.qc,b.x=f,b.y=e,b.z=d,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=c}this.Ob=!1;this.Kb=0};J.prototype.Ed=function(a){var b=a.e00;var e=a.e01;var d=a.e02;var c=a.e10;var f=a.e11;var h=a.e12;var k=a.e20;var g=a.e21;var l=a.e22;a=b*this.g.A+e*this.g.o+d*this.g.u;var m=b*this.g.j+e*this.g.v+d*this.g.l;b=b*this.g.m+e*this.g.s+d*this.g.B;e=c*this.g.A+f*this.g.o+h*this.g.u;d=c*this.g.j+f*this.g.v+h*this.g.l;c=c*this.g.m+f*this.g.s+h*this.g.B;f=k*this.g.A+g*this.g.o+l*this.g.u; +h=k*this.g.j+g*this.g.v+l*this.g.l;k=k*this.g.m+g*this.g.s+l*this.g.B;this.g.A=a;this.g.j=m;this.g.m=b;this.g.o=e;this.g.v=d;this.g.s=c;this.g.u=f;this.g.l=h;this.g.B=k;k=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;g=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;a=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;m=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;l=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;c=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;f=this.g.u*this.bb+ +this.g.l*this.fb+this.g.B*this.ib;h=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;b=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=k;this.ca=g;this.da=a;this.ea=m;this.fa=l;this.ga=c;this.ha=f;this.ia=h;this.ja=b;k=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;g=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;a=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;m=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;l=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;c=this.ea* +this.g.u+this.fa*this.g.l+this.ga*this.g.B;f=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;h=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;b=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=k;this.ca=g;this.da=a;this.ea=m;this.fa=l;this.ga=c;this.ha=f;this.ia=h;this.ja=b;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;k=this.za;g=this.g;k.F=g.F;k.G=g.G;k.H=g.H;k.A= +g.A;k.j=g.j;k.m=g.m;k.o=g.o;k.v=g.v;k.s=g.s;k.u=g.u;k.l=g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ua?f:k.D.ua;k.D.va=h>k.D.va?h:k.D.va;null!=k.Eb&&(a=k.g.F-k.za.F,m=k.g.G-k.za.G,l=k.g.H-k.za.H,c=k.qc,c.x=a,c.y=m,c.z=l,k.hc.pc.nc.fd(k.Eb,k.D,k.qc));k=g}this.Ob=!1;this.Kb=0};J.prototype.ce=function(a){var b=a.x;var e=a.y;a=a.z;var d=Math.sin(b);var c=Math.sin(e),f=Math.sin(a),h=Math.cos(b);var k=Math.cos(e);var g=Math.cos(a); +var l=k*g;var m=-k*f;a=h*f+g*d*c;b=h*g-d*c*f;var n=-k*d;e=d*f-h*g*c;d=g*d+h*c*f;k*=h;f=l*this.g.A+m*this.g.o+c*this.g.u;h=l*this.g.j+m*this.g.v+c*this.g.l;c=l*this.g.m+m*this.g.s+c*this.g.B;l=a*this.g.A+b*this.g.o+n*this.g.u;m=a*this.g.j+b*this.g.v+n*this.g.l;a=a*this.g.m+b*this.g.s+n*this.g.B;b=e*this.g.A+d*this.g.o+k*this.g.u;n=e*this.g.j+d*this.g.v+k*this.g.l;e=e*this.g.m+d*this.g.s+k*this.g.B;this.g.A=f;this.g.j=h;this.g.m=c;this.g.o=l;this.g.v=m;this.g.s=a;this.g.u=b;this.g.l=n;this.g.B=e;e= +this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;a=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;b=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;n=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;c=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;f=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;h=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;k=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=e;this.ca=a;this.da= +b;this.ea=n;this.fa=d;this.ga=c;this.ha=f;this.ia=h;this.ja=k;e=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;a=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;b=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;n=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;c=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;f=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;h=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;k=this.ha*this.g.u+ +this.ia*this.g.l+this.ja*this.g.B;this.ba=e;this.ca=a;this.da=b;this.ea=n;this.fa=d;this.ga=c;this.ha=f;this.ia=h;this.ja=k;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*=this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;e=this.za;a=this.g;e.F=a.F;e.G=a.G;e.H=a.H;e.A=a.A;e.j=a.j;e.m=a.m;e.o=a.o;e.v=a.v;e.s=a.s;e.u=a.u;e.l=a.l;e.B=a.B;for(e=this.vc;null!=e;){a=e.U;n=this.za;b=this.g;d=e.za;c=e.ra;f=n.A*c.A+n.j*c.o+n.m*c.u;h=n.A*c.j+n.j* +c.v+n.m*c.l;k=n.A*c.m+n.j*c.s+n.m*c.B;l=n.o*c.A+n.v*c.o+n.s*c.u;m=n.o*c.j+n.v*c.v+n.s*c.l;g=n.o*c.m+n.v*c.s+n.s*c.B;var q=n.u*c.A+n.l*c.o+n.B*c.u;var p=n.u*c.j+n.l*c.v+n.B*c.l;var r=n.u*c.m+n.l*c.s+n.B*c.B;d.A=f;d.j=h;d.m=k;d.o=l;d.v=m;d.s=g;d.u=q;d.l=p;d.B=r;f=n.A*c.F+n.j*c.G+n.m*c.H;h=n.o*c.F+n.v*c.G+n.s*c.H;c=n.u*c.F+n.l*c.G+n.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=n.F;d.G+=n.G;d.H+=n.H;n=e.g;d=e.ra;c=b.A*d.A+b.j*d.o+b.m*d.u;f=b.A*d.j+b.j*d.v+b.m*d.l;h=b.A*d.m+b.j*d.s+b.m*d.B;k=b.o*d.A+b.v*d.o+b.s*d.u;l= +b.o*d.j+b.v*d.v+b.s*d.l;m=b.o*d.m+b.v*d.s+b.s*d.B;g=b.u*d.A+b.l*d.o+b.B*d.u;q=b.u*d.j+b.l*d.v+b.B*d.l;p=b.u*d.m+b.l*d.s+b.B*d.B;n.A=c;n.j=f;n.m=h;n.o=k;n.v=l;n.s=m;n.u=g;n.l=q;n.B=p;c=b.A*d.F+b.j*d.G+b.m*d.H;f=b.o*d.F+b.v*d.G+b.s*d.H;d=b.u*d.F+b.l*d.G+b.B*d.H;n.F=c;n.G=f;n.H=d;n.F+=b.F;n.G+=b.G;n.H+=b.H;e.Tb.Yb(e.D,e.za);b=e.D.wa;n=e.D.xa;d=e.D.ya;c=e.D.ta;f=e.D.ua;h=e.D.va;e.Tb.Yb(e.D,e.g);e.D.wa=be.D.ta?c:e.D.ta;e.D.ua= +f>e.D.ua?f:e.D.ua;e.D.va=h>e.D.va?h:e.D.va;null!=e.Eb&&(b=e.g.F-e.za.F,n=e.g.G-e.za.G,d=e.g.H-e.za.H,c=e.qc,c.x=b,c.y=n,c.z=d,e.hc.pc.nc.fd(e.Eb,e.D,e.qc));e=a}this.Ob=!1;this.Kb=0};J.prototype.Sb=function(){var a=new Hb;var b=this.g.A;var e=this.g.v;var d=this.g.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.g.j+this.g.o)*f,d=(this.g.m+this.g.u)*f,c=(this.g.l- +this.g.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.g.j+this.g.o)*f,d=(this.g.s+this.g.l)*f,c=(this.g.m-this.g.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f);a.x=b;a.y=e;a.z=d;a.w=c;return a};J.prototype.Wb=function(a){var b=this.g.A;var e=this.g.v;var d=this.g.B;var c=b+e+d;if(0e?b>d?(f=Math.sqrt(b-e-d+1),b=.5*f,f=.5/f,e=(this.g.j+this.g.o)*f,d=(this.g.m+this.g.u)*f,c=(this.g.l-this.g.s)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f,c=(this.g.o-this.g.j)*f):e>d?(f=Math.sqrt(e-d-b+1),e=.5*f,f=.5/f,b=(this.g.j+this.g.o)*f,d=(this.g.s+this.g.l)*f,c=(this.g.m-this.g.u)*f):(f=Math.sqrt(d-b-e+1),d=.5*f,f=.5/f,b=(this.g.m+this.g.u)*f,e=(this.g.s+this.g.l)*f, +c=(this.g.o-this.g.j)*f);a.x=b;a.y=e;a.z=d;a.w=c};J.prototype.je=function(a){var b=a.x;var e=a.y;var d=a.z;var c=a.w,f=2*b,h=2*e,k=2*d;a=b*f;var g=e*h;d*=k;var l=b*h;e*=k;b*=k;f*=c;h*=c;c*=k;this.g.A=1-g-d;this.g.j=l-c;this.g.m=b+h;this.g.o=l+c;this.g.v=1-a-d;this.g.s=e-f;this.g.u=b-h;this.g.l=e+f;this.g.B=1-a-g;a=this.g.A*this.bb+this.g.j*this.fb+this.g.m*this.ib;g=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;c=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;k=this.g.o*this.bb+this.g.v* +this.fb+this.g.s*this.ib;d=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;l=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;e=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;b=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=g;this.da=c;this.ea=k;this.fa=d;this.ga=l;this.ha=h;this.ia=e;this.ja=b;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;g=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;c=this.ba*this.g.u+ +this.ca*this.g.l+this.da*this.g.B;k=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;d=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;l=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;e=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;b=this.ha*this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=g;this.da=c;this.ea=k;this.fa=d;this.ga=l;this.ha=h;this.ia=e;this.ja=b;this.ba*=this.X.x;this.ca*=this.X.x;this.da*=this.X.x;this.ea*= +this.X.y;this.fa*=this.X.y;this.ga*=this.X.y;this.ha*=this.X.z;this.ia*=this.X.z;this.ja*=this.X.z;a=this.za;g=this.g;a.F=g.F;a.G=g.G;a.H=g.H;a.A=g.A;a.j=g.j;a.m=g.m;a.o=g.o;a.v=g.v;a.s=g.s;a.u=g.u;a.l=g.l;a.B=g.B;for(a=this.vc;null!=a;){g=a.U;k=this.za;c=this.g;d=a.za;l=a.ra;h=k.A*l.A+k.j*l.o+k.m*l.u;e=k.A*l.j+k.j*l.v+k.m*l.l;b=k.A*l.m+k.j*l.s+k.m*l.B;f=k.o*l.A+k.v*l.o+k.s*l.u;var m=k.o*l.j+k.v*l.v+k.s*l.l;var n=k.o*l.m+k.v*l.s+k.s*l.B;var q=k.u*l.A+k.l*l.o+k.B*l.u;var p=k.u*l.j+k.l*l.v+k.B*l.l; +var r=k.u*l.m+k.l*l.s+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J.prototype.bc=function(a){var b=this.g;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};J.prototype.sf=function(a){this.g.F=a.F;this.g.G=a.G;this.g.H=a.H;this.g.A=a.A;this.g.j=a.j;this.g.m=a.m;this.g.o=a.o;this.g.v=a.v;this.g.s=a.s;this.g.u=a.u;this.g.l=a.l;this.g.B=a.B;a=this.g.A*this.bb+this.g.j* +this.fb+this.g.m*this.ib;var b=this.g.A*this.cb+this.g.j*this.gb+this.g.m*this.jb;var e=this.g.A*this.eb+this.g.j*this.hb+this.g.m*this.kb;var d=this.g.o*this.bb+this.g.v*this.fb+this.g.s*this.ib;var c=this.g.o*this.cb+this.g.v*this.gb+this.g.s*this.jb;var f=this.g.o*this.eb+this.g.v*this.hb+this.g.s*this.kb;var h=this.g.u*this.bb+this.g.l*this.fb+this.g.B*this.ib;var k=this.g.u*this.cb+this.g.l*this.gb+this.g.B*this.jb;var g=this.g.u*this.eb+this.g.l*this.hb+this.g.B*this.kb;this.ba=a;this.ca=b; +this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;a=this.ba*this.g.A+this.ca*this.g.j+this.da*this.g.m;b=this.ba*this.g.o+this.ca*this.g.v+this.da*this.g.s;e=this.ba*this.g.u+this.ca*this.g.l+this.da*this.g.B;d=this.ea*this.g.A+this.fa*this.g.j+this.ga*this.g.m;c=this.ea*this.g.o+this.fa*this.g.v+this.ga*this.g.s;f=this.ea*this.g.u+this.fa*this.g.l+this.ga*this.g.B;h=this.ha*this.g.A+this.ia*this.g.j+this.ja*this.g.m;k=this.ha*this.g.o+this.ia*this.g.v+this.ja*this.g.s;g=this.ha* +this.g.u+this.ia*this.g.l+this.ja*this.g.B;this.ba=a;this.ca=b;this.da=e;this.ea=d;this.fa=c;this.ga=f;this.ha=h;this.ia=k;this.ja=g;this.ba*=this.X.x;this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u*c.F+e.l*c.G+e.B*c.H;d.F=f;d.G=h;d.H=c;d.F+=e.F;d.G+=e.G;d.H+=e.H;a.Tb.Yb(a.D,a.za);e=a.D.wa;d=a.D.xa;c=a.D.ya;f=a.D.ta;h=a.D.ua;k=a.D.va;a.Tb.Yb(a.D,a.g);a.D.wa=ea.D.ta? +f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(e=a.g.F-a.za.F,d=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=e,f.y=d,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}this.Ob=!1;this.Kb=0};J.prototype.Bh=function(){return this.Ce};J.prototype.We=function(){var a=new ha;a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12=this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa;return a};J.prototype.Xe=function(a){a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12= +this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa};J.prototype.Ch=function(){var a=new Vk;a.mass=this.Ce;var b=a.localInertia;b.e00=this.h;b.e01=this.i;b.e02=this.C;b.e10=this.I;b.e11=this.M;b.e12=this.V;b.e20=this.W;b.e21=this.Y;b.e22=this.aa;return a};J.prototype.Dh=function(a){a.mass=this.Ce;a=a.localInertia;a.e00=this.h;a.e01=this.i;a.e02=this.C;a.e10=this.I;a.e11=this.M;a.e12=this.V;a.e20=this.W;a.e21=this.Y;a.e22=this.aa};J.prototype.ci=function(a){this.Ce=a.mass;a=a.localInertia;this.h=a.e00; +this.i=a.e01;this.C=a.e02;this.I=a.e10;this.M=a.e11;this.V=a.e12;this.W=a.e20;this.Y=a.e21;this.aa=a.e22;if(0d||1E-32a.D.ta?f:a.D.ta;a.D.ua=h>a.D.ua?h:a.D.ua;a.D.va=k>a.D.va?k:a.D.va;null!=a.Eb&&(d=a.g.F-a.za.F,e=a.g.G-a.za.G,c=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=e,f.z=c,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}};J.prototype.Mh=function(a){if(null!=this.pc){var b=this.pc;b.nc.fg(a.Eb);a.Eb=null;a.uc=-1;for(var e=a.hc.Zb;null!=e;){var d=e.U,c=e.zd;if(c.ic==a||c.jc==a){e=e.Fc;e.Ob=!1;e.Kb=0;e=b.Xf;var f=c.sa,h=c.U;null!=f&&(f.U=h);null!=h&&(h.sa= +f);c==e.md&&(e.md=e.md.U);c==e.Nd&&(e.Nd=e.Nd.sa);c.U=null;c.sa=null;c.xd&&(f=c.ic.ld,h=c.jc.ld,f==h&&(h=null),null!=f&&f.endContact(c),null!=h&&h.endContact(c));f=c.Bb.sa;h=c.Bb.U;null!=f&&(f.U=h);null!=h&&(h.sa=f);c.Bb==c.J.Zb&&(c.J.Zb=c.J.Zb.U);c.Bb==c.J.oc&&(c.J.oc=c.J.oc.sa);c.Bb.U=null;c.Bb.sa=null;f=c.Cb.sa;h=c.Cb.U;null!=f&&(f.U=h);null!=h&&(h.sa=f);c.Cb==c.K.Zb&&(c.K.Zb=c.K.Zb.U);c.Cb==c.K.oc&&(c.K.oc=c.K.oc.sa);c.Cb.U=null;c.Cb.sa=null;c.J.Pd--;c.K.Pd--;c.Bb.Fc=null;c.Cb.Fc=null;c.Bb.zd= +null;c.Cb.zd=null;c.ic=null;c.jc=null;c.J=null;c.K=null;c.xd=!1;c.Eg.de();c.Ra.de();c.Yf=null;f=c.ee;f.ic=null;f.jc=null;f.J=null;f.K=null;f.Jg=null;f.Kg=null;c.U=e.$e;e.$e=c;e.pg--}e=d}b.nf--}b=a.sa;d=a.U;null!=b&&(b.U=d);null!=d&&(d.sa=b);a==this.vc&&(this.vc=this.vc.U);a==this.Jb&&(this.Jb=this.Jb.sa);a.U=null;a.sa=null;this.nf--;a.hc=null;this.Wg();for(a=this.vc;null!=a;){b=a.U;c=this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.va;null!=a.Eb&&(d=a.g.F-a.za.F,c=a.g.G-a.za.G,e=a.g.H-a.za.H,f=a.qc,f.x=d,f.y=c,f.z=e,a.hc.pc.nc.fd(a.Eb,a.D,a.qc));a=b}};J.prototype.Sc=function(){return this.Xb};J.prototype.fi=function(a){this.Xb=a;this.Wg()};J.prototype.hi=function(){this.Ob=!1;this.Kb=0};J.prototype.gi=function(){this.Ob=!0;this.Kb=0};J.prototype.Lh=function(){return this.Ob};J.prototype.Gh=function(){return this.Kb};J.prototype.tg=function(a){this.Qh=a;this.Ob=!1;this.Kb=0};J.prototype.be=function(){return this.gh}; +J.prototype.xh=function(a){this.gh=a};J.prototype.mg=function(){return this.Xg};J.prototype.Nh=function(a){this.Xg=a};J.prototype.tb=function(){return this.sa};J.prototype.Pb=function(){return this.U};zb.prototype.Ma=function(){return this.dh};zb.prototype.Rb=function(a){this.dh=a};zb.prototype.Ya=function(){return this.kh};zb.prototype.Wb=function(a){this.kh=a};zb.prototype.Sa=function(){var a=this.ra,b=new Ob;b.F=a.F;b.G=a.G;b.H=a.H;b.A=a.A;b.j=a.j;b.m=a.m;b.o=a.o;b.v=a.v;b.s=a.s;b.u=a.u;b.l=a.l; +b.B=a.B;return b};zb.prototype.Wa=function(a){var b=this.ra;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};zb.prototype.C=function(){var a=this.g,b=new Ob;b.F=a.F;b.G=a.G;b.H=a.H;b.A=a.A;b.j=a.j;b.m=a.m;b.o=a.o;b.v=a.v;b.s=a.s;b.u=a.u;b.l=a.l;b.B=a.B;return b};zb.prototype.I=function(a){var b=this.g;a.F=b.F;a.G=b.G;a.H=b.H;a.A=b.A;a.j=b.j;a.m=b.m;a.o=b.o;a.v=b.v;a.s=b.s;a.u=b.u;a.l=b.l;a.B=b.B};zb.prototype.Sb=function(a){var b=this.ra;b.F=a.F;b.G= +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.wa;d=b.D.xa;f=b.D.ya;h=b.D.ta;k=b.D.ua;g=b.D.va;b.Tb.Yb(b.D,b.g);b.D.wa=cb.D.ta?h:b.D.ta;b.D.ua=k>b.D.ua?k:b.D.ua;b.D.va=g>b.D.va?g:b.D.va;null!=b.Eb&&(c=b.g.F-b.za.F,d=b.g.G-b.za.G,f=b.g.H-b.za.H,h=b.qc,h.x=c,h.y=d,h.z=f,b.hc.pc.nc.fd(b.Eb,b.D,b.qc));b=e}};zb.prototype.qa=function(){return this.Sh};zb.prototype.Pb=function(a){this.Sh=a;if(null!=this.hc){a=this.hc; +a.Wg();for(var b=a.vc;null!=b;){var e=b.U,d=a.za,c=a.g,f=b.za,h=b.ra;var k=d.A*h.A+d.j*h.o+d.m*h.u;var g=d.A*h.j+d.j*h.v+d.m*h.l;var l=d.A*h.m+d.j*h.s+d.m*h.B;var m=d.o*h.A+d.v*h.o+d.s*h.u;var n=d.o*h.j+d.v*h.v+d.s*h.l;var q=d.o*h.m+d.v*h.s+d.s*h.B;var p=d.u*h.A+d.l*h.o+d.B*h.u;var r=d.u*h.j+d.l*h.v+d.B*h.l;var t=d.u*h.m+d.l*h.s+d.B*h.B;f.A=k;f.j=g;f.m=l;f.o=m;f.v=n;f.s=q;f.u=p;f.l=r;f.B=t;k=d.A*h.F+d.j*h.G+d.m*h.H;g=d.o*h.F+d.v*h.G+d.s*h.H;h=d.u*h.F+d.l*h.G+d.B*h.H;f.F=k;f.G=g;f.H=h;f.F+=d.F;f.G+= +d.G;f.H+=d.H;d=b.g;f=b.ra;h=c.A*f.A+c.j*f.o+c.m*f.u;k=c.A*f.j+c.j*f.v+c.m*f.l;g=c.A*f.m+c.j*f.s+c.m*f.B;l=c.o*f.A+c.v*f.o+c.s*f.u;m=c.o*f.j+c.v*f.v+c.s*f.l;n=c.o*f.m+c.v*f.s+c.s*f.B;q=c.u*f.A+c.l*f.o+c.B*f.u;p=c.u*f.j+c.l*f.v+c.B*f.l;r=c.u*f.m+c.l*f.s+c.B*f.B;d.A=h;d.j=k;d.m=g;d.o=l;d.v=m;d.s=n;d.u=q;d.l=p;d.B=r;h=c.A*f.F+c.j*f.G+c.m*f.H;k=c.o*f.F+c.v*f.G+c.s*f.H;f=c.u*f.F+c.l*f.G+c.B*f.H;d.F=h;d.G=k;d.H=f;d.F+=c.F;d.G+=c.G;d.H+=c.H;b.Tb.Yb(b.D,b.za);c=b.D.wa;d=b.D.xa;f=b.D.ya;h=b.D.ta;k=b.D.ua;g= +b.D.va;b.Tb.Yb(b.D,b.g);b.D.wa=cb.D.ta?h:b.D.ta;b.D.ua=k>b.D.ua?k:b.D.ua;b.D.va=g>b.D.va?g:b.D.va;null!=b.Eb&&(c=b.g.F-b.za.F,d=b.g.G-b.za.G,f=b.g.H-b.za.H,h=b.qc,h.x=c,h.y=d,h.z=f,b.hc.pc.nc.fd(b.Eb,b.D,b.qc));b=e}}};zb.prototype.M=function(){return this.D.clone()};zb.prototype.V=function(a){a.Dd(this.D)};zb.prototype.Oa=function(){return this.Tb};zb.prototype.nb=function(){return this.hc};zb.prototype.W=function(){return this.$g}; +zb.prototype.ob=function(a){this.$g=a};zb.prototype.Y=function(){return this.ah};zb.prototype.Ib=function(a){this.ah=a};zb.prototype.aa=function(){return this.ld};zb.prototype.Jb=function(a){this.ld=a};zb.prototype.i=function(){return this.sa};zb.prototype.h=function(){return this.U};"undefined"!=typeof performance&&"function"==typeof performance.now&&(Nh.h=performance.now.bind(performance));Kk.BRUTE_FORCE=1;Kk.BVH=2;Bj.SPHERE=0;Bj.BOX=1;Bj.CYLINDER=2;Bj.CONE=3;Bj.CAPSULE=4;Bj.CONVEX_HULL=5;Lh.h= +0;z.numCreations=0;Ba.defaultFriction=.2;Ba.defaultRestitution=.2;Ba.defaultDensity=1;Ba.defaultCollisionGroup=1;Ba.defaultCollisionMask=1;Ba.maxTranslationPerStep=20;Ba.maxRotationPerStep=3.14159265358979;Ba.bvhProxyPadding=.1;Ba.bvhIncrementalCollisionThreshold=.45;Ba.defaultGJKMargin=.05;Ba.enableGJKCaching=!0;Ba.maxEPAVertices=128;Ba.maxEPAPolyhedronFaces=128;Ba.contactEnableBounceThreshold=.5;Ba.velocityBaumgarte=.2;Ba.positionSplitImpulseBaumgarte=.4;Ba.positionNgsBaumgarte=1;Ba.contactUseAlternativePositionCorrectionAlgorithmDepthThreshold= +.05;Ba.defaultContactPositionCorrectionAlgorithm=0;Ba.alternativeContactPositionCorrectionAlgorithm=1;Ba.contactPersistenceThreshold=.05;Ba.maxManifoldPoints=4;Ba.defaultJointConstraintSolverType=0;Ba.defaultJointPositionCorrectionAlgorithm=0;Ba.jointWarmStartingFactorForBaungarte=.8;Ba.jointWarmStartingFactor=.95;Ba.minSpringDamperDampingRatio=1E-6;Ba.minRagdollMaxSwingAngle=1E-6;Ba.maxJacobianRows=6;Ba.directMlcpSolverEps=1E-9;Ba.islandInitialRigidBodyArraySize=128;Ba.islandInitialConstraintArraySize= +128;Ba.sleepingVelocityThreshold=.2;Ba.sleepingAngularVelocityThreshold=.5;Ba.sleepingTimeThreshold=1;Ba.disableSleeping=!1;Ba.linearSlop=.005;Ba.angularSlop=.017453292519943278;zc.instance=new zc;ah.SUCCEEDED=0;ah.GJK_FAILED_TO_MAKE_TETRAHEDRON=1;ah.GJK_DID_NOT_CONVERGE=2;ah.EPA_FAILED_TO_INIT=257;ah.EPA_FAILED_TO_ADD_VERTEX=258;ah.EPA_DID_NOT_CONVERGE=259;ha.numCreations=0;Ea.numCreations=0;Sb.POSITIVE_INFINITY=Infinity;Sb.NEGATIVE_INFINITY=-Infinity;Sb.PI=3.14159265358979;Sb.TWO_PI=6.28318530717958; +Sb.HALF_PI=1.570796326794895;Sb.TO_RADIANS=.017453292519943278;Sb.TO_DEGREES=57.29577951308238;Hb.numCreations=0;ii.broadPhaseCollisionTime=0;ii.narrowPhaseCollisionTime=0;ii.dynamicsTime=0;ii.totalTime=0;Jh.BAUMGARTE=0;Jh.SPLIT_IMPULSE=1;Jh.NGS=2;$g.SPHERICAL=0;$g.REVOLUTE=1;$g.CYLINDRICAL=2;$g.PRISMATIC=3;$g.UNIVERSAL=4;$g.RAGDOLL=5;$g.GENERIC=6;Ck.ITERATIVE=0;Ck.DIRECT=1;Ih.DYNAMIC=0;Ih.STATIC=1;Ih.KINEMATIC=2;il.h()})({}); diff --git a/bin/js_modules/OimoPhysics.d.ts b/bin/js_modules/OimoPhysics.d.ts index 46dbf6a..6fdcb1b 100644 --- a/bin/js_modules/OimoPhysics.d.ts +++ b/bin/js_modules/OimoPhysics.d.ts @@ -2540,11 +2540,6 @@ export namespace oimo.dynamics.rigidbody { * The rigid body's motion type. See `RigidBodyType` for details. */ type: number; - /** - * Whether to automatically sleep the rigid body when it stops moving - * for a certain period of time, namely `Setting.sleepingTimeThreshold`. - */ - autoSleep: boolean; /** * The damping coefficient of the linear velocity. Set positive values to * gradually reduce the linear velocity. @@ -2555,6 +2550,23 @@ export namespace oimo.dynamics.rigidbody { * gradually reduce the angular velocity. */ angularDamping: number; + /** + * Whether to automatically sleep the rigid body when it stops moving + * for a certain period of time, namely `sleepingTimeThreshold`. + */ + autoSleep: boolean; + /** + * The linear velocity threshold to sleep the rigid body. + */ + sleepingVelocityThreshold: number; + /** + * The angular velocity threshold to sleep the rigid body. + */ + sleepingAngularVelocityThreshold: number; + /** + * The time threshold to sleep the rigid body. + */ + sleepingTimeThreshold: number; } } @@ -3542,6 +3554,9 @@ export namespace oimo.dynamics.rigidbody { _sleepTime: number; _sleeping: boolean; _autoSleep: boolean; + _sleepingVelocityThreshold: number; + _sleepingAngularVelocityThreshold: number; + _sleepingTimeThreshold: number; _mass: number; _invMass: number; _localInertia00: number; diff --git a/bin/js_modules/OimoPhysics.js b/bin/js_modules/OimoPhysics.js index 28c2b52..3842e37 100644 --- a/bin/js_modules/OimoPhysics.js +++ b/bin/js_modules/OimoPhysics.js @@ -349,14 +349,11 @@ oimo.collision.broadphase.bruteforce.BruteForceBroadPhase = class oimo_collision collectPairs() { let p = this._proxyPairList; if(p != null) { - while(true) { + do { p._p1 = null; p._p2 = null; p = p._next; - if(!(p != null)) { - break; - } - } + } while(p != null); this._proxyPairList._next = this._proxyPairPool; this._proxyPairPool = this._proxyPairList; this._proxyPairList = null; @@ -1230,14 +1227,11 @@ oimo.collision.broadphase.bvh.BvhBroadPhase = class oimo_collision_broadphase_bv collectPairs() { let p = this._proxyPairList; if(p != null) { - while(true) { + do { p._p1 = null; p._p2 = null; p = p._next; - if(!(p != null)) { - break; - } - } + } while(p != null); this._proxyPairList._next = this._proxyPairPool; this._proxyPairPool = this._proxyPairList; this._proxyPairList = null; @@ -2739,7 +2733,6 @@ oimo.collision.geometry.CapsuleGeometry = class oimo_collision_geometry_CapsuleG return false; } tminxz = 0; - tmaxxz = 1; } let crossY = beginY + (endY - beginY) * tminxz; let min; @@ -4662,27 +4655,15 @@ oimo.collision.narrowphase.detector.BoxBoxDetector = class oimo_collision_narrow c12X = -c12X; c12Y = -c12Y; c12Z = -c12Z; - let tmp = b1; - b1 = b2; - b2 = tmp; - let tmp1 = w1; w1 = w2; - w2 = tmp1; - let tmp2 = h1; h1 = h2; - h2 = tmp2; - let tmp3 = d1; d1 = d2; - d2 = tmp3; tmpX = c1X; tmpY = c1Y; tmpZ = c1Z; c1X = c2X; c1Y = c2Y; c1Z = c2Z; - c2X = tmpX; - c2Y = tmpY; - c2Z = tmpZ; tmpX = x1X; tmpY = x1Y; tmpZ = x1Z; @@ -4854,7 +4835,6 @@ oimo.collision.narrowphase.detector.BoxBoxDetector = class oimo_collision_narrow incId = 4; } if(-incDot < minIncDot) { - minIncDot = -incDot; incId = 5; } let incV1X; @@ -6375,7 +6355,7 @@ oimo.collision.narrowphase.detector.gjkepa.EpaPolyhedron = class oimo_collision_ let v = v1; let prevT = null; let firstT = null; - while(true) { + do { if(v._tmpEdgeLoopNext == null) { this._dumpAsObjModel(); this._status = 4; @@ -6421,10 +6401,7 @@ oimo.collision.narrowphase.detector.gjkepa.EpaPolyhedron = class oimo_collision_ } prevT = t; v = v._tmpEdgeLoopNext; - if(!(v != v1)) { - break; - } - } + } while(v != v1); if(!prevT.setAdjacentTriangle(firstT)) { this._status = 1; } @@ -11506,7 +11483,7 @@ oimo.collision.narrowphase.detector.gjkepa.GjkEpa = class oimo_collision_narrowp oldDirX = v.x; oldDirY = v.y; oldDirZ = v.z; - while(true) { + do { let s0X; let s0Y; let s0Z; @@ -11586,8 +11563,7 @@ oimo.collision.narrowphase.detector.gjkepa.GjkEpa = class oimo_collision_narrowp break; } this.simplexSize--; - break; - } + } while(false); let v1 = this.dir; v1.x = oldDirX; v1.y = oldDirY; @@ -15232,7 +15208,7 @@ oimo.dynamics.ContactManager = class oimo_dynamics_ContactManager { let pp = this._broadPhase._proxyPairList; while(pp != null) { let n = pp._next; - while(true) { + do { let s1; let s2; if(pp._p1._id < pp._p2._id) { @@ -15321,8 +15297,7 @@ oimo.dynamics.ContactManager = class oimo_dynamics_ContactManager { _this._tf2 = _this._b2._transform; this._numContacts++; } - break; - } + } while(false); pp = n; } } @@ -15331,7 +15306,7 @@ oimo.dynamics.ContactManager = class oimo_dynamics_ContactManager { let c = this._contactList; while(c != null) { let n = c._next; - while(true) { + do { if(c._latest) { c._latest = false; c._shouldBeSkipped = false; @@ -15526,8 +15501,7 @@ oimo.dynamics.ContactManager = class oimo_dynamics_ContactManager { break; } c._shouldBeSkipped = !(aabb1._minX < aabb2._maxX && aabb1._maxX > aabb2._minX && aabb1._minY < aabb2._maxY && aabb1._maxY > aabb2._minY && aabb1._minZ < aabb2._maxZ && aabb1._maxZ > aabb2._minZ); - break; - } + } while(false); c = n; } } @@ -15679,9 +15653,9 @@ oimo.dynamics.Island = class oimo_dynamics_Island { rb._angularContactImpulseX = 0; rb._angularContactImpulseY = 0; rb._angularContactImpulseZ = 0; - if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < oimo.common.Setting.sleepingVelocityThreshold * oimo.common.Setting.sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < oimo.common.Setting.sleepingAngularVelocityThreshold * oimo.common.Setting.sleepingAngularVelocityThreshold) { + if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < rb._sleepingVelocityThreshold * rb._sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < rb._sleepingAngularVelocityThreshold * rb._sleepingAngularVelocityThreshold) { rb._sleepTime += dt; - if(rb._sleepTime > oimo.common.Setting.sleepingTimeThreshold) { + if(rb._sleepTime >= rb._sleepingTimeThreshold) { rb._sleeping = true; rb._sleepTime = 0; } @@ -15883,12 +15857,12 @@ oimo.dynamics.Island = class oimo_dynamics_Island { rb._angularContactImpulseY = 0; rb._angularContactImpulseZ = 0; rb._sleeping = false; - if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < oimo.common.Setting.sleepingVelocityThreshold * oimo.common.Setting.sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < oimo.common.Setting.sleepingAngularVelocityThreshold * oimo.common.Setting.sleepingAngularVelocityThreshold) { + if(rb._autoSleep && rb._velX * rb._velX + rb._velY * rb._velY + rb._velZ * rb._velZ < rb._sleepingVelocityThreshold * rb._sleepingVelocityThreshold && rb._angVelX * rb._angVelX + rb._angVelY * rb._angVelY + rb._angVelZ * rb._angVelZ < rb._sleepingAngularVelocityThreshold * rb._sleepingAngularVelocityThreshold) { rb._sleepTime += dt; } else { rb._sleepTime = 0; } - if(rb._sleepTime < oimo.common.Setting.sleepingTimeThreshold) { + if(rb._sleepTime < rb._sleepingTimeThreshold) { sleepIsland = false; } if(rb._type == 0) { @@ -19075,8 +19049,7 @@ oimo.dynamics.common.DebugDraw = class oimo_dynamics_common_DebugDraw { let i = _g1++; let v2 = this.tmpCircleVerts2[i]; let v3 = this.tmpCircleVerts2[(i + 1) % 8]; - let n1 = this.tmpCircleVerts1[i]; - this.triangle(_this7,v2,v3,n1,this.tmpCircleNorms[i],this.tmpCircleNorms[(i + 1) % 8],color); + this.triangle(_this7,v2,v3,this.tmpCircleVerts1[i],this.tmpCircleNorms[i],this.tmpCircleNorms[(i + 1) % 8],color); v2 = this.tmpCircleVerts2[(i + 1) % 8]; v3 = this.tmpCircleVerts2[i]; let _this = this.p; @@ -19088,7 +19061,6 @@ oimo.dynamics.common.DebugDraw = class oimo_dynamics_common_DebugDraw { _this2.x = -_this2.x; _this2.y = -_this2.y; _this2.z = -_this2.z; - n1 = _this2; this.triangle(_this10,v2,v3,_this2,_this2,_this2,color); let _this3 = this.p; if(_this2 != null) { @@ -21653,7 +21625,6 @@ oimo.dynamics.constraint.contact.ManifoldUpdater = class oimo_dynamics_constrain maxDepthIndex = 2; } if(p4._depth > maxDepth) { - maxDepth = p4._depth; maxDepthIndex = 3; } let rp1X; @@ -21932,7 +21903,6 @@ oimo.dynamics.constraint.contact.ManifoldUpdater = class oimo_dynamics_constrain let a13 = cross1X3 * cross1X3 + cross1Y3 * cross1Y3 + cross1Z3 * cross1Z3; let a24 = cross2X3 * cross2X3 + cross2Y3 * cross2Y3 + cross2Z3 * cross2Z3; let a34 = cross3X3 * cross3X3 + cross3Y3 * cross3Y3 + cross3Z3 * cross3Z3; - let a4 = a13 > a24 ? a13 > a34 ? a13 : a34 : a24 > a34 ? a24 : a34; let max = a1 > a2 ? a1 > a3 ? a1 : a3 : a2 > a3 ? a2 : a3; let target = 0; if(a22 > max && maxDepthIndex != 1 || maxDepthIndex == 0) { @@ -21943,8 +21913,7 @@ oimo.dynamics.constraint.contact.ManifoldUpdater = class oimo_dynamics_constrain max = a33; target = 2; } - if(a4 > max && maxDepthIndex != 3) { - max = a4; + if((a13 > a24 ? a13 > a34 ? a13 : a34 : a24 > a34 ? a24 : a34) > max && maxDepthIndex != 3) { target = 3; } return target; @@ -26447,13 +26416,10 @@ oimo.dynamics.constraint.joint.RagdollJoint = class oimo_dynamics_constraint_joi swingVX *= invLen * this._swingAngle; swingVY *= invLen * this._swingAngle; swingVZ *= invLen * this._swingAngle; - let __tmp__X1; let __tmp__Y1; let __tmp__Z1; - __tmp__X1 = basis1Mat00 * swingVX + basis1Mat10 * swingVY + basis1Mat20 * swingVZ; __tmp__Y1 = basis1Mat01 * swingVX + basis1Mat11 * swingVY + basis1Mat21 * swingVZ; __tmp__Z1 = basis1Mat02 * swingVX + basis1Mat12 * swingVY + basis1Mat22 * swingVZ; - swingVX = __tmp__X1; swingVY = __tmp__Y1; swingVZ = __tmp__Z1; let x1 = swingVY; @@ -32686,6 +32652,9 @@ oimo.dynamics.rigidbody.RigidBody = class oimo_dynamics_rigidbody_RigidBody { this._sleepTime = 0; this._sleeping = false; this._autoSleep = config.autoSleep; + this._sleepingVelocityThreshold = config.sleepingVelocityThreshold; + this._sleepingAngularVelocityThreshold = config.sleepingAngularVelocityThreshold; + this._sleepingTimeThreshold = config.sleepingTimeThreshold; this._mass = 0; this._invMass = 0; this._localInertia00 = 0; @@ -36477,9 +36446,12 @@ oimo.dynamics.rigidbody.RigidBodyConfig = class oimo_dynamics_rigidbody_RigidBod this.linearVelocity = new oimo.common.Vec3(); this.angularVelocity = new oimo.common.Vec3(); this.type = 0; - this.autoSleep = true; this.linearDamping = 0; this.angularDamping = 0; + this.autoSleep = true; + this.sleepingVelocityThreshold = oimo.common.Setting.sleepingVelocityThreshold; + this.sleepingAngularVelocityThreshold = oimo.common.Setting.sleepingAngularVelocityThreshold; + this.sleepingTimeThreshold = oimo.common.Setting.sleepingTimeThreshold; } } oimo.dynamics.rigidbody.RigidBodyType = class oimo_dynamics_rigidbody_RigidBodyType { diff --git a/build-doc.hxml b/build-doc.hxml index c36b50e..be660ea 100644 --- a/build-doc.hxml +++ b/build-doc.hxml @@ -4,4 +4,4 @@ -main export.Export --interp -xml docs/doc.xml --cmd haxelib run dox -i docs/doc.xml -o docs -in "oimo.(collision|common|dynamics)" -ex "oimo.dynamics.constraint.(info|solver.common)" --title "OimoPhysics API documentation" -D website https://github.com/saharan/OimoPhysics -D source-path https://github.com/saharan/OimoPhysics/tree/master/src/ -D description "OimoPhysics API Documentation" -D version 1.2.4 +-cmd haxelib run dox -i docs/doc.xml -o docs -in "oimo$|oimo\.(collision|common|dynamics)" -ex "oimo\.dynamics\.constraint\.(info|solver\.common)" --title "OimoPhysics API documentation" -D website https://github.com/saharan/OimoPhysics -D source-path https://github.com/saharan/OimoPhysics/tree/master/src/ -D description "OimoPhysics API Documentation" -D version 1.2.5 diff --git a/docs/404.html b/docs/404.html index c8208f1..3438521 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -File not found - OimoPhysics API documentation

404 Page not found

Page not found, sorry.

\ No newline at end of file +File not found - OimoPhysics API documentation

404 Page not found

Page not found, sorry.

\ No newline at end of file diff --git a/docs/dark-mode.css b/docs/dark-mode.css new file mode 100644 index 0000000..0cfb8aa --- /dev/null +++ b/docs/dark-mode.css @@ -0,0 +1,329 @@ +#theme-toggle:focus { + outline: none; +} + +.dark-theme { + background-color: #111 !important; + color: #ccc; + color-scheme: dark; +} + +.dark-theme body { + background-color: #111 !important; + color: #ccc; +} + +.dark-theme .navbar-inner { + background-color: #222 !important; +} + +.dark-theme .brand { + color: #CCC !important; +} + +.dark-theme .well { + background-color: #222; + border: 1px solid #222; +} + +.dark-theme .input-append .add-on, +.dark-theme .input-prepend .add-on { + background-color: #333; + border: 1px solid #333; + padding: 3px 5px; + text-shadow: 0 0 0 #000; +} + +.dark-theme h1 { + color: #ccc; +} + +.dark-theme a { + color: #0087ff; +} + +.dark-theme a:hover, +.dark-theme a:focus { + color: #00b7ff; +} + +.dark-theme input, +.dark-theme textarea { + background-color: #151515; + border: 1px solid #333; + transition: none; +} + +.dark-theme .btn-group.open .btn.dropdown-toggle { + background-color: #202020; +} + +.dark-theme .dropdown-menu { + background-color: #111; +} + +.dark-theme .dropdown-menu>li>a { + color: #EEE; +} + +.dark-theme .dropdown-menu>li>a:hover, +.dark-theme .dropdown-menu>li>a:focus, +.dark-theme .dropdown-submenu:hover>a, +.dark-theme .dropdown-submenu:focus>a { + color: #EEE; + background-color: #2f2f2f; + background-image: linear-gradient(to bottom, #262626, #2f2f2f); +} + +.dark-theme .btn:focus, +.dark-theme .btn:hover { + background-position: 0 0; +} + +.dark-theme .nav>li>a:hover, +.dark-theme .nav>li>a:focus { + background-color: #333; +} + +.dark-theme .nav-list>.active>a { + background-color: #444; +} + +.dark-theme .nav-list>.active>a.treeLink, +.dark-theme .nav-list>.active>a.treeLink:hover, +.dark-theme .nav-list>.active>a.treeLink:focus { + background: #269; +} + +.dark-theme .btn { + color: #d5d5d5; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75); + background-color: #313131; + background-image: linear-gradient(to bottom, #313131, #282828); + border: 1px solid #424141; + border-bottom-color: #393939; + box-shadow: none; +} + +.dark-theme .btn { + color: #d5d5d5; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75); + background-color: #313131; + background-image: linear-gradient(to bottom, #313131, #282828); + border: 1px solid #424141; + border-bottom-color: rgb(66, 65, 65); + border-bottom-color: #393939; + box-shadow: none; +} + +.dark-theme .btn:focus, +.dark-theme .btn:hover { + color: #fff; + text-decoration: none; +} + +.dark-theme .btn.active, +.dark-theme .btn:active { + background-image: none; + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} + +.dark-theme .btn.disabled, +.dark-theme .btn[disabled] { + cursor: not-allowed; + opacity: 0.65; + box-shadow: none; + border-color: #393939; +} + +.dark-theme .btn:focus { + color: #d5d5d5; + background-color: #313131; + border-color: #424141; +} + +.dark-theme .btn:active:hover, +.dark-theme .btn:focus:hover { + color: #fff; + background-color: #313131; + border-color: #393939; +} + +.dark-theme a.btn.disabled { + pointer-events: none; +} + +.dark-theme .section.site-footer { + background: #111 !important; +} + +.dark-theme .copyright>p { + color: #CCC !important; +} + +.dark-theme .table th, +.dark-theme .table td { + border-bottom: 1px solid #222; +} + +.dark-theme .table .fa { + color: #222; + margin-right: 5px; +} + +.dark-theme .alert, +.dark-theme .alert h4 { + color: #ffc96c; +} + +.dark-theme .availability { + color: #69b; +} + +.dark-theme .section-availability { + color: #69b; +} + +.dark-theme .alert { + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); +} + +.dark-theme .alert { + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); + background-color: #332b00; + border: none; +} + +.dark-theme hr { + border-top: none; + border-bottom: 1px solid #222; +} + +.dark-theme .page-header { + border-bottom: 1px solid #222; +} + +.dark-theme .section { + border-bottom: 1px solid #222; +} + +.dark-theme .field+.field { + border-top: 1px solid #222; +} + +.dark-theme code { + color: #ddd; + background-color: #111; + border: 1px solid #222; +} + +.dark-theme pre { + background-color: #222; + border: 1px solid #333; +} + +.dark-theme .example code { + color: #ddd; + background-color: transparent; + border: none; +} + +.dark-theme pre code { + background-color: transparent; +} + +.dark-theme pre.example::before { + color: #DDD; + background: #191919; +} + +.dark-theme h3 code { + box-shadow: 0 0 15px rgb(20, 20, 20); +} + +.dark-theme .label, +.dark-theme .badge { + color: #DDD; + background-color: #404040; +} + +.dark-theme .label.label-meta { + background: #333379; +} + +.dark-theme code .identifier { + color: #eff; +} + +.dark-theme table.params { + border-left: 5px solid #222; + margin-left: 20px; +} + +.dark-theme .table-bordered { + border: 1px solid #222; +} + +.dark-theme table.params th { + background: #111; +} + +.dark-theme .table-bordered th, +.dark-theme .table-bordered td { + border-left: 1px solid #222; +} + +.dark-theme .indent { + border-left: 5px solid #222; +} + + +/* Types without links */ + +.dark-theme code .type { + color: #29e; +} + + +/* dark code examples (from try-haxe) */ + +.dark-theme code, +.dark-theme pre { + color: #DDD; +} + +.dark-theme code a { + color: #29e +} + +.dark-theme pre .type { + color: #DECB6B +} + +.dark-theme pre .kwd { + color: #C792EA +} + +.dark-theme pre .val { + color: #FF5370 +} + +.dark-theme div.pre .str, +.dark-theme pre .str, +.dark-theme pre .str .kwd, +.dark-theme pre .str .type, +.dark-theme pre .str .val { + color: #C3E88D +} + +.dark-theme pre .cmt, +.dark-theme pre .cmt .kwd, +.dark-theme pre .cmt .str, +.dark-theme pre .cmt .type, +.dark-theme pre .cmt .val { + color: #545454 +} + +.dark-theme .last-modified { + color: #666 +} diff --git a/docs/doc.xml b/docs/doc.xml index c4e7902..bb8fef1 100644 --- a/docs/doc.xml +++ b/docs/doc.xml @@ -1,7 +1,7 @@ - + `Any` is a type that is compatible with any other in both ways. @@ -342,6 +342,11 @@ Creates a new Array. + An Array is a storage for values. You can access it using indexes or + with its API. + + @see https://haxe.org/manual/std-Array.html + @see https://haxe.org/manual/lf-array-comprehension.html @@ -854,10 +859,10 @@ - Tells if `f` is not a valid number. + Tells if `f` is `Math.NaN`. If `f` is `NaN`, the result is `true`, otherwise the result is `false`. - In particular, both `POSITIVE_INFINITY` and `NEGATIVE_INFINITY` are + In particular, `null`, `POSITIVE_INFINITY` and `NEGATIVE_INFINITY` are not considered `NaN`. This class defines mathematical functions and constants. @@ -1192,21 +1197,22 @@ Leading whitespaces are ignored. - If `x` starts with 0x or 0X, hexadecimal notation is recognized where the following digits may - contain 0-9 and A-F. + `x` may optionally start with a + or - to denote a postive or negative value respectively. - Otherwise `x` is read as decimal number with 0-9 being allowed characters. `x` may also start with - a - to denote a negative value. + If the optional sign is followed 0x or 0X, hexadecimal notation is recognized where the following + digits may contain 0-9 and A-F. Both the prefix and digits are case insensitive. - In decimal mode, parsing continues until an invalid character is detected, in which case the - result up to that point is returned. For hexadecimal notation, the effect of invalid characters - is unspecified. + Otherwise `x` is read as decimal number with 0-9 being allowed characters. Octal and binary + notations are not supported. + + Parsing continues until an invalid character is detected, in which case the result up to + that point is returned. Scientific notation is not supported. That is `Std.parseInt('10e2')` produces `10`. - Leading 0s that are not part of the 0x/0X hexadecimal notation are ignored, which means octal - notation is not supported. + If `x` is `null`, the result is `null`. + If `x` cannot be parsed as integer or is empty, the result is `null`. - If `x` is null, the result is unspecified. - If `x` cannot be parsed as integer, the result is `null`. + If `x` starts with a hexadecimal prefix which is not followed by at least one valid hexadecimal + digit, the result is unspecified. @@ -1216,9 +1222,12 @@ Converts a `String` to a `Float`. The parsing rules for `parseInt` apply here as well, with the exception of invalid input - resulting in a `NaN` value instead of null. + resulting in a `NaN` value instead of `null`. Also, hexadecimal support is **not** specified. - Additionally, decimal notation may contain a single `.` to denote the start of the fractions. + Additionally, decimal notation may contain a single `.` to denote the start of the fractions. + + It may also end with `e` or `E` followed by optional minus or plus sign and a sequence of + digits (defines exponent to base 10). @@ -2005,6 +2014,14 @@ The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + + + + + + + Triggers a call to the handle's callback by the handle's loop. + @@ -2027,6 +2044,14 @@ The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + + + + + + + Triggers a call to the handle's callback by the handle's loop. + @@ -2044,6 +2069,16 @@ @see https://aantron.github.io/luv/luv/Luv/Handle + + + + + + + Reference the given handle. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-ref + @@ -2061,6 +2096,16 @@ + + + + + + + Reference the given handle. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-ref + @@ -2147,18 +2192,10 @@ - - - - Exception message. - - - Native exception, which caused this exception. - <__exceptionMessage> @@ -2167,14 +2204,6 @@ - <__skipStack expr="0"> - - - 0 - - "haxe.Exception.get_stack" - - <__nativeException> @@ -2183,14 +2212,13 @@ - + "haxe.Exception.thrown" Returns exception message. - - - + + @@ -2246,7 +2274,6 @@ ```]]> - @@ -2520,6 +2547,43 @@ type, the underlying type will be `Dynamic`.]]> + + + + The current thread acquire the mutex or wait if not available. + The same thread can acquire several times the same mutex but + must release it as many times it has been acquired. + + + + Try to acquire the mutex, returns true if acquire or false + if it's already locked by another thread. + + + + Release a mutex that has been acquired by the current thread. + The behavior is undefined if the current thread does not own + the mutex. + + + + Creates a mutex. + + Creates a mutex, which can be used to acquire a temporary lock + to access some ressource. The main difference with a lock is + that a mutex must always be released by the owner thread. + + + + + + + Start the main loop. Depending on the platform, this can return immediately or will only return when the application exits. + + If `haxe.MainLoop` is kept from DCE, then we will insert an `haxe.EntryPoint.run()` call just at then end of `main()`. + This class can be redefined by custom frameworks so they can handle their own main loop logic. + + @@ -2530,7 +2594,7 @@ If `e` is inside a package, the package structure is returned dot- separated, with another dot separating the enum name: - + pack1.pack2.(...).packN.EnumName If `e` is a sub-type of a Haxe module, that module is not part of the @@ -2613,7 +2677,7 @@ unspecified. - + @@ -2626,7 +2690,7 @@ If `a` or `b` are `null`, the result is unspecified. - + @@ -2637,7 +2701,7 @@ If `e` is `null`, the result is unspecified. - + @@ -2651,7 +2715,7 @@ If `e` is `null`, the result is unspecified. - + @@ -2713,7 +2777,7 @@ - + Outputs `v` in a platform-dependent way. @@ -2740,6 +2804,38 @@ + + + + + + + true + Tells if the event can lock the process from exiting (default:true) + + + + + + + + + + + + + + + + + Run the pending events. Return the time for next event. + + + + + haxe.MainEvent + + @@ -2780,47 +2876,6 @@ This can be used to track positions of calls in e.g. a unit testing framework. - - - - - Thrown value. - - - - - - - - An exception containing arbitrary value. - - This class is automatically used for throwing values, which don't extend `haxe.Exception` - or native exception type. - For example: - ```haxe - throw "Terrible error"; - ``` - will be compiled to - ```haxe - throw new ValueException("Terrible error"); - ``` - - - - - - - - - - - HashMap allows mapping of hashable objects to arbitrary values. - - See `Map` for documentation details. - - @see https://haxe.org/manual/std-Map.html - - @@ -3426,6 +3481,11 @@ The type-hint of the variable, if available. + + + + The position of the variable name. + The name of the variable. @@ -3435,6 +3495,11 @@ Metadata associatied with the variable, if available. + + + + Whether or not the variable is static. + @@ -3526,6 +3591,11 @@ The metadata of the type parameter. + + + + The optional default type of the type parameter. + @@ -3740,6 +3810,11 @@ The name of the type parameter. + + + + The default type for this type parameter. + Represents the declaration of type parameters. @@ -13497,6 +13572,18 @@ hide + <_sleepingVelocityThreshold public="1"> + + hide + + <_sleepingAngularVelocityThreshold public="1"> + + hide + + <_sleepingTimeThreshold public="1"> + + hide + <_mass public="1"> hide @@ -13749,23 +13836,23 @@ * Extra field that users can use for their own purposes. - <_integrate public="1" set="method" line="142"> + <_integrate public="1" set="method" line="148"> hide - <_integratePseudoVelocity public="1" set="method" line="183"> + <_integratePseudoVelocity public="1" set="method" line="189"> hide - - + + * Returns the world position of the rigid body. - + @@ -13774,25 +13861,25 @@ * * This does not create a new instance of `Vec3`. - + * Sets the world position of the rigid body to `position`. - + * Translates the position of the rigid body by `translation`. - + * Returns the rotation matrix of the rigid body. - + @@ -13801,39 +13888,39 @@ * * This does not create a new instance of `Mat3`. - + * Sets the rotation matrix of the rigid body to `rotation`. - + * Sets the rotation of the rigid body by Euler angles `eulerAngles` in radians. - + * Rotates the rigid body by the rotation matrix `rotation`. - + * Rotates the rigid body by Euler angles `eulerAngles` in radians. - + * Returns the rotation of the rigid body as a quaternion. - + @@ -13842,18 +13929,18 @@ * * This does not create a new instance of `Quat`. - + * Sets the rotation of the rigid body from a quaternion `quaternion`. - + * Returns the transform of the rigid body. - + @@ -13862,7 +13949,7 @@ * * This does not create a new instance of `Transform`. - + @@ -13871,17 +13958,17 @@ * * This does not keep any references to `transform`. - + * Returns the mass of the rigid body. * * If the rigid body has infinite mass, `0` will be returned. - + * Returns the moment of inertia tensor in local space. - + @@ -13890,11 +13977,11 @@ * * This does not create a new instance of `Mat3` - + * Returns the mass data of the rigid body. - + @@ -13903,7 +13990,7 @@ * * This does not create a new instance of `MassData`. - + @@ -13914,11 +14001,11 @@ * - some shapes are added or removed * - the type of the rigid body is changed - + * Returns the rotation factor of the rigid body. - + @@ -13929,11 +14016,11 @@ * angular velocity in **global space** along X, Y and Z axis will scale by `rotationFactor.x`, * `rotationFactor.y` and `rotationFactor.z` times respectively. - + * Returns the linear velocity of the rigid body. - + @@ -13942,18 +14029,18 @@ * * This does not create a new intrance of `Vec3`. - + * Sets the linear velocity of the rigid body. - + * Returns the angular velocity of the rigid body. - + @@ -13962,28 +14049,28 @@ * * This does not create a new intrance of `Vec3`. - + * Sets the angular velocity of the rigid body. - + * Adds `linearVelocityChange` to the linear velcity of the rigid body. - + * Adds `angularVelocityChange` to the angular velcity of the rigid body. - + @@ -13993,7 +14080,7 @@ * * This changes both the linear velocity and the angular velocity. - + @@ -14002,7 +14089,7 @@ * * This does not change the angular velocity. - + @@ -14011,7 +14098,7 @@ * * This does not change the linear velocity. - + @@ -14019,25 +14106,25 @@ * Applies the force `force` to `positionInWorld` in world position. - + * Applies the force `force` to the center of mass. - + * Applies the torque `torque`. - + * Returns the total linear impulse applied by contact constraints. - + @@ -14046,11 +14133,11 @@ * * This does not create a new instance of `Vec3`. - + * Returns the total angular impulse applied by contact constraints. - + @@ -14059,11 +14146,11 @@ * * This does not create a new instance of `Vec3`. - + * Returns the gravity scaling factor of the rigid body. - + @@ -14072,14 +14159,14 @@ * * If `0` is set, the rigid body will not be affected by gravity. - + * Returns the local coordinates of the point `worldPoint` in world coodinates. - + @@ -14089,14 +14176,14 @@ * * This does not create a new instance of `Vec3`. - + * Returns the local coordinates of the vector `worldVector` in world coodinates. - + @@ -14106,14 +14193,14 @@ * * This does not create a new instance of `Vec3`. - + * Returns the world coordinates of the point `localPoint` in local coodinates. - + @@ -14123,14 +14210,14 @@ * * This does not create a new instance of `Vec3`. - + * Returns the world coordinates of the vector `localVector` in local coodinates. - + @@ -14140,51 +14227,51 @@ * * This does not create a new instance of `Vec3`. - + * Returns the number of the shapes added. - + * Returns the list of the shapes of the rigid body. - + * Returns the number of the contact lists the rigid body is involved. - + * Returns the list of the contact links the rigid body is involved. - + * Returns the number of the joint links the rigid body is attached. - + * Returns the list of the joint links the rigid body is attached. - + * Adds the shape to the rigid body. - + * Removes the shape from the rigid body. - + * Returns the rigid body's type of behaviour. * * See `RigidBodyType` class for details. - + @@ -14193,28 +14280,28 @@ * * See `RigidBodyType` class for details. - + * Sets the rigid body's sleep flag false. * * This also resets the sleeping timer of the rigid body. - + * Sets the rigid body's sleep flag true. * * This also resets the sleeping timer of the rigid body. - + * Returns whether the rigid body is sleeping. - + * Returns how long the rigid body is stopping moving. This returns `0` if the body * has already slept. - + @@ -14223,41 +14310,41 @@ * * If auto sleep is enabled, the rigid body will automatically sleep when needed. - + * Returns the linear damping. - + * Sets the linear damping to `damping`. - + * Returns the angular damping. - + * Sets the angular damping to `damping`. - + * Returns the previous rigid body in the world. * * If the previous one does not exist, `null` will be returned. - + * Returns the next rigid body in the world. * * If the next one does not exist, `null` will be returned. - + @@ -14292,11 +14379,6 @@ * The rigid body's motion type. See `RigidBodyType` for details. - - - * Whether to automatically sleep the rigid body when it stops moving - * for a certain period of time, namely `Setting.sleepingTimeThreshold`. - * The damping coefficient of the linear velocity. Set positive values to @@ -14307,7 +14389,24 @@ * The damping coefficient of the angular velocity. Set positive values to * gradually reduce the angular velocity. - + + + * Whether to automatically sleep the rigid body when it stops moving + * for a certain period of time, namely `sleepingTimeThreshold`. + + + + * The linear velocity threshold to sleep the rigid body. + + + + * The angular velocity threshold to sleep the rigid body. + + + + * The time threshold to sleep the rigid body. + + * Default constructor. @@ -14666,29 +14765,44 @@ + eval.luv.Loop + + + new Mutex() + + + + 0 + [] - + + + false + + + + Execute all pending events. - Wait and execute as many events as many times `promiseEvent()` was called. - Runs until all repeating events are cancelled and no more events is expected. + Wait and execute as many events as the number of times `promise()` was called. + Runs until all repeating events are cancelled and no more events are expected. Depending on a target platform this method may be non-reentrant. It must not be called from event callbacks. - + - + An event loop implementation used for `sys.thread.Thread` @@ -14696,31 +14810,56 @@ - - - - The current thread acquire the mutex or wait if not available. - The same thread can acquire several times the same mutex but - must release it as many times it has been acquired. - - - - Try to acquire the mutex, returns true if acquire or false - if it's already locked by another thread. - + + + + + + + Waits for the lock to be released, or `timeout` (in seconds) + to expire. Returns `true` if the lock is released and `false` + if a time-out occurs. + - Release a mutex that has been acquired by the current thread. - The behavior is undefined if the current thread does not own - the mutex. + Releases the lock once. + + The thread does not need to own the lock in order to release + it. Each call to `release` allows exactly one call to `wait` + to execute. - Creates a mutex. + Creates a new Lock which is initially locked. - Creates a mutex, which can be used to acquire a temporary lock - to access some ressource. The main difference with a lock is - that a mutex must always be released by the owner thread. + A Lock allows blocking execution until it has been unlocked. It keeps track + of how often `release` has been called, and blocks exactly as many `wait` + calls. + + The order of the `release` and `wait` calls is irrelevant. That is, a Lock + can be released before anyone waits for it. In that case, the `wait` call + will execute immediately. + + Usage example: + + ```haxe + var lock = new Lock(); + var elements = [1, 2, 3]; + for (element in elements) { + // Create one thread per element + new Thread(function() { + trace(element); + Sys.sleep(1); + // Release once per thread = 3 times + lock.release(); + }); + } + for (_ in elements) { + // Wait 3 times + lock.wait(); + } + trace("All threads finished"); + ``` diff --git a/docs/index.html b/docs/index.html index e1567a7..ebd243b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,9 +1,10 @@ -top level - OimoPhysics API documentation

top level version 1.2.4

OimoPhysics API Documentation

oimo
\ No newline at end of file +} +

top level version 1.2.5

OimoPhysics API Documentation

oimo
\ No newline at end of file diff --git a/docs/index.js b/docs/index.js index 135b3e5..7984e8d 100644 --- a/docs/index.js +++ b/docs/index.js @@ -6,6 +6,22 @@ function readCookie(name) { return localStorage.getItem(name); } +function isDarkTheme() { + return document.querySelector("html").classList.contains("dark-theme"); +} + +function toggleTheme() { + const htmlTag = document.querySelector("html"); + let isDark = isDarkTheme(); + if (isDark) { + htmlTag.classList.remove("dark-theme"); + } else { + htmlTag.classList.add("dark-theme"); + } + isDark = isDarkTheme(); + localStorage.theme = isDark ? "dark" : "light"; +} + function toggleInherited(el) { var toggle = $(el).closest(".toggle"); toggle.toggleClass("toggle-on"); diff --git a/docs/oimo/collision/broadphase/BroadPhase.html b/docs/oimo/collision/broadphase/BroadPhase.html index 4b51d85..19d09e8 100644 --- a/docs/oimo/collision/broadphase/BroadPhase.html +++ b/docs/oimo/collision/broadphase/BroadPhase.html @@ -1,12 +1,13 @@ -oimo.collision.broadphase.BroadPhase - OimoPhysics API documentation

The abstract class of a broad-phase collision detection algorithm.

Methods

aabbTest(aabb:Aabb, callback:BroadPhaseProxyCallback):Void

Performs an AABB query. callback.process is called for all proxies that their AABB +} +

The abstract class of a broad-phase collision detection algorithm.

Methods

aabbTest(aabb:Aabb, callback:BroadPhaseProxyCallback):Void

Performs an AABB query. callback.process is called for all proxies that their AABB and aabb intersect.

collectPairs():Void

Collects overlapping pairs of the proxies and put them into a linked list. The linked list can be get through BroadPhase.getProxyPairList method.

Note that in order to collect pairs, the broad-phase algorithm requires to be informed of @@ -19,4 +20,4 @@ than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.

moveProxy(proxy:Proxy, aabb:Aabb, displacement:Vec3):Void

Moves the proxy proxy to the axis-aligned bounding box aabb. displacement is the difference between current and previous center of the AABB. This is used for predicting movement of the proxy.

rayCast(begin:Vec3, end:Vec3, callback:BroadPhaseProxyCallback):Void

Performs a ray casting. callback.process is called for all proxies the line segment -from begin to end intersects.

\ No newline at end of file +from begin to end intersects.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/BroadPhaseProxyCallback.html b/docs/oimo/collision/broadphase/BroadPhaseProxyCallback.html index d7d5828..b5630a5 100644 --- a/docs/oimo/collision/broadphase/BroadPhaseProxyCallback.html +++ b/docs/oimo/collision/broadphase/BroadPhaseProxyCallback.html @@ -1,9 +1,10 @@ -oimo.collision.broadphase.BroadPhaseProxyCallback - OimoPhysics API documentation

A callback class for queries in a broad phase.

Constructor

new()

Default constructor.

Methods

process(proxy:Proxy):Void

This is called every time a broad phase algorithm reports a proxy proxy.

\ No newline at end of file +} +

A callback class for queries in a broad phase.

Constructor

new()

Default constructor.

Methods

process(proxy:Proxy):Void

This is called every time a broad phase algorithm reports a proxy proxy.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/BroadPhaseType.html b/docs/oimo/collision/broadphase/BroadPhaseType.html index ee55fcc..5a99663 100644 --- a/docs/oimo/collision/broadphase/BroadPhaseType.html +++ b/docs/oimo/collision/broadphase/BroadPhaseType.html @@ -1,10 +1,11 @@ -oimo.collision.broadphase.BroadPhaseType - OimoPhysics API documentation

Types of broad-phase algorithms.

Static variables

@:value(_BRUTE_FORCE)staticread onlyBRUTE_FORCE:Int = _BRUTE_FORCE

The brute force algorithm searches all the possible pairs of the proxies every time. -This is very slow and so users should not choose this algorithm without exceptional reasons.

@:value(_BVH)staticread onlyBVH:Int = _BVH

The BVH algorithm uses bounding volume hierarchy for detecting overlapping pairs of proxies efficiently.

\ No newline at end of file +} +

Types of broad-phase algorithms.

Static variables

@:value(_BRUTE_FORCE)staticread onlyBRUTE_FORCE:Int = _BRUTE_FORCE

The brute force algorithm searches all the possible pairs of the proxies every time. +This is very slow and so users should not choose this algorithm without exceptional reasons.

@:value(_BVH)staticread onlyBVH:Int = _BVH

The BVH algorithm uses bounding volume hierarchy for detecting overlapping pairs of proxies efficiently.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/Proxy.html b/docs/oimo/collision/broadphase/Proxy.html index 085feb9..adf2113 100644 --- a/docs/oimo/collision/broadphase/Proxy.html +++ b/docs/oimo/collision/broadphase/Proxy.html @@ -1,16 +1,17 @@ -oimo.collision.broadphase.Proxy - OimoPhysics API documentationoimo.collision.broadphase.Proxy - OimoPhysics API documentation

A proxy is an object that can be added to a broad-phase collision detection algorithm. +} +

A proxy is an object that can be added to a broad-phase collision detection algorithm. Users of the collision part of the library can move an axis-aligned bounding box of a proxy through BroadPhase class.

Variables

userData:Any

Extra field that users can use for their own purposes. Do not modify this property if you use the physics part of the library, as the physics part of the library uses this property for connecting proxies and shapes of rigid bodies.

Methods

getFatAabb():Aabb

Returns the fat AABB of the proxy.

getFatAabbTo(aabb:Aabb):Void

Sets aabb to the fat AABB of the proxy.

-

This does not create a new instance of Aabb.

getId():Int

Returns the unique id of the proxy.

\ No newline at end of file +

This does not create a new instance of Aabb.

getId():Int

Returns the unique id of the proxy.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/ProxyPair.html b/docs/oimo/collision/broadphase/ProxyPair.html index fb6dd0e..900b844 100644 --- a/docs/oimo/collision/broadphase/ProxyPair.html +++ b/docs/oimo/collision/broadphase/ProxyPair.html @@ -1,11 +1,12 @@ -oimo.collision.broadphase.ProxyPair - OimoPhysics API documentation

A pair between two proxies. Broad-phase collision algorithms collect pairs of proxies -as linked list of ProxyPair.

Methods

getNext():ProxyPair

Returns the next pair.

getProxy1():Proxy

Returns the first proxy of the pair.

getProxy2():Proxy

Returns the second proxy of the pair.

\ No newline at end of file +} +

A pair between two proxies. Broad-phase collision algorithms collect pairs of proxies +as linked list of ProxyPair.

Methods

getNext():ProxyPair

Returns the next pair.

getProxy1():Proxy

Returns the first proxy of the pair.

getProxy2():Proxy

Returns the second proxy of the pair.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/bruteforce/BruteForceBroadPhase.html b/docs/oimo/collision/broadphase/bruteforce/BruteForceBroadPhase.html index a0b121f..a4f5d90 100644 --- a/docs/oimo/collision/broadphase/bruteforce/BruteForceBroadPhase.html +++ b/docs/oimo/collision/broadphase/bruteforce/BruteForceBroadPhase.html @@ -1,12 +1,13 @@ -oimo.collision.broadphase.bruteforce.BruteForceBroadPhase - OimoPhysics API documentation

Brute force implementation of broad-phase collision detection. Time complexity is O(n^2).

Methods

Inherited Variables

Inherited Methods

Defined by BroadPhase

inlinegetProxyPairList():ProxyPair

Returns the linked list of collected pairs of proxies.

inlinegetTestCount():Int

Returns the number of broad-phase AABB tests.

inlineisIncremental():Bool

Returns whether to collect only pairs created in the last step. If this returns +} +

Brute force implementation of broad-phase collision detection. Time complexity is O(n^2).

Methods

Inherited Variables

Inherited Methods

Defined by BroadPhase

inlinegetProxyPairList():ProxyPair

Returns the linked list of collected pairs of proxies.

inlinegetTestCount():Int

Returns the number of broad-phase AABB tests.

inlineisIncremental():Bool

Returns whether to collect only pairs created in the last step. If this returns true, the pairs that are not collected might still be overlapping. Otherwise, such pairs are guaranteed to be separated.

inlineisOverlapping(proxy1:Proxy, proxy2:Proxy):Bool

Returns whether the pair of proxy1 and proxy2 is overlapping. As proxies can be larger -than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.

\ No newline at end of file +than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/bruteforce/index.html b/docs/oimo/collision/broadphase/bruteforce/index.html index 1ae4351..2a23972 100644 --- a/docs/oimo/collision/broadphase/bruteforce/index.html +++ b/docs/oimo/collision/broadphase/bruteforce/index.html @@ -1,9 +1,10 @@ -oimo.collision.broadphase.bruteforce - OimoPhysics API documentation

oimo.collision.broadphase.bruteforce

OimoPhysics API Documentation

..
BruteForceBroadPhase

Brute force implementation of broad-phase collision detection. Time complexity is O(n^2).

\ No newline at end of file +} +

oimo.collision.broadphase.bruteforce

OimoPhysics API Documentation

..
BruteForceBroadPhase

Brute force implementation of broad-phase collision detection. Time complexity is O(n^2).

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/bvh/BvhBroadPhase.html b/docs/oimo/collision/broadphase/bvh/BvhBroadPhase.html index afd1fed..703a08b 100644 --- a/docs/oimo/collision/broadphase/bvh/BvhBroadPhase.html +++ b/docs/oimo/collision/broadphase/bvh/BvhBroadPhase.html @@ -1,14 +1,15 @@ -oimo.collision.broadphase.bvh.BvhBroadPhase - OimoPhysics API documentation

The broad-phase collision detection algorithm based on bounding volume hierarchy (BVH). +} +

The broad-phase collision detection algorithm based on bounding volume hierarchy (BVH). Average time complexity is O(NlogN) or lower.

Methods

inlinegetTreeBalance():Int

Returns the balance of the bounding volume tree.

Inherited Variables

Inherited Methods

Defined by BroadPhase

inlinegetProxyPairList():ProxyPair

Returns the linked list of collected pairs of proxies.

inlinegetTestCount():Int

Returns the number of broad-phase AABB tests.

inlineisIncremental():Bool

Returns whether to collect only pairs created in the last step. If this returns true, the pairs that are not collected might still be overlapping. Otherwise, such pairs are guaranteed to be separated.

inlineisOverlapping(proxy1:Proxy, proxy2:Proxy):Bool

Returns whether the pair of proxy1 and proxy2 is overlapping. As proxies can be larger -than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.

\ No newline at end of file +than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/bvh/index.html b/docs/oimo/collision/broadphase/bvh/index.html index 1700cb2..1d20001 100644 --- a/docs/oimo/collision/broadphase/bvh/index.html +++ b/docs/oimo/collision/broadphase/bvh/index.html @@ -1,10 +1,11 @@ -oimo.collision.broadphase.bvh - OimoPhysics API documentation

oimo.collision.broadphase.bvh

OimoPhysics API Documentation

..
BvhBroadPhase

The broad-phase collision detection algorithm based on bounding volume hierarchy (BVH). -Average time complexity is O(NlogN) or lower.

\ No newline at end of file +} +

oimo.collision.broadphase.bvh

OimoPhysics API Documentation

..
BvhBroadPhase

The broad-phase collision detection algorithm based on bounding volume hierarchy (BVH). +Average time complexity is O(NlogN) or lower.

\ No newline at end of file diff --git a/docs/oimo/collision/broadphase/index.html b/docs/oimo/collision/broadphase/index.html index 76641a9..075ada8 100644 --- a/docs/oimo/collision/broadphase/index.html +++ b/docs/oimo/collision/broadphase/index.html @@ -1,12 +1,13 @@ -oimo.collision.broadphase - OimoPhysics API documentation

oimo.collision.broadphase

OimoPhysics API Documentation

..
bruteforce
bvh
BroadPhase

The abstract class of a broad-phase collision detection algorithm.

BroadPhaseProxyCallback

A callback class for queries in a broad phase.

BroadPhaseType

Types of broad-phase algorithms.

Proxy

A proxy is an object that can be added to a broad-phase collision detection algorithm. +} +

oimo.collision.broadphase

OimoPhysics API Documentation

..
bruteforce
bvh
BroadPhase

The abstract class of a broad-phase collision detection algorithm.

BroadPhaseProxyCallback

A callback class for queries in a broad phase.

BroadPhaseType

Types of broad-phase algorithms.

Proxy

A proxy is an object that can be added to a broad-phase collision detection algorithm. Users of the collision part of the library can move an axis-aligned bounding box of a proxy through BroadPhase class.

ProxyPair

A pair between two proxies. Broad-phase collision algorithms collect pairs of proxies -as linked list of ProxyPair.

\ No newline at end of file +as linked list of ProxyPair.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/Aabb.html b/docs/oimo/collision/geometry/Aabb.html index 8268805..cf9655d 100644 --- a/docs/oimo/collision/geometry/Aabb.html +++ b/docs/oimo/collision/geometry/Aabb.html @@ -1,15 +1,16 @@ -oimo.collision.geometry.Aabb - OimoPhysics API documentation

The axis-aligned bounding box.

Constructor

new()

Creates an empty AABB. Minimum and maximum points are set to zero.

Methods

clone():Aabb

Returns a clone of the AABB.

inlinecombine(other:Aabb):Aabb

Combines other into this AABB and returns this.

inlinecombined(other:Aabb):Aabb

Returns the combined aabb of this and other.

copyFrom(aabb:Aabb):Aabb

Copies AABB from aabb to and returns this.

inlinegetCenter():Vec3

Returns the center of the AABB.

inlinegetCenterTo(center:Vec3):Void

Sets center to the center of the AABB.

+} +

The axis-aligned bounding box.

Constructor

new()

Creates an empty AABB. Minimum and maximum points are set to zero.

Methods

clone():Aabb

Returns a clone of the AABB.

inlinecombine(other:Aabb):Aabb

Combines other into this AABB and returns this.

inlinecombined(other:Aabb):Aabb

Returns the combined aabb of this and other.

copyFrom(aabb:Aabb):Aabb

Copies AABB from aabb to and returns this.

inlinegetCenter():Vec3

Returns the center of the AABB.

inlinegetCenterTo(center:Vec3):Void

Sets center to the center of the AABB.

This does not create a new instance of Vec3.

inlinegetExtents():Vec3

Returns the half extents of the AABB.

inlinegetExtentsTo(halfExtents:Vec3):Void

Sets halfExtents to the half extents of the AABB.

This does not create a new instance of Vec3.

inlinegetIntersection(other:Aabb):Aabb

Returns the intersection of this and other.

inlinegetIntersectionTo(other:Aabb, intersection:Aabb):Void

Sets intersection to the intersection of this and other.

This does not create a new instance of Aabb.

inlinegetMax():Vec3

Returns the maximum point of the axis-aligned bounding box.

inlinegetMaxTo(max:Vec3):Void

Sets the maximum point of the axis-aligned bounding box to max.

This does not create a new instance of Vec3.

inlinegetMin():Vec3

Returns the minimum point of the axis-aligned bounding box.

inlinegetMinTo(min:Vec3):Void

Sets the minimum point of the axis-aligned bounding box to min.

This does not create a new instance of Vec3.

inlineinit(min:Vec3, max:Vec3):Aabb

Sets the minimum and maximum point and returns this.

-

Equivallent to setMin(min).setMax(max).

inlineoverlap(other:Aabb):Bool

Returns whether this and other intersect.

inlinesetMax(max:Vec3):Aabb

Sets the maximum point of the axis-aligned bounding box to max and returns this.

inlinesetMin(min:Vec3):Aabb

Sets the minimum point of the axis-aligned bounding box to min and returns this.

\ No newline at end of file +

Equivallent to setMin(min).setMax(max).

inlineoverlap(other:Aabb):Bool

Returns whether this and other intersect.

inlinesetMax(max:Vec3):Aabb

Sets the maximum point of the axis-aligned bounding box to max and returns this.

inlinesetMin(min:Vec3):Aabb

Sets the minimum point of the axis-aligned bounding box to min and returns this.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/BoxGeometry.html b/docs/oimo/collision/geometry/BoxGeometry.html index 6ad5b20..56b7fac 100644 --- a/docs/oimo/collision/geometry/BoxGeometry.html +++ b/docs/oimo/collision/geometry/BoxGeometry.html @@ -1,10 +1,11 @@ -oimo.collision.geometry.BoxGeometry - OimoPhysics API documentation

A box collision geometry.

Constructor

new(halfExtents:Vec3)

Creates a box collision geometry of half-extents halfExtents.

Methods

inlinegetHalfExtents():Vec3

Returns the half-extents of the box.

inlinegetHalfExtentsTo(halfExtents:Vec3):Void

Sets halfExtents to the half-extents of the box.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +} +

A box collision geometry.

Constructor

new(halfExtents:Vec3)

Creates a box collision geometry of half-extents halfExtents.

Methods

inlinegetHalfExtents():Vec3

Returns the half-extents of the box.

inlinegetHalfExtentsTo(halfExtents:Vec3):Void

Sets halfExtents to the half-extents of the box.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

+

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/CapsuleGeometry.html b/docs/oimo/collision/geometry/CapsuleGeometry.html index 4a2b72a..43f2493 100644 --- a/docs/oimo/collision/geometry/CapsuleGeometry.html +++ b/docs/oimo/collision/geometry/CapsuleGeometry.html @@ -1,10 +1,11 @@ -oimo.collision.geometry.CapsuleGeometry - OimoPhysics API documentation

A capsule collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a capsule collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the capsule.

inlinegetRadius():Float

Returns the radius of the capsule.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +} +

A capsule collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a capsule collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the capsule.

inlinegetRadius():Float

Returns the radius of the capsule.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

+

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/ConeGeometry.html b/docs/oimo/collision/geometry/ConeGeometry.html index 990993d..89afbaf 100644 --- a/docs/oimo/collision/geometry/ConeGeometry.html +++ b/docs/oimo/collision/geometry/ConeGeometry.html @@ -1,10 +1,11 @@ -oimo.collision.geometry.ConeGeometry - OimoPhysics API documentation

A cone collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a cone collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the cone.

inlinegetRadius():Float

Returns the radius of the cone.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +} +

A cone collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a cone collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the cone.

inlinegetRadius():Float

Returns the radius of the cone.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

+

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/ConvexGeometry.html b/docs/oimo/collision/geometry/ConvexGeometry.html index 72e6e68..ac62d37 100644 --- a/docs/oimo/collision/geometry/ConvexGeometry.html +++ b/docs/oimo/collision/geometry/ConvexGeometry.html @@ -1,12 +1,13 @@ -oimo.collision.geometry.ConvexGeometry - OimoPhysics API documentation

Abstract class of the convex collision geometries supported by GJK/EPA collision detection.

Methods

computeLocalSupportingVertex(dir:Vec3, out:Vec3):Void

Computes supporting vertex of the "core" of the geometry in local coordinates. +} +

Abstract class of the convex collision geometries supported by GJK/EPA collision detection.

Methods

computeLocalSupportingVertex(dir:Vec3, out:Vec3):Void

Computes supporting vertex of the "core" of the geometry in local coordinates. Note that the direction vector dir might not be normalized. out is set to the computed supporting vertex.

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Inherited Variables

Inherited Methods

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/ConvexHullGeometry.html b/docs/oimo/collision/geometry/ConvexHullGeometry.html index ab0734c..f07123d 100644 --- a/docs/oimo/collision/geometry/ConvexHullGeometry.html +++ b/docs/oimo/collision/geometry/ConvexHullGeometry.html @@ -1,12 +1,13 @@ -oimo.collision.geometry.ConvexHullGeometry - OimoPhysics API documentation

A convex hull collision geometry. A convex hull of the vertices is the smallest convex +} +

A convex hull collision geometry. A convex hull of the vertices is the smallest convex polyhedron which contains all vertices.

Constructor

new(vertices:Array<Vec3>)

Creates a convex hull collision geometry of the vertices vertices.

Methods

inlinegetVertices():Vector<Vec3>

Returns the vertices of the convex hull.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/CylinderGeometry.html b/docs/oimo/collision/geometry/CylinderGeometry.html index efe2d04..745ec89 100644 --- a/docs/oimo/collision/geometry/CylinderGeometry.html +++ b/docs/oimo/collision/geometry/CylinderGeometry.html @@ -1,10 +1,11 @@ -oimo.collision.geometry.CylinderGeometry - OimoPhysics API documentation

A cylinder collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a cylinder collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the cylinder.

inlinegetRadius():Float

Returns the radius of the cylinder.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +} +

A cylinder collision geometry aligned with the y-axis.

Constructor

new(radius:Float, halfHeight:Float)

Creates a cylinder collision geometry of radius radius and half-height halfHeight.

Methods

inlinegetHalfHeight():Float

Returns the half-height of the cylinder.

inlinegetRadius():Float

Returns the radius of the cylinder.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

+

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/Geometry.html b/docs/oimo/collision/geometry/Geometry.html index d904104..1ef0be7 100644 --- a/docs/oimo/collision/geometry/Geometry.html +++ b/docs/oimo/collision/geometry/Geometry.html @@ -1,12 +1,13 @@ -oimo.collision.geometry.Geometry - OimoPhysics API documentation

Abstract collision geometry.

Methods

inlinegetType():Int

Returns the type of the collision geometry.

+} +

Abstract collision geometry.

Methods

inlinegetType():Int

Returns the type of the collision geometry.

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

rayCast(begin:Vec3, end:Vec3, transform:Transform, hit:RayCastHit):Bool

Performs ray casting. Returns true and sets the result information to hit if the line segment from begin to end and the geometry transformed by transform -intersect. Returns false if the line segment and the geometry do not intersect.

\ No newline at end of file +intersect. Returns false if the line segment and the geometry do not intersect.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/GeometryType.html b/docs/oimo/collision/geometry/GeometryType.html index ae71c85..b40acdb 100644 --- a/docs/oimo/collision/geometry/GeometryType.html +++ b/docs/oimo/collision/geometry/GeometryType.html @@ -1,15 +1,16 @@ -oimo.collision.geometry.GeometryType - OimoPhysics API documentation

The list of collision geometry types.

Static variables

@:value(_BOX)staticread onlyBOX:Int = _BOX

Represents a box collision geometry.

+} +

The list of collision geometry types.

Static variables

@:value(_BOX)staticread onlyBOX:Int = _BOX

Represents a box collision geometry.

See BoxGeometry.

@:value(_CAPSULE)staticread onlyCAPSULE:Int = _CAPSULE

Represents a capsule collision geometry.

See CapsuleGeometry.

@:value(_CONE)staticread onlyCONE:Int = _CONE

Represents a cone collision geometry.

See ConeGeometry.

@:value(_CONVEX_HULL)staticread onlyCONVEX_HULL:Int = _CONVEX_HULL

Represents a convex hull collision geometry.

See ConvexHullGeometry.

@:value(_CYLINDER)staticread onlyCYLINDER:Int = _CYLINDER

Represents a cylinder collision geometry.

See CylinderGeometry.

@:value(_SPHERE)staticread onlySPHERE:Int = _SPHERE

Represents a sphere collision geometry.

-

See SphereGeometry.

\ No newline at end of file +

See SphereGeometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/RayCastHit.html b/docs/oimo/collision/geometry/RayCastHit.html index bd78df9..76de6c1 100644 --- a/docs/oimo/collision/geometry/RayCastHit.html +++ b/docs/oimo/collision/geometry/RayCastHit.html @@ -1,9 +1,10 @@ -oimo.collision.geometry.RayCastHit - OimoPhysics API documentation

A single ray cast hit data.

Constructor

new()

Default constructor.

Variables

fraction:Float

The ratio of the position the ray hit from the start point to the end point.

normal:Vec3

The normal vector of the surface the ray hit.

position:Vec3

The position the ray hit at.

\ No newline at end of file +} +

A single ray cast hit data.

Constructor

new()

Default constructor.

Variables

fraction:Float

The ratio of the position the ray hit from the start point to the end point.

normal:Vec3

The normal vector of the surface the ray hit.

position:Vec3

The position the ray hit at.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/SphereGeometry.html b/docs/oimo/collision/geometry/SphereGeometry.html index 749531c..3b66c70 100644 --- a/docs/oimo/collision/geometry/SphereGeometry.html +++ b/docs/oimo/collision/geometry/SphereGeometry.html @@ -1,10 +1,11 @@ -oimo.collision.geometry.SphereGeometry - OimoPhysics API documentation

A sphere collision geometry.

Constructor

new(radius:Float)

Creates a sphere collision geometry of radius radius.

Methods

inlinegetRadius():Float

Returns the radius of the sphere.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

-

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file +} +

A sphere collision geometry.

Constructor

new(radius:Float)

Creates a sphere collision geometry of radius radius.

Methods

inlinegetRadius():Float

Returns the radius of the sphere.

Inherited Variables

Inherited Methods

Defined by ConvexGeometry

inlinegetGjkMergin():Float

Returns the GJK mergin around the "core" of the convex geometry.

inlinesetGjkMergin(gjkMergin:Float):Void

Sets the GJK mergin around the "core" to gjkMergin.

Defined by Geometry

inlinegetType():Int

Returns the type of the collision geometry.

+

See GeometryType for details.

inlinegetVolume():Float

Returns the volume of the collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/geometry/index.html b/docs/oimo/collision/geometry/index.html index 5335b18..9451207 100644 --- a/docs/oimo/collision/geometry/index.html +++ b/docs/oimo/collision/geometry/index.html @@ -1,10 +1,11 @@ -oimo.collision.geometry - OimoPhysics API documentation

oimo.collision.geometry

OimoPhysics API Documentation

..
Aabb

The axis-aligned bounding box.

BoxGeometry

A box collision geometry.

CapsuleGeometry

A capsule collision geometry aligned with the y-axis.

ConeGeometry

A cone collision geometry aligned with the y-axis.

ConvexGeometry

Abstract class of the convex collision geometries supported by GJK/EPA collision detection.

ConvexHullGeometry

A convex hull collision geometry. A convex hull of the vertices is the smallest convex -polyhedron which contains all vertices.

CylinderGeometry

A cylinder collision geometry aligned with the y-axis.

Geometry

Abstract collision geometry.

GeometryType

The list of collision geometry types.

RayCastHit

A single ray cast hit data.

SphereGeometry

A sphere collision geometry.

\ No newline at end of file +} +

oimo.collision.geometry

OimoPhysics API Documentation

..
Aabb

The axis-aligned bounding box.

BoxGeometry

A box collision geometry.

CapsuleGeometry

A capsule collision geometry aligned with the y-axis.

ConeGeometry

A cone collision geometry aligned with the y-axis.

ConvexGeometry

Abstract class of the convex collision geometries supported by GJK/EPA collision detection.

ConvexHullGeometry

A convex hull collision geometry. A convex hull of the vertices is the smallest convex +polyhedron which contains all vertices.

CylinderGeometry

A cylinder collision geometry aligned with the y-axis.

Geometry

Abstract collision geometry.

GeometryType

The list of collision geometry types.

RayCastHit

A single ray cast hit data.

SphereGeometry

A sphere collision geometry.

\ No newline at end of file diff --git a/docs/oimo/collision/index.html b/docs/oimo/collision/index.html index 16fe3bf..9df5ddb 100644 --- a/docs/oimo/collision/index.html +++ b/docs/oimo/collision/index.html @@ -1,9 +1,10 @@ -oimo.collision - OimoPhysics API documentation

oimo.collision

OimoPhysics API Documentation

..
broadphase
geometry
narrowphase
\ No newline at end of file +} +

oimo.collision

OimoPhysics API Documentation

..
broadphase
geometry
narrowphase
\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/CollisionMatrix.html b/docs/oimo/collision/narrowphase/CollisionMatrix.html index 59617b3..e5e24bb 100644 --- a/docs/oimo/collision/narrowphase/CollisionMatrix.html +++ b/docs/oimo/collision/narrowphase/CollisionMatrix.html @@ -1,12 +1,13 @@ -oimo.collision.narrowphase.CollisionMatrix - OimoPhysics API documentation

CollisionMatrix provides corresponding collision detector for a pair of +} +

CollisionMatrix provides corresponding collision detector for a pair of two geometries of given types.

Methods

inlinegetDetector(geomType1:Int, geomType2:Int):Detector

Returns an appropriate collision detector of two geometries of types geomType1 and geomType2.

-

This method is not symmetric, so getDetector(a, b) may not be equal to getDetector(b, a).

\ No newline at end of file +

This method is not symmetric, so getDetector(a, b) may not be equal to getDetector(b, a).

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/DetectorResult.html b/docs/oimo/collision/narrowphase/DetectorResult.html index 12704b5..32cff7f 100644 --- a/docs/oimo/collision/narrowphase/DetectorResult.html +++ b/docs/oimo/collision/narrowphase/DetectorResult.html @@ -1,13 +1,14 @@ -oimo.collision.narrowphase.DetectorResult - OimoPhysics API documentation

The result of narrow-phase collision detection. This is used for generating contact +} +

The result of narrow-phase collision detection. This is used for generating contact points of a contact constraint at once or incrementally.

Constructor

new()

Default constructor.

Variables

incremental:Bool

Whether the result points are to be used for incremental menifold update.

normal:Vec3

The normal vector of the contact plane.

numPoints:Int

The number of the result points.

points:Vector<DetectorResultPoint>

The result points. Note that only the first DetectorResult.numPoints points are computed by the collision detector.

Methods

inlineclear():Void

Cleans up the result data.

getMaxDepth():Float

Returns the maximum depth of the result points. Returns 0.0 if no result -points are available.

\ No newline at end of file +points are available.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/DetectorResultPoint.html b/docs/oimo/collision/narrowphase/DetectorResultPoint.html index d2c72c8..9e7f826 100644 --- a/docs/oimo/collision/narrowphase/DetectorResultPoint.html +++ b/docs/oimo/collision/narrowphase/DetectorResultPoint.html @@ -1,14 +1,15 @@ -oimo.collision.narrowphase.DetectorResultPoint - OimoPhysics API documentationoimo.collision.narrowphase.DetectorResultPoint - OimoPhysics API documentation

The result point is a pair of the closest points of collision geometries +} +

The result point is a pair of the closest points of collision geometries detected by a collision detector. This holds relative closest points for each collision geometry and the amount of the overlap.

Variables

depth:Float

The amount of the overlap. This becomes negative if two geometries are -separate.

id:Int

The identification of the result point.

position1:Vec3

The first collision geometry's closest point.

position2:Vec3

The second collision geometry's closest point.

\ No newline at end of file +separate.

id:Int

The identification of the result point.

position1:Vec3

The first collision geometry's closest point.

position2:Vec3

The second collision geometry's closest point.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/BoxBoxDetector.html b/docs/oimo/collision/narrowphase/detector/BoxBoxDetector.html index e2456ca..4b33cdd 100644 --- a/docs/oimo/collision/narrowphase/detector/BoxBoxDetector.html +++ b/docs/oimo/collision/narrowphase/detector/BoxBoxDetector.html @@ -1,11 +1,12 @@ -oimo.collision.narrowphase.detector.BoxBoxDetector - OimoPhysics API documentation

Box vs Box detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms +} +

Box vs Box detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/CapsuleCapsuleDetector.html b/docs/oimo/collision/narrowphase/detector/CapsuleCapsuleDetector.html index 089273a..315e840 100644 --- a/docs/oimo/collision/narrowphase/detector/CapsuleCapsuleDetector.html +++ b/docs/oimo/collision/narrowphase/detector/CapsuleCapsuleDetector.html @@ -1,11 +1,12 @@ -oimo.collision.narrowphase.detector.CapsuleCapsuleDetector - OimoPhysics API documentation

Capsule vs Capsule detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms +} +

Capsule vs Capsule detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/Detector.html b/docs/oimo/collision/narrowphase/detector/Detector.html index c415f22..19aa8be 100644 --- a/docs/oimo/collision/narrowphase/detector/Detector.html +++ b/docs/oimo/collision/narrowphase/detector/Detector.html @@ -1,11 +1,12 @@ -oimo.collision.narrowphase.detector.Detector - OimoPhysics API documentation

Interface of a collision detector for narrow-phase collision detection.

Methods

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms +} +

Interface of a collision detector for narrow-phase collision detection.

Methods

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/GjkEpaDetector.html b/docs/oimo/collision/narrowphase/detector/GjkEpaDetector.html index 11d383c..dccc52f 100644 --- a/docs/oimo/collision/narrowphase/detector/GjkEpaDetector.html +++ b/docs/oimo/collision/narrowphase/detector/GjkEpaDetector.html @@ -1,11 +1,12 @@ -oimo.collision.narrowphase.detector.GjkEpaDetector - OimoPhysics API documentation

General convex collision detector using GJK/EPA

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms +} +

General convex collision detector using GJK/EPA

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/SphereBoxDetector.html b/docs/oimo/collision/narrowphase/detector/SphereBoxDetector.html index a872627..6f05047 100644 --- a/docs/oimo/collision/narrowphase/detector/SphereBoxDetector.html +++ b/docs/oimo/collision/narrowphase/detector/SphereBoxDetector.html @@ -1,13 +1,14 @@ -oimo.collision.narrowphase.detector.SphereBoxDetector - OimoPhysics API documentation

Sphere vs Box collision detector.

Constructor

new(swapped:Bool)

If swapped is true, the collision detector expects BoxGeometry and SphereGeometry for the +} +

Sphere vs Box collision detector.

Constructor

new(swapped:Bool)

If swapped is true, the collision detector expects BoxGeometry and SphereGeometry for the first and second argument of SphereBoxDetector.detect. If swapped is false, the collision detector expects SphereGeometry and BoxGeometry instead.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/SphereCapsuleDetector.html b/docs/oimo/collision/narrowphase/detector/SphereCapsuleDetector.html index 936bcac..97174f1 100644 --- a/docs/oimo/collision/narrowphase/detector/SphereCapsuleDetector.html +++ b/docs/oimo/collision/narrowphase/detector/SphereCapsuleDetector.html @@ -1,13 +1,14 @@ -oimo.collision.narrowphase.detector.SphereCapsuleDetector - OimoPhysics API documentation

Sphere vs Capsule detector.

Constructor

new(swapped:Bool)

If swapped is true, the collision detector expects CapsuleGeometry and SphereGeometry for the +} +

Sphere vs Capsule detector.

Constructor

new(swapped:Bool)

If swapped is true, the collision detector expects CapsuleGeometry and SphereGeometry for the first and second argument of SphereCapsuleDetector.detect. If swapped is false, the collision detector expects SphereGeometry and CapsuleGeometry instead.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/SphereSphereDetector.html b/docs/oimo/collision/narrowphase/detector/SphereSphereDetector.html index 8e3731f..99689df 100644 --- a/docs/oimo/collision/narrowphase/detector/SphereSphereDetector.html +++ b/docs/oimo/collision/narrowphase/detector/SphereSphereDetector.html @@ -1,11 +1,12 @@ -oimo.collision.narrowphase.detector.SphereSphereDetector - OimoPhysics API documentation

Sphere vs Sphere detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms +} +

Sphere vs Sphere detector.

Constructor

new()

Default constructor.

Inherited Variables

Inherited Methods

Defined by Detector

detect(result:DetectorResult, geom1:Geometry, geom2:Geometry, transform1:Transform, transform2:Transform, cachedData:CachedDetectorData):Void

Computes the contact manifold of two collision geometries geom1 and geom2 with the transforms transform1 and transform2, and stores it to result. cachedData is used to improve performance -of collision detection in some detectors.

\ No newline at end of file +of collision detection in some detectors.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpa.html b/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpa.html index 714f7c7..15d54e0 100644 --- a/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpa.html +++ b/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpa.html @@ -1,12 +1,13 @@ -oimo.collision.narrowphase.detector.gjkepa.GjkEpa - OimoPhysics API documentation

GJK algorithm and EPA for narrow-phase collision detection.

Static methods

staticinlinegetInstance():GjkEpa

Returns an instance of GjkEpa.

Constructor

new()

Default constructor. Consider using GjkEpa.getInstance instead of creating a new +} +

GJK algorithm and EPA for narrow-phase collision detection.

Static methods

staticinlinegetInstance():GjkEpa

Returns an instance of GjkEpa.

Constructor

new()

Default constructor. Consider using GjkEpa.getInstance instead of creating a new instance.

Variables

closestPoint1:Vec3

Computed closest point of the first geometry in world coordinate system.

closestPoint2:Vec3

Computed closest point of the second geometry in world coordinate system.

distance:Float

Computed distance between two geometries. This value may be negative if two geometries are overlapping.

Methods

inlinecomputeClosestPoints(c1:ConvexGeometry, c2:ConvexGeometry, tf1:Transform, tf2:Transform, cache:CachedDetectorData):Int

Computes the closest points of two convex geometries c1 and c2 with transforms tf1 and tf2 respectively, and returns the status of the result (see GjkEpaResultState for details). If cached @@ -23,4 +24,4 @@

Set the compiler option OIMO_GJK_EPA_DEBUG for debugging (warning: massive logging).

rayCast(c:ConvexGeometry, tf:Transform, begin:Vec3, end:Vec3, hit:RayCastHit):Bool

Performs ray cansting against the convex geometry c with transform tf. Returns true and sets the result information to hit if the line segment from begin to end intersects the convex geometry. Otherwise returns false.

-

Set the compiler option OIMO_GJK_EPA_DEBUG for debugging (warning: massive logging).

\ No newline at end of file +

Set the compiler option OIMO_GJK_EPA_DEBUG for debugging (warning: massive logging).

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpaResultState.html b/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpaResultState.html index 40c40a8..cc79be3 100644 --- a/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpaResultState.html +++ b/docs/oimo/collision/narrowphase/detector/gjkepa/GjkEpaResultState.html @@ -1,9 +1,10 @@ -oimo.collision.narrowphase.detector.gjkepa.GjkEpaResultState - OimoPhysics API documentation

The list of the state of a result of GjkEpa.computeClosestPoints.

Static variables

@:value(_EPA_DID_NOT_CONVERGE)staticread onlyEPA_DID_NOT_CONVERGE:Int = _EPA_DID_NOT_CONVERGE

EPA iterations did not converge in time.

@:value(_EPA_FAILED_TO_ADD_VERTEX)staticread onlyEPA_FAILED_TO_ADD_VERTEX:Int = _EPA_FAILED_TO_ADD_VERTEX

Failed to add a new vertex to the polyhedron in EPA computation.

@:value(_EPA_FAILED_TO_INIT)staticread onlyEPA_FAILED_TO_INIT:Int = _EPA_FAILED_TO_INIT

Failed to construct initial polyhedron in EPA construction.

@:value(_GJK_DID_NOT_CONVERGE)staticread onlyGJK_DID_NOT_CONVERGE:Int = _GJK_DID_NOT_CONVERGE

GJK iterations did not converge in time.

@:value(_GJK_FAILED_TO_MAKE_TETRAHEDRON)staticread onlyGJK_FAILED_TO_MAKE_TETRAHEDRON:Int = _GJK_FAILED_TO_MAKE_TETRAHEDRON

Failed to construct a tetrahedron enclosing the origin in GJK computation.

@:value(_SUCCEEDED)staticread onlySUCCEEDED:Int = _SUCCEEDED

GJK/EPA computation is successfully finished.

\ No newline at end of file +} +

The list of the state of a result of GjkEpa.computeClosestPoints.

Static variables

@:value(_EPA_DID_NOT_CONVERGE)staticread onlyEPA_DID_NOT_CONVERGE:Int = _EPA_DID_NOT_CONVERGE

EPA iterations did not converge in time.

@:value(_EPA_FAILED_TO_ADD_VERTEX)staticread onlyEPA_FAILED_TO_ADD_VERTEX:Int = _EPA_FAILED_TO_ADD_VERTEX

Failed to add a new vertex to the polyhedron in EPA computation.

@:value(_EPA_FAILED_TO_INIT)staticread onlyEPA_FAILED_TO_INIT:Int = _EPA_FAILED_TO_INIT

Failed to construct initial polyhedron in EPA construction.

@:value(_GJK_DID_NOT_CONVERGE)staticread onlyGJK_DID_NOT_CONVERGE:Int = _GJK_DID_NOT_CONVERGE

GJK iterations did not converge in time.

@:value(_GJK_FAILED_TO_MAKE_TETRAHEDRON)staticread onlyGJK_FAILED_TO_MAKE_TETRAHEDRON:Int = _GJK_FAILED_TO_MAKE_TETRAHEDRON

Failed to construct a tetrahedron enclosing the origin in GJK computation.

@:value(_SUCCEEDED)staticread onlySUCCEEDED:Int = _SUCCEEDED

GJK/EPA computation is successfully finished.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/gjkepa/SimplexUtil.html b/docs/oimo/collision/narrowphase/detector/gjkepa/SimplexUtil.html index e67aa76..5cdd39c 100644 --- a/docs/oimo/collision/narrowphase/detector/gjkepa/SimplexUtil.html +++ b/docs/oimo/collision/narrowphase/detector/gjkepa/SimplexUtil.html @@ -1,12 +1,13 @@ -oimo.collision.narrowphase.detector.gjkepa.SimplexUtil - OimoPhysics API documentation

Simplex utilities for GJK/EPA computations.

Static methods

staticinlineprojectOrigin2(vec1:Vec3, vec2:Vec3, out:Vec3):Int

Sets out to the minimum length point on the line (vec1, vec2) +} +

Simplex utilities for GJK/EPA computations.

Static methods

staticinlineprojectOrigin2(vec1:Vec3, vec2:Vec3, out:Vec3):Int

Sets out to the minimum length point on the line (vec1, vec2) and returns the index of the voronoi region.

staticinlineprojectOrigin3(vec1:Vec3, vec2:Vec3, vec3:Vec3, out:Vec3):Int

Sets out to the minimum length point on the triangle (vec1, vec2, vec3) and returns the index of the voronoi region.

staticinlineprojectOrigin4(vec1:Vec3, vec2:Vec3, vec3:Vec3, vec4:Vec3, out:Vec3):Int

Sets out to the minimum length point on the tetrahedron (vec1, vec2, vec3, vec4) -and returns the index of the voronoi region.

\ No newline at end of file +and returns the index of the voronoi region.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/gjkepa/index.html b/docs/oimo/collision/narrowphase/detector/gjkepa/index.html index 399962e..7737e17 100644 --- a/docs/oimo/collision/narrowphase/detector/gjkepa/index.html +++ b/docs/oimo/collision/narrowphase/detector/gjkepa/index.html @@ -1,9 +1,10 @@ -oimo.collision.narrowphase.detector.gjkepa - OimoPhysics API documentation

oimo.collision.narrowphase.detector.gjkepa

OimoPhysics API Documentation

..
GjkEpa

GJK algorithm and EPA for narrow-phase collision detection.

GjkEpaResultState

The list of the state of a result of GjkEpa.computeClosestPoints.

SimplexUtil

Simplex utilities for GJK/EPA computations.

\ No newline at end of file +} +

oimo.collision.narrowphase.detector.gjkepa

OimoPhysics API Documentation

..
GjkEpa

GJK algorithm and EPA for narrow-phase collision detection.

GjkEpaResultState

The list of the state of a result of GjkEpa.computeClosestPoints.

SimplexUtil

Simplex utilities for GJK/EPA computations.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/detector/index.html b/docs/oimo/collision/narrowphase/detector/index.html index b5c0afe..f056a7a 100644 --- a/docs/oimo/collision/narrowphase/detector/index.html +++ b/docs/oimo/collision/narrowphase/detector/index.html @@ -1,9 +1,10 @@ -oimo.collision.narrowphase.detector - OimoPhysics API documentation

oimo.collision.narrowphase.detector

OimoPhysics API Documentation

..
gjkepa
BoxBoxDetector

Box vs Box detector.

CapsuleCapsuleDetector

Capsule vs Capsule detector.

Detector

Interface of a collision detector for narrow-phase collision detection.

GjkEpaDetector

General convex collision detector using GJK/EPA

SphereBoxDetector

Sphere vs Box collision detector.

SphereCapsuleDetector

Sphere vs Capsule detector.

SphereSphereDetector

Sphere vs Sphere detector.

\ No newline at end of file +} +

oimo.collision.narrowphase.detector

OimoPhysics API Documentation

..
gjkepa
BoxBoxDetector

Box vs Box detector.

CapsuleCapsuleDetector

Capsule vs Capsule detector.

Detector

Interface of a collision detector for narrow-phase collision detection.

GjkEpaDetector

General convex collision detector using GJK/EPA

SphereBoxDetector

Sphere vs Box collision detector.

SphereCapsuleDetector

Sphere vs Capsule detector.

SphereSphereDetector

Sphere vs Sphere detector.

\ No newline at end of file diff --git a/docs/oimo/collision/narrowphase/index.html b/docs/oimo/collision/narrowphase/index.html index 8be5a96..6340239 100644 --- a/docs/oimo/collision/narrowphase/index.html +++ b/docs/oimo/collision/narrowphase/index.html @@ -1,13 +1,14 @@ -oimo.collision.narrowphase - OimoPhysics API documentation

oimo.collision.narrowphase

OimoPhysics API Documentation

..
detector
CollisionMatrix

CollisionMatrix provides corresponding collision detector for a pair of +} +

oimo.collision.narrowphase

OimoPhysics API Documentation

..
detector
CollisionMatrix

CollisionMatrix provides corresponding collision detector for a pair of two geometries of given types.

DetectorResult

The result of narrow-phase collision detection. This is used for generating contact points of a contact constraint at once or incrementally.

DetectorResultPoint

The result point is a pair of the closest points of collision geometries detected by a collision detector. This holds relative closest points for -each collision geometry and the amount of the overlap.

\ No newline at end of file +each collision geometry and the amount of the overlap.

\ No newline at end of file diff --git a/docs/oimo/common/Mat3.html b/docs/oimo/common/Mat3.html index c9726c8..f659cf1 100644 --- a/docs/oimo/common/Mat3.html +++ b/docs/oimo/common/Mat3.html @@ -1,12 +1,13 @@ -oimo.common.Mat3 - OimoPhysics API documentation

3x3 Matrix class.

+} +

3x3 Matrix class.

Note that columns and rows are 0-indexed.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ e22 : 1, e21 : 0, e20 : 0, e12 : 0, e11 : 1, e10 : 0, e02 : 0, e01 : 0, e00 : 1 })inlinenew(e00:Float = 1, e01:Float = 0, e02:Float = 0, e10:Float = 0, e11:Float = 1, e12:Float = 0, e20:Float = 0, e21:Float = 0, e22:Float = 1)

Creates a new matrix. The matrix is identity by default.

Variables

e00:Float

The element at row 0 column 0.

e01:Float

The element at row 0 column 1.

e02:Float

The element at row 0 column 2.

e10:Float

The element at row 1 column 0.

e11:Float

The element at row 1 column 1.

e12:Float

The element at row 1 column 2.

e20:Float

The element at row 2 column 0.

e21:Float

The element at row 2 column 1.

e22:Float

The element at row 2 column 2.

Methods

inlineadd(m:Mat3):Mat3

Returns this + m

inlineaddEq(m:Mat3):Mat3

Sets this matrix to this + m and returns this.

inlineappendRotation(rad:Float, axisX:Float, axisY:Float, axisZ:Float):Mat3

Returns this * rotation matrix.

Where rotation matrix is a matrix which rotates rad in radians around the normalized vector (axisX, axisY, axisZ).

inlineappendRotationEq(rad:Float, axisX:Float, axisY:Float, axisZ:Float):Mat3

Sets this matrix to this * rotation matrix, and returns this.

@@ -35,4 +36,4 @@ Otherwise, the array is arranged in row-major order.

inlinetoEulerXyz():Vec3

Returns a vector (angleX, angleY, angleZ) represents the Euler angles of this matrix. Rotation order is first X-axis, then rotated Y-axis, finally rotated Z-axis. Note that angleX, angleY, and angleZ are in range of -PI to PI, -PI/2 to PI/2, and -PI to PI respectively.

inlinetoQuat():Quat

Returns a quaternion which represents this matrix.

-

This matrix must be a rotation matrix, that is, must be orthogonalized and have determinant 1.

toString():String

Returns the string representation of the matrix.

inlinetrace():Float

Returns the trace.

inlinetranspose():Mat3

Returns the transposed matrix.

inlinetransposeEq():Mat3

Sets this matrix to the transposed matrix and returns this.

\ No newline at end of file +

This matrix must be a rotation matrix, that is, must be orthogonalized and have determinant 1.

toString():String

Returns the string representation of the matrix.

inlinetrace():Float

Returns the trace.

inlinetranspose():Mat3

Returns the transposed matrix.

inlinetransposeEq():Mat3

Sets this matrix to the transposed matrix and returns this.

\ No newline at end of file diff --git a/docs/oimo/common/Mat4.html b/docs/oimo/common/Mat4.html index ced92a4..dd52f28 100644 --- a/docs/oimo/common/Mat4.html +++ b/docs/oimo/common/Mat4.html @@ -1,12 +1,13 @@ -oimo.common.Mat4 - OimoPhysics API documentation

4x4 Matrix class.

+} +

4x4 Matrix class.

Note that columns and rows are 0-indexed.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ e33 : 1, e32 : 0, e31 : 0, e30 : 0, e23 : 0, e22 : 1, e21 : 0, e20 : 0, e13 : 0, e12 : 0, e11 : 1, e10 : 0, e03 : 0, e02 : 0, e01 : 0, e00 : 1 })inlinenew(e00:Float = 1, e01:Float = 0, e02:Float = 0, e03:Float = 0, e10:Float = 0, e11:Float = 1, e12:Float = 0, e13:Float = 0, e20:Float = 0, e21:Float = 0, e22:Float = 1, e23:Float = 0, e30:Float = 0, e31:Float = 0, e32:Float = 0, e33:Float = 1)

Creates a new matrix. The matrix is identity by default.

Variables

e00:Float

The element at row 0 column 0.

e01:Float

The element at row 0 column 1.

e02:Float

The element at row 0 column 2.

e03:Float

The element at row 0 column 3.

e10:Float

The element at row 1 column 0.

e11:Float

The element at row 1 column 1.

e12:Float

The element at row 1 column 2.

e13:Float

The element at row 1 column 3.

e20:Float

The element at row 2 column 0.

e21:Float

The element at row 2 column 1.

e22:Float

The element at row 2 column 2.

e23:Float

The element at row 2 column 3.

e30:Float

The element at row 3 column 0.

e31:Float

The element at row 3 column 1.

e32:Float

The element at row 3 column 2.

e33:Float

The element at row 3 column 3.

Methods

inlineadd(m:Mat4):Mat4

Returns this + m

inlineaddEq(m:Mat4):Mat4

Sets this matrix to this + m and returns this.

inlineappendRotation(rad:Float, axisX:Float, axisY:Float, axisZ:Float):Mat4

Returns this * rotation matrix.

Where rotation matrix is a matrix which rotates rad in radians around the normalized vector (axisX, axisY, axisZ).

inlineappendRotationEq(rad:Float, axisX:Float, axisY:Float, axisZ:Float):Mat4

Sets this matrix to this * rotation matrix, and returns this.

@@ -45,4 +46,4 @@

Where translation matrix is a matrix which translates sx, sy and sz along the x-axis, y-axis and z-axis respectively.

inlinescale(s:Float):Mat4

Returns this * s

inlinescaleEq(s:Float):Mat4

Sets this matrix to this * s and returns this.

inlinesub(m:Mat4):Mat4

Returns this - m

inlinesubEq(m:Mat4):Mat4

Sets this matrix to this - m and returns this.

@:value({ columnMajor : false })inlinetoArray(columnMajor:Bool = false):Array<Float>

Returns an array of the elements of this matrix.

If columnMajor is true, the array is arranged in column-major order. -Otherwise, the array is arranged in row-major order.

toString():String

Returns the string representation of the matrix.

inlinetrace():Float

Returns the trace.

inlinetranspose():Mat4

Returns the transposed matrix.

inlinetransposeEq():Mat4

Sets this matrix to the transposed matrix and returns this.

\ No newline at end of file +Otherwise, the array is arranged in row-major order.

toString():String

Returns the string representation of the matrix.

inlinetrace():Float

Returns the trace.

inlinetranspose():Mat4

Returns the transposed matrix.

inlinetransposeEq():Mat4

Sets this matrix to the transposed matrix and returns this.

\ No newline at end of file diff --git a/docs/oimo/common/MathUtil.html b/docs/oimo/common/MathUtil.html index cd8f989..9d59716 100644 --- a/docs/oimo/common/MathUtil.html +++ b/docs/oimo/common/MathUtil.html @@ -1,11 +1,12 @@ -oimo.common.MathUtil - OimoPhysics API documentation

This class provides mathematical operations for internal purposes.

Static variables

@:value(PI / 2)staticinlineread onlyHALF_PI:Float = PI / 2

Shorthand for PI / 2.

@:value(-1e65536)staticinlineread onlyNEGATIVE_INFINITY:Float = -1e65536

Negative infinity.

@:value(3.14159265358979)staticinlineread onlyPI:Float = 3.14159265358979

The ratio of the circumference of a circle to its diameter.

@:value(1e65536)staticinlineread onlyPOSITIVE_INFINITY:Float = 1e65536

Positive infinity.

@:value(180 / PI)staticinlineread onlyTO_DEGREES:Float = 180 / PI

Shorthand for 180 / PI.

@:value(PI / 180)staticinlineread onlyTO_RADIANS:Float = PI / 180

Shorthand for PI / 180.

@:value(PI * 2)staticinlineread onlyTWO_PI:Float = PI * 2

Shorthand for PI * 2.

Static methods

staticinlineabs(x:Float):Float

Returns the absolute value of x.

staticinlineacos(x:Float):Float

Returns Math.acos(x).

staticinlineasin(x:Float):Float

Returns Math.asin(x).

staticinlineatan(x:Float):Float

Returns Math.atan(x).

staticinlineatan2(y:Float, x:Float):Float

Returns Math.atan2(y, x)

staticinlineclamp(x:Float, min:Float, max:Float):Float

Returns a clamped value of x from min to max.

staticinlinecos(x:Float):Float

Returns Math.cos(x).

staticinlinerand():Float

Returns Math.random().

staticinlinerandIn(min:Float, max:Float):Float

Returns a random value from min inclusive to max exclusive.

staticinlinerandVec3():Vec3

Returns a random Vec3 from (-1.0, -1.0, -1.0) inclusive to (1.0, 1.0, 1.0) exclusive.

staticinlinerandVec3In(min:Float, max:Float):Vec3

Returns a random Vec3 from (min, min, min) inclusive to (max, max, max) exclusive.

staticinlinesafeAcos(x:Float):Float

Returns Math.acos(clamp(-1, x, 1)). +} +

This class provides mathematical operations for internal purposes.

Static variables

@:value(PI / 2)staticinlineread onlyHALF_PI:Float = PI / 2

Shorthand for PI / 2.

@:value(-1e65536)staticinlineread onlyNEGATIVE_INFINITY:Float = -1e65536

Negative infinity.

@:value(3.14159265358979)staticinlineread onlyPI:Float = 3.14159265358979

The ratio of the circumference of a circle to its diameter.

@:value(1e65536)staticinlineread onlyPOSITIVE_INFINITY:Float = 1e65536

Positive infinity.

@:value(180 / PI)staticinlineread onlyTO_DEGREES:Float = 180 / PI

Shorthand for 180 / PI.

@:value(PI / 180)staticinlineread onlyTO_RADIANS:Float = PI / 180

Shorthand for PI / 180.

@:value(PI * 2)staticinlineread onlyTWO_PI:Float = PI * 2

Shorthand for PI * 2.

Static methods

staticinlineabs(x:Float):Float

Returns the absolute value of x.

staticinlineacos(x:Float):Float

Returns Math.acos(x).

staticinlineasin(x:Float):Float

Returns Math.asin(x).

staticinlineatan(x:Float):Float

Returns Math.atan(x).

staticinlineatan2(y:Float, x:Float):Float

Returns Math.atan2(y, x)

staticinlineclamp(x:Float, min:Float, max:Float):Float

Returns a clamped value of x from min to max.

staticinlinecos(x:Float):Float

Returns Math.cos(x).

staticinlinerand():Float

Returns Math.random().

staticinlinerandIn(min:Float, max:Float):Float

Returns a random value from min inclusive to max exclusive.

staticinlinerandVec3():Vec3

Returns a random Vec3 from (-1.0, -1.0, -1.0) inclusive to (1.0, 1.0, 1.0) exclusive.

staticinlinerandVec3In(min:Float, max:Float):Vec3

Returns a random Vec3 from (min, min, min) inclusive to (max, max, max) exclusive.

staticinlinesafeAcos(x:Float):Float

Returns Math.acos(clamp(-1, x, 1)). This never returns NaN as long as x is not NaN.

staticinlinesafeAsin(x:Float):Float

Returns Math.asin(clamp(-1, x, 1)). -This never returns NaN as long as x is not NaN.

staticinlinesin(x:Float):Float

Returns Math.sin(x).

staticinlinesqrt(x:Float):Float

Returns Math.sqrt(x).

staticinlinetan(x:Float):Float

Returns Math.tan(x).

\ No newline at end of file +This never returns NaN as long as x is not NaN.

staticinlinesin(x:Float):Float

Returns Math.sin(x).

staticinlinesqrt(x:Float):Float

Returns Math.sqrt(x).

staticinlinetan(x:Float):Float

Returns Math.tan(x).

\ No newline at end of file diff --git a/docs/oimo/common/Pool.html b/docs/oimo/common/Pool.html index 9f01c1b..eb18f8a 100644 --- a/docs/oimo/common/Pool.html +++ b/docs/oimo/common/Pool.html @@ -1,13 +1,14 @@ -oimo.common.Pool - OimoPhysics API documentation

The object pool system of Vec3, Mat3, Mat4, and Quat.

Constructor

new()

Default constructor.

Methods

inlinedispose(?vec3:Vec3, ?mat3:Mat3, ?mat4:Mat4, ?quat:Quat):Void

Disposes an object got from Pool.vec3, Pool.mat3, Pool.mat4, or Pool.quat.

inlinedisposeMat3(m:Mat3):Void

Disposes an Mat3 object got from Pool.mat3.

inlinedisposeMat4(m:Mat4):Void

Disposes an Mat4 object got from Pool.mat4.

inlinedisposeQuat(q:Quat):Void

Disposes an Quat object got from Pool.quat.

inlinedisposeVec3(v:Vec3):Void

Disposes an Vec3 object got from Pool.vec3.

inlinemat3():Mat3

Returns a Mat3 object. If an unused object of Mat3 is pooled, this does +} +

The object pool system of Vec3, Mat3, Mat4, and Quat.

Constructor

new()

Default constructor.

Methods

inlinedispose(?vec3:Vec3, ?mat3:Mat3, ?mat4:Mat4, ?quat:Quat):Void

Disposes an object got from Pool.vec3, Pool.mat3, Pool.mat4, or Pool.quat.

inlinedisposeMat3(m:Mat3):Void

Disposes an Mat3 object got from Pool.mat3.

inlinedisposeMat4(m:Mat4):Void

Disposes an Mat4 object got from Pool.mat4.

inlinedisposeQuat(q:Quat):Void

Disposes an Quat object got from Pool.quat.

inlinedisposeVec3(v:Vec3):Void

Disposes an Vec3 object got from Pool.vec3.

inlinemat3():Mat3

Returns a Mat3 object. If an unused object of Mat3 is pooled, this does not create a new instance.

inlinemat4():Mat4

Returns a Mat4 object. If an unused object of Vec3 is pooled, this does not create a new instance.

inlinequat():Quat

Returns a Quat object. If an unused object of Quat is pooled, this does not create a new instance.

inlinevec3():Vec3

Returns a Vec3 object. If an unused object of Vec3 is pooled, this does -not create a new instance.

\ No newline at end of file +not create a new instance.

\ No newline at end of file diff --git a/docs/oimo/common/Quat.html b/docs/oimo/common/Quat.html index 2726ddc..0b5f58d 100644 --- a/docs/oimo/common/Quat.html +++ b/docs/oimo/common/Quat.html @@ -1,14 +1,15 @@ -oimo.common.Quat - OimoPhysics API documentation

Quaternion class.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ w : 1, z : 0, y : 0, x : 0 })inlinenew(x:Float = 0, y:Float = 0, z:Float = 0, w:Float = 1)

Creates a new quaternion. The quaternion is identity by default.

Variables

w:Float

The real part of the quaternion.

x:Float

The x-value of the imaginary part of the quaternion.

y:Float

The y-value of the imaginary part of the quaternion.

z:Float

The z-value of the imaginary part of the quaternion.

Methods

inlineadd(q:Quat):Quat

Returns this + v.

inlineaddEq(q:Quat):Quat

Sets this quaternion to this + v and returns this.

inlineclone():Quat

Returns a clone of the quaternion.

inlinecopyFrom(q:Quat):Quat

Copies values from q and returns this.

inlinedot(q:Quat):Float

Returns the dot product of this and q.

inlinefromMat3(m:Mat3):Quat

Sets this quaternion to the representation of the matrix m, and returns this.

+} +

Quaternion class.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ w : 1, z : 0, y : 0, x : 0 })inlinenew(x:Float = 0, y:Float = 0, z:Float = 0, w:Float = 1)

Creates a new quaternion. The quaternion is identity by default.

Variables

w:Float

The real part of the quaternion.

x:Float

The x-value of the imaginary part of the quaternion.

y:Float

The y-value of the imaginary part of the quaternion.

z:Float

The z-value of the imaginary part of the quaternion.

Methods

inlineadd(q:Quat):Quat

Returns this + v.

inlineaddEq(q:Quat):Quat

Sets this quaternion to this + v and returns this.

inlineclone():Quat

Returns a clone of the quaternion.

inlinecopyFrom(q:Quat):Quat

Copies values from q and returns this.

inlinedot(q:Quat):Float

Returns the dot product of this and q.

inlinefromMat3(m:Mat3):Quat

Sets this quaternion to the representation of the matrix m, and returns this.

The matrix m must be a rotation matrix, that is, must be orthogonalized and have determinant 1.

inlineidentity():Quat

Sets the quaternion to identity quaternion and returns this.

inlineinit(x:Float, y:Float, z:Float, w:Float):Quat

Sets all values at once and returns this.

inlinelength():Float

Returns the length of the quaternion.

inlinelengthSq():Float

Returns the squared length of the quaternion.

inlinenormalize():Quat

Sets this quaternion to the normalized quaternion and returns this.

If the length is zero, this quaternion is set to zero quaternion.

inlinenormalized():Quat

Returns the normalized quaternion.

If the length is zero, zero quaterinon is returned.

inlinescale(s:Float):Quat

Returns this * s.

inlinescaleEq(s:Float):Quat

Sets this quaternion to this * s and returns this.

setArc(v1:Vec3, v2:Vec3):Quat

Sets this quaternion to the quaternion representing the shortest arc rotation from v1 to v2, and return this.

slerp(q:Quat, t:Float):Quat

Returns the spherical linear interpolation between two quaternions this and q with interpolation paraeter t. -Both quaternions this and q must be normalized.

inlinesub(q:Quat):Quat

Returns this - v.

inlinesubEq(q:Quat):Quat

Sets this quaternion to this - v and returns this.

inlinetoMat3():Mat3

Returns a rotation matrix which represents this quaternion.

inlinetoString():String

Returns the string representation of the quaternion.

\ No newline at end of file +Both quaternions this and q must be normalized.

inlinesub(q:Quat):Quat

Returns this - v.

inlinesubEq(q:Quat):Quat

Sets this quaternion to this - v and returns this.

inlinetoMat3():Mat3

Returns a rotation matrix which represents this quaternion.

inlinetoString():String

Returns the string representation of the quaternion.

\ No newline at end of file diff --git a/docs/oimo/common/Setting.html b/docs/oimo/common/Setting.html index dfce131..cce8089 100644 --- a/docs/oimo/common/Setting.html +++ b/docs/oimo/common/Setting.html @@ -1,9 +1,10 @@ -oimo.common.Setting - OimoPhysics API documentation

Setting provides advenced parameters used by the physics simulation.

Static variables

@:value(PositionCorrectionAlgorithm._SPLIT_IMPULSE)staticalternativeContactPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._SPLIT_IMPULSE

@:value(1 * MathUtil.TO_RADIANS)staticangularSlop:Float = 1 * MathUtil.TO_RADIANS

@:value(0.45)staticbvhIncrementalCollisionThreshold:Float = 0.45

@:value(0.1)staticbvhProxyPadding:Float = 0.1

@:value(0.5)staticcontactEnableBounceThreshold:Float = 0.5

@:value(0.05)staticcontactPersistenceThreshold:Float = 0.05

@:value(1)staticdefaultCollisionGroup:Int = 1

@:value(1)staticdefaultCollisionMask:Int = 1

@:value(PositionCorrectionAlgorithm._BAUMGARTE)staticdefaultContactPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._BAUMGARTE

@:value(1)staticdefaultDensity:Float = 1

@:value(0.2)staticdefaultFriction:Float = 0.2

@:value(0.05)staticdefaultGJKMargin:Float = 0.05

@:value(ConstraintSolverType._ITERATIVE)staticdefaultJointConstraintSolverType:Int = ConstraintSolverType._ITERATIVE

@:value(PositionCorrectionAlgorithm._BAUMGARTE)staticdefaultJointPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._BAUMGARTE

@:value(0.2)staticdefaultRestitution:Float = 0.2

@:value(1e-9)staticdirectMlcpSolverEps:Float = 1e-9

@:value(false)staticdisableSleeping:Bool = false

@:value(true)staticenableGJKCaching:Bool = true

@:value(128)staticislandInitialConstraintArraySize:Int = 128

@:value(128)staticislandInitialRigidBodyArraySize:Int = 128

@:value(0.95)staticjointWarmStartingFactor:Float = 0.95

@:value(0.8)staticjointWarmStartingFactorForBaungarte:Float = 0.8

@:value(0.005)staticlinearSlop:Float = 0.005

@:value(128)staticmaxEPAPolyhedronFaces:Int = 128

@:value(128)staticmaxEPAVertices:Int = 128

@:value(6)staticmaxJacobianRows:Int = 6

@:value(4)staticmaxManifoldPoints:Int = 4

@:value(MathUtil.PI)staticmaxRotationPerStep:Float = MathUtil.PI

@:value(20)staticmaxTranslationPerStep:Float = 20

@:value(1e-6)staticminRagdollMaxSwingAngle:Float = 1e-6

@:value(1e-6)staticminSpringDamperDampingRatio:Float = 1e-6

@:value(1.0)staticpositionNgsBaumgarte:Float = 1.0

@:value(0.4)staticpositionSplitImpulseBaumgarte:Float = 0.4

@:value(0.5)staticsleepingAngularVelocityThreshold:Float = 0.5

@:value(1.0)staticsleepingTimeThreshold:Float = 1.0

@:value(0.2)staticsleepingVelocityThreshold:Float = 0.2

@:value(0.2)staticvelocityBaumgarte:Float = 0.2

\ No newline at end of file +} +

Setting provides advenced parameters used by the physics simulation.

Static variables

@:value(PositionCorrectionAlgorithm._SPLIT_IMPULSE)staticalternativeContactPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._SPLIT_IMPULSE

@:value(1 * MathUtil.TO_RADIANS)staticangularSlop:Float = 1 * MathUtil.TO_RADIANS

@:value(0.45)staticbvhIncrementalCollisionThreshold:Float = 0.45

@:value(0.1)staticbvhProxyPadding:Float = 0.1

@:value(0.5)staticcontactEnableBounceThreshold:Float = 0.5

@:value(0.05)staticcontactPersistenceThreshold:Float = 0.05

@:value(1)staticdefaultCollisionGroup:Int = 1

@:value(1)staticdefaultCollisionMask:Int = 1

@:value(PositionCorrectionAlgorithm._BAUMGARTE)staticdefaultContactPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._BAUMGARTE

@:value(1)staticdefaultDensity:Float = 1

@:value(0.2)staticdefaultFriction:Float = 0.2

@:value(0.05)staticdefaultGJKMargin:Float = 0.05

@:value(ConstraintSolverType._ITERATIVE)staticdefaultJointConstraintSolverType:Int = ConstraintSolverType._ITERATIVE

@:value(PositionCorrectionAlgorithm._BAUMGARTE)staticdefaultJointPositionCorrectionAlgorithm:Int = PositionCorrectionAlgorithm._BAUMGARTE

@:value(0.2)staticdefaultRestitution:Float = 0.2

@:value(1e-9)staticdirectMlcpSolverEps:Float = 1e-9

@:value(false)staticdisableSleeping:Bool = false

@:value(true)staticenableGJKCaching:Bool = true

@:value(128)staticislandInitialConstraintArraySize:Int = 128

@:value(128)staticislandInitialRigidBodyArraySize:Int = 128

@:value(0.95)staticjointWarmStartingFactor:Float = 0.95

@:value(0.8)staticjointWarmStartingFactorForBaungarte:Float = 0.8

@:value(0.005)staticlinearSlop:Float = 0.005

@:value(128)staticmaxEPAPolyhedronFaces:Int = 128

@:value(128)staticmaxEPAVertices:Int = 128

@:value(6)staticmaxJacobianRows:Int = 6

@:value(4)staticmaxManifoldPoints:Int = 4

@:value(MathUtil.PI)staticmaxRotationPerStep:Float = MathUtil.PI

@:value(20)staticmaxTranslationPerStep:Float = 20

@:value(1e-6)staticminRagdollMaxSwingAngle:Float = 1e-6

@:value(1e-6)staticminSpringDamperDampingRatio:Float = 1e-6

@:value(1.0)staticpositionNgsBaumgarte:Float = 1.0

@:value(0.4)staticpositionSplitImpulseBaumgarte:Float = 0.4

@:value(0.5)staticsleepingAngularVelocityThreshold:Float = 0.5

@:value(1.0)staticsleepingTimeThreshold:Float = 1.0

@:value(0.2)staticsleepingVelocityThreshold:Float = 0.2

@:value(0.2)staticvelocityBaumgarte:Float = 0.2

\ No newline at end of file diff --git a/docs/oimo/common/Transform.html b/docs/oimo/common/Transform.html index b3fa6c5..65df17e 100644 --- a/docs/oimo/common/Transform.html +++ b/docs/oimo/common/Transform.html @@ -1,12 +1,13 @@ -oimo.common.Transform - OimoPhysics API documentation

Transform class provides a set of translation and rotation.

Constructor

new()

Creates a new identical transform.

Methods

inlineclone():Transform

Returns a clone of the transformation.

inlinecopyFrom(transform:Transform):Transform

Sets the transformation to transform and returns this.

inlinegetOrientation():Quat

Returns the rotation as a quaternion.

inlinegetOrientationTo(orientation:Quat):Void

Sets orientation to the quaternion representing the rotation.

+} +

Transform class provides a set of translation and rotation.

Constructor

new()

Creates a new identical transform.

Methods

inlineclone():Transform

Returns a clone of the transformation.

inlinecopyFrom(transform:Transform):Transform

Sets the transformation to transform and returns this.

inlinegetOrientation():Quat

Returns the rotation as a quaternion.

inlinegetOrientationTo(orientation:Quat):Void

Sets orientation to the quaternion representing the rotation.

This does not create a new instance of Quat.

inlinegetPosition():Vec3

Returns the position of the transformation.

inlinegetPositionTo(position:Vec3):Void

Sets position to the position of the transformation.

This does not create a new instance of Vec3.

inlinegetRotation():Mat3

Returns the rotation matrix.

inlinegetRotationTo(out:Mat3):Void

Sets out to the rotation matrix.

-

This does not create a new instance of Mat3.

inlineidentity():Transform

Sets the transformation to identity and returns this.

inlinerotate(rotation:Mat3):Void

Applies rotation by the rotation matrix rotation.

inlinerotateXyz(eulerAngles:Vec3):Void

Applies the rotation by Euler angles eulerAngles in radians.

inlinesetOrientation(quaternion:Quat):Transform

Sets the rotation from a quaternion quaternion and returns this.

inlinesetPosition(position:Vec3):Transform

Sets the position of the transformation to position and returns this.

inlinesetRotation(rotation:Mat3):Transform

Sets the rotation matrix to rotation and returns this.

inlinesetRotationXyz(eulerAngles:Vec3):Void

Sets the rotation by Euler angles eulerAngles in radians.

inlinetranslate(translation:Vec3):Void

Translates the position by translation.

\ No newline at end of file +

This does not create a new instance of Mat3.

inlineidentity():Transform

Sets the transformation to identity and returns this.

inlinerotate(rotation:Mat3):Void

Applies rotation by the rotation matrix rotation.

inlinerotateXyz(eulerAngles:Vec3):Void

Applies the rotation by Euler angles eulerAngles in radians.

inlinesetOrientation(quaternion:Quat):Transform

Sets the rotation from a quaternion quaternion and returns this.

inlinesetPosition(position:Vec3):Transform

Sets the position of the transformation to position and returns this.

inlinesetRotation(rotation:Mat3):Transform

Sets the rotation matrix to rotation and returns this.

inlinesetRotationXyz(eulerAngles:Vec3):Void

Sets the rotation by Euler angles eulerAngles in radians.

inlinetranslate(translation:Vec3):Void

Translates the position by translation.

\ No newline at end of file diff --git a/docs/oimo/common/Vec3.html b/docs/oimo/common/Vec3.html index ec50e0a..9c2b0c1 100644 --- a/docs/oimo/common/Vec3.html +++ b/docs/oimo/common/Vec3.html @@ -1,11 +1,12 @@ -oimo.common.Vec3 - OimoPhysics API documentation

3D vector class.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ z : 0, y : 0, x : 0 })inlinenew(x:Float = 0, y:Float = 0, z:Float = 0)

Creates a new vector. The vector is zero vector by default.

Variables

x:Float

The x-value of the vector.

y:Float

The y-value of the vector.

z:Float

The z-value of the vector.

Methods

inlineadd(v:Vec3):Vec3

Returns this + v.

inlineadd3(vx:Float, vy:Float, vz:Float):Vec3

Returns (this.x + vx, this.y + vy, this.z + vz).

inlineadd3Eq(vx:Float, vy:Float, vz:Float):Vec3

Sets this vector to (this.x + vx, this.y + vy, this.z + vz) and returns this.

inlineaddEq(v:Vec3):Vec3

Sets this vector to this + v and returns this.

inlineaddScaled(v:Vec3, s:Float):Vec3

Returns this + v * s.

inlineaddScaledEq(v:Vec3, s:Float):Vec3

Sets this vector to this + v * s and returns this.

inlineclone():Vec3

Returns a clone of the vector.

inlinecopyFrom(v:Vec3):Vec3

Copies values from v and returns this.

inlinecross(v:Vec3):Vec3

Returns the cross product of this and v.

inlinecrossEq(v:Vec3):Vec3

Sets this vector to the cross product of this and s, and returns this.

inlinedot(v:Vec3):Float

Returns the dot product of this and v.

init(x:Float, y:Float, z:Float):Vec3

Sets all values at once and returns this.

inlinelength():Float

Returns the length of the vector.

inlinelengthSq():Float

Returns the squared length of the vector.

inlinemulMat3(m:Mat3):Vec3

Returns the transformed vector by m.

inlinemulMat3Eq(m:Mat3):Vec3

Sets this vector to the transformed vector by m and returns this.

inlinemulMat4(m:Mat4):Vec3

Returns the transformed vector by m.

inlinemulMat4Eq(m:Mat4):Vec3

Sets this vector to the transformed vector by m and returns this.

inlinemulTransform(tf:Transform):Vec3

Returns the transformed vector by tf.

inlinemulTransformEq(tf:Transform):Vec3

Sets this vector to the transformed vector by tf and returns this.

inlinenegate():Vec3

Returns the nagated vector.

inlinenegateEq():Vec3

Negate the vector and returns this.

inlinenormalize():Vec3

Normalize this vector and returns this.

+} +

3D vector class.

Static variables

@:value(0)staticnumCreations:Int = 0

The number of instance creation.

Constructor

@:value({ z : 0, y : 0, x : 0 })inlinenew(x:Float = 0, y:Float = 0, z:Float = 0)

Creates a new vector. The vector is zero vector by default.

Variables

x:Float

The x-value of the vector.

y:Float

The y-value of the vector.

z:Float

The z-value of the vector.

Methods

inlineadd(v:Vec3):Vec3

Returns this + v.

inlineadd3(vx:Float, vy:Float, vz:Float):Vec3

Returns (this.x + vx, this.y + vy, this.z + vz).

inlineadd3Eq(vx:Float, vy:Float, vz:Float):Vec3

Sets this vector to (this.x + vx, this.y + vy, this.z + vz) and returns this.

inlineaddEq(v:Vec3):Vec3

Sets this vector to this + v and returns this.

inlineaddScaled(v:Vec3, s:Float):Vec3

Returns this + v * s.

inlineaddScaledEq(v:Vec3, s:Float):Vec3

Sets this vector to this + v * s and returns this.

inlineclone():Vec3

Returns a clone of the vector.

inlinecopyFrom(v:Vec3):Vec3

Copies values from v and returns this.

inlinecross(v:Vec3):Vec3

Returns the cross product of this and v.

inlinecrossEq(v:Vec3):Vec3

Sets this vector to the cross product of this and s, and returns this.

inlinedot(v:Vec3):Float

Returns the dot product of this and v.

init(x:Float, y:Float, z:Float):Vec3

Sets all values at once and returns this.

inlinelength():Float

Returns the length of the vector.

inlinelengthSq():Float

Returns the squared length of the vector.

inlinemulMat3(m:Mat3):Vec3

Returns the transformed vector by m.

inlinemulMat3Eq(m:Mat3):Vec3

Sets this vector to the transformed vector by m and returns this.

inlinemulMat4(m:Mat4):Vec3

Returns the transformed vector by m.

inlinemulMat4Eq(m:Mat4):Vec3

Sets this vector to the transformed vector by m and returns this.

inlinemulTransform(tf:Transform):Vec3

Returns the transformed vector by tf.

inlinemulTransformEq(tf:Transform):Vec3

Sets this vector to the transformed vector by tf and returns this.

inlinenegate():Vec3

Returns the nagated vector.

inlinenegateEq():Vec3

Negate the vector and returns this.

inlinenormalize():Vec3

Normalize this vector and returns this.

If the length is zero, this vector is set to zero vector.

inlinenormalized():Vec3

Returns the normalized vector.

-

If the length is zero, zero vector is returned.

inlinescale(s:Float):Vec3

Returns this * s.

inlinescale3(sx:Float, sy:Float, sz:Float):Vec3

Returns (this.x * sx, this.y * sy, this.z * sz).

inlinescale3Eq(sx:Float, sy:Float, sz:Float):Vec3

Sets this vector to (this.x * sx, this.y * sy, this.z * sz) and returns this.

inlinescaleEq(s:Float):Vec3

Sets this vector to this * s and returns this.

inlinesub(v:Vec3):Vec3

Returns this - v.

inlinesub3(vx:Float, vy:Float, vz:Float):Vec3

Returns (this.x - vx, this.y - vy, this.z - vz).

inlinesub3Eq(vx:Float, vy:Float, vz:Float):Vec3

Sets this vector to (this.x - vx, this.y - vy, this.z - vz) and returns this.

inlinesubEq(v:Vec3):Vec3

Sets this vector to this - v and returns this.

toString():String

Returns the string representation of the vector.

zero():Vec3

Sets this vector to zero vector and returns this.

\ No newline at end of file +

If the length is zero, zero vector is returned.

inlinescale(s:Float):Vec3

Returns this * s.

inlinescale3(sx:Float, sy:Float, sz:Float):Vec3

Returns (this.x * sx, this.y * sy, this.z * sz).

inlinescale3Eq(sx:Float, sy:Float, sz:Float):Vec3

Sets this vector to (this.x * sx, this.y * sy, this.z * sz) and returns this.

inlinescaleEq(s:Float):Vec3

Sets this vector to this * s and returns this.

inlinesub(v:Vec3):Vec3

Returns this - v.

inlinesub3(vx:Float, vy:Float, vz:Float):Vec3

Returns (this.x - vx, this.y - vy, this.z - vz).

inlinesub3Eq(vx:Float, vy:Float, vz:Float):Vec3

Sets this vector to (this.x - vx, this.y - vy, this.z - vz) and returns this.

inlinesubEq(v:Vec3):Vec3

Sets this vector to this - v and returns this.

toString():String

Returns the string representation of the vector.

zero():Vec3

Sets this vector to zero vector and returns this.

\ No newline at end of file diff --git a/docs/oimo/common/index.html b/docs/oimo/common/index.html index 6757abc..ec4f2b0 100644 --- a/docs/oimo/common/index.html +++ b/docs/oimo/common/index.html @@ -1,9 +1,10 @@ -oimo.common - OimoPhysics API documentation

oimo.common

OimoPhysics API Documentation

..
Mat3

3x3 Matrix class.

Mat4

4x4 Matrix class.

MathUtil

This class provides mathematical operations for internal purposes.

Pool

The object pool system of Vec3, Mat3, Mat4, and Quat.

Quat

Quaternion class.

Setting

Setting provides advenced parameters used by the physics simulation.

Transform

Transform class provides a set of translation and rotation.

Vec3

3D vector class.

\ No newline at end of file +} +

oimo.common

OimoPhysics API Documentation

..
Mat3

3x3 Matrix class.

Mat4

4x4 Matrix class.

MathUtil

This class provides mathematical operations for internal purposes.

Pool

The object pool system of Vec3, Mat3, Mat4, and Quat.

Quat

Quaternion class.

Setting

Setting provides advenced parameters used by the physics simulation.

Transform

Transform class provides a set of translation and rotation.

Vec3

3D vector class.

\ No newline at end of file diff --git a/docs/oimo/dynamics/Contact.html b/docs/oimo/dynamics/Contact.html index e2e2458..8cac825 100644 --- a/docs/oimo/dynamics/Contact.html +++ b/docs/oimo/dynamics/Contact.html @@ -1,15 +1,16 @@ -oimo.dynamics.Contact - OimoPhysics API documentation

A contact is a cached pair of overlapping shapes in the physics world. contacts +} +

A contact is a cached pair of overlapping shapes in the physics world. contacts are created by ContactManager when two AABBs of shapes begin overlapping.

As AABBs are larger than its shapes, shapes of a contact don't always touching or colliding though their AABBs are overlapping.

Methods

inlinegetContactConstraint():ContactConstraint

Returns the contact constraint.

inlinegetManifold():Manifold

Returns the contact manifold.

inlinegetNext():Contact

Returns the next contact in the world.

If the next contact does not exist, null will be returned.

inlinegetPrev():Contact

Returns the previous contact in the world.

-

If the previous contact does not exist, null will be returned.

inlinegetShape1():Shape

Returns the first shape of the contact.

inlinegetShape2():Shape

Returns the second shape of the contact.

inlineisTouching():Bool

Returns whether the shapes are touching.

\ No newline at end of file +

If the previous contact does not exist, null will be returned.

inlinegetShape1():Shape

Returns the first shape of the contact.

inlinegetShape2():Shape

Returns the second shape of the contact.

inlineisTouching():Bool

Returns whether the shapes are touching.

\ No newline at end of file diff --git a/docs/oimo/dynamics/ContactLink.html b/docs/oimo/dynamics/ContactLink.html index dc95cf3..a437415 100644 --- a/docs/oimo/dynamics/ContactLink.html +++ b/docs/oimo/dynamics/ContactLink.html @@ -1,16 +1,17 @@ -oimo.dynamics.ContactLink - OimoPhysics API documentationoimo.dynamics.ContactLink - OimoPhysics API documentation

A contact link is used to build a constraint graph for clustering rigid bodies. +} +

A contact link is used to build a constraint graph for clustering rigid bodies. In a constraint graph, rigid bodies are nodes and constraints are edges. See also JointLink.

Methods

inlinegetContact():Contact

Returns the contact of the link.

inlinegetNext():ContactLink

Returns the next contact link in the rigid body.

If the next one does not exist, null will be returned.

inlinegetOther():RigidBody

Returns the other rigid body of the link. This provides a quick access from a rigid body to the other one of the contact.

inlinegetPrev():ContactLink

Returns the previous contact link in the rigid body.

-

If the previous one does not exist, null will be returned.

\ No newline at end of file +

If the previous one does not exist, null will be returned.

\ No newline at end of file diff --git a/docs/oimo/dynamics/ContactManager.html b/docs/oimo/dynamics/ContactManager.html index eda9961..5f7dbb7 100644 --- a/docs/oimo/dynamics/ContactManager.html +++ b/docs/oimo/dynamics/ContactManager.html @@ -1,13 +1,14 @@ -oimo.dynamics.ContactManager - OimoPhysics API documentationoimo.dynamics.ContactManager - OimoPhysics API documentation

The manager of the contacts in the physics world. A contact of two +} +

The manager of the contacts in the physics world. A contact of two shapes is created when the AABBs of them begin overlapping, and -is destroyed when they end overlapping.

Methods

inlinegetContactList():Contact

Returns the linked list of the contacts in the world.

inlinegetNumContacts():Int

Returns the number of the contacts in the world.

\ No newline at end of file +is destroyed when they end overlapping.

Methods

inlinegetContactList():Contact

Returns the linked list of the contacts in the world.

inlinegetNumContacts():Int

Returns the number of the contacts in the world.

\ No newline at end of file diff --git a/docs/oimo/dynamics/TimeStep.html b/docs/oimo/dynamics/TimeStep.html index e23ba61..6c6cda2 100644 --- a/docs/oimo/dynamics/TimeStep.html +++ b/docs/oimo/dynamics/TimeStep.html @@ -1,10 +1,11 @@ -oimo.dynamics.TimeStep - OimoPhysics API documentation

Information of time-step sizes of the simulation.

Variables

dt:Float

The time step of simulation.

dtRatio:Float

The ratio of time steps. Defined by current time step divided by previous -time step.

invDt:Float

The inverse time step of simulation, equivalent to simulation FPS.

\ No newline at end of file +} +

Information of time-step sizes of the simulation.

Variables

dt:Float

The time step of simulation.

dtRatio:Float

The ratio of time steps. Defined by current time step divided by previous +time step.

invDt:Float

The inverse time step of simulation, equivalent to simulation FPS.

\ No newline at end of file diff --git a/docs/oimo/dynamics/World.html b/docs/oimo/dynamics/World.html index 621cc1e..2f6feb2 100644 --- a/docs/oimo/dynamics/World.html +++ b/docs/oimo/dynamics/World.html @@ -1,16 +1,17 @@ -oimo.dynamics.World - OimoPhysics API documentation

The physics simulation world. This manages entire the dynamic simulation. You can add +} +

The physics simulation world. This manages entire the dynamic simulation. You can add rigid bodies and joints to the world to simulate them.

Constructor

@:value({ gravity : null, broadPhaseType : BroadPhaseType._BVH })new(broadPhaseType:Int = BroadPhaseType._BVH, ?gravity:Vec3)

Creates a new physics world, with broad-phase collision detection algorithm broadPhaseType and gravitational acceleration gravity.

Methods

aabbTest(aabb:Aabb, callback:AabbTestCallback):Void

Performs an AABB query. callback.process is called for all shapes that their AABB and aabb intersect.

addJoint(joint:Joint):Void

Adds the joint joint to the simulation world.

addRigidBody(rigidBody:RigidBody):Void

Adds the rigid body rigidBody to the simulation world.

convexCast(convex:ConvexGeometry, begin:Transform, translation:Vec3, callback:RayCastCallback):Void

Performs a convex casting. callback.process is called for all shapes the convex geometry convex hits. The convex geometry translates by translation starting from the beginning transform begin.

debugDraw():Void

Draws the simulation world for debugging. Call World.setDebugDraw to set the debug draw interface.

inlinegetBroadPhase():BroadPhase

Returns the broad-phase collision detection algorithm.

inlinegetContactManager():ContactManager

Returns the contact manager.

inlinegetDebugDraw():DebugDraw

Returns the debug draw interface.

inlinegetGravity():Vec3

Returns the gravitational acceleration of the simulation world.

inlinegetJointList():Joint

Returns the list of the joints added to the world.

inlinegetNumIslands():Int

Returns the number of simulation islands.

inlinegetNumJoints():Int

Returns the number of the joints added to the world.

inlinegetNumPositionIterations():Int

Returns the number of position iterations of constraint solvers.

inlinegetNumRigidBodies():Int

Returns the number of the rigid bodies added to the world.

inlinegetNumShapes():Int

Returns the number of the shapes added to the world.

inlinegetNumVelocityIterations():Int

Returns the number of velocity iterations of constraint solvers.

inlinegetRigidBodyList():RigidBody

Returns the list of the rigid bodies added to the world.

rayCast(begin:Vec3, end:Vec3, callback:RayCastCallback):Void

Performs a ray casting. callback.process is called for all shapes the ray -from begin to end hits.

removeJoint(joint:Joint):Void

Removes the joint joint from the simulation world.

removeRigidBody(rigidBody:RigidBody):Void

Removes the rigid body rigidBody from the simulation world.

inlinesetDebugDraw(debugDraw:DebugDraw):Void

Sets the debug draw interface to debugDraw. Call World.debugDraw to draw the simulation world.

inlinesetGravity(gravity:Vec3):Void

Sets the gravitational acceleration of the simulation world to gravity.

inlinesetNumPositionIterations(numPositionIterations:Int):Void

Sets the number of position iterations of constraint solvers to numPositionIterations.

inlinesetNumVelocityIterations(numVelocityIterations:Int):Void

Sets the number of velocity iterations of constraint solvers to numVelocityIterations.

step(timeStep:Float):Void

Advances the simulation by the time step timeStep.

\ No newline at end of file +from begin to end hits.

removeJoint(joint:Joint):Void

Removes the joint joint from the simulation world.

removeRigidBody(rigidBody:RigidBody):Void

Removes the rigid body rigidBody from the simulation world.

inlinesetDebugDraw(debugDraw:DebugDraw):Void

Sets the debug draw interface to debugDraw. Call World.debugDraw to draw the simulation world.

inlinesetGravity(gravity:Vec3):Void

Sets the gravitational acceleration of the simulation world to gravity.

inlinesetNumPositionIterations(numPositionIterations:Int):Void

Sets the number of position iterations of constraint solvers to numPositionIterations.

inlinesetNumVelocityIterations(numVelocityIterations:Int):Void

Sets the number of velocity iterations of constraint solvers to numVelocityIterations.

step(timeStep:Float):Void

Advances the simulation by the time step timeStep.

\ No newline at end of file diff --git a/docs/oimo/dynamics/callback/AabbTestCallback.html b/docs/oimo/dynamics/callback/AabbTestCallback.html index 38ca9fe..ce7a852 100644 --- a/docs/oimo/dynamics/callback/AabbTestCallback.html +++ b/docs/oimo/dynamics/callback/AabbTestCallback.html @@ -1,10 +1,11 @@ -oimo.dynamics.callback.AabbTestCallback - OimoPhysics API documentation

A callback interface for aabb tests in a world.

Constructor

new()

Default constructor.

Methods

process(shape:Shape):Void

This is called every time the world detects a shape shape that -the query aabb intersects.

\ No newline at end of file +} +

A callback interface for aabb tests in a world.

Constructor

new()

Default constructor.

Methods

process(shape:Shape):Void

This is called every time the world detects a shape shape that +the query aabb intersects.

\ No newline at end of file diff --git a/docs/oimo/dynamics/callback/ContactCallback.html b/docs/oimo/dynamics/callback/ContactCallback.html index 8fcb759..f6ff92a 100644 --- a/docs/oimo/dynamics/callback/ContactCallback.html +++ b/docs/oimo/dynamics/callback/ContactCallback.html @@ -1,15 +1,16 @@ -oimo.dynamics.callback.ContactCallback - OimoPhysics API documentation

A callback class for contact events. Contact events between two shapes +} +

A callback class for contact events. Contact events between two shapes will occur in following order:

  1. beginContact
  2. preSolve (before velocity update)
  3. postSolve (after velocity update)
  4. (repeats 2. and 3. every frame while the shapes are touching)
  5. endContact

Constructor

new()

Default constructor.

Methods

beginContact(c:Contact):Void

This is called when two shapes start touching each other. c is the contact of the two shapes.

endContact(c:Contact):Void

This is called when two shapes end touching each other. c is the contact of the two shapes.

postSolve(c:Contact):Void

This is called every frame after velocity solver iterations while two shapes are touching. c is the contact for the two shapes.

preSolve(c:Contact):Void

This is called every frame before velocity solver iterations while two shapes -are touching. c is the contact for the two shapes.

\ No newline at end of file +are touching. c is the contact for the two shapes.

\ No newline at end of file diff --git a/docs/oimo/dynamics/callback/RayCastCallback.html b/docs/oimo/dynamics/callback/RayCastCallback.html index cc7c7b1..74ffcae 100644 --- a/docs/oimo/dynamics/callback/RayCastCallback.html +++ b/docs/oimo/dynamics/callback/RayCastCallback.html @@ -1,10 +1,11 @@ -oimo.dynamics.callback.RayCastCallback - OimoPhysics API documentation

A callback class for ray casts in a world.

Constructor

new()

Default constructor.

Methods

process(shape:Shape, hit:RayCastHit):Void

This is called every time the world detects a shape shape that -the ray intersects with the hit data hit.

\ No newline at end of file +} +

A callback class for ray casts in a world.

Constructor

new()

Default constructor.

Methods

process(shape:Shape, hit:RayCastHit):Void

This is called every time the world detects a shape shape that +the ray intersects with the hit data hit.

\ No newline at end of file diff --git a/docs/oimo/dynamics/callback/RayCastClosest.html b/docs/oimo/dynamics/callback/RayCastClosest.html index f8b70d7..9ea7a36 100644 --- a/docs/oimo/dynamics/callback/RayCastClosest.html +++ b/docs/oimo/dynamics/callback/RayCastClosest.html @@ -1,13 +1,14 @@ -oimo.dynamics.callback.RayCastClosest - OimoPhysics API documentationoimo.dynamics.callback.RayCastClosest - OimoPhysics API documentation

A ray cast callback implementation that keeps only the closest hit data. +} +

A ray cast callback implementation that keeps only the closest hit data. This is reusable, but make sure to clear the old result by calling -RayCastClosest.clear if used once or more before.

Constructor

new()

Default constructor.

Variables

fraction:Float

The ratio of the position the ray hit from the start point to the end point.

hit:Bool

Whether the ray hit any shape in the world.

normal:Vec3

The normal vector of the surface the ray hit.

position:Vec3

The position the ray hit at.

shape:Shape

The shape the ray hit.

Methods

inlineclear():Void

Clears the result data.

Inherited Variables

Inherited Methods

\ No newline at end of file +RayCastClosest.clear if used once or more before.

Constructor

new()

Default constructor.

Variables

fraction:Float

The ratio of the position the ray hit from the start point to the end point.

hit:Bool

Whether the ray hit any shape in the world.

normal:Vec3

The normal vector of the surface the ray hit.

position:Vec3

The position the ray hit at.

shape:Shape

The shape the ray hit.

Methods

inlineclear():Void

Clears the result data.

Inherited Variables

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/callback/index.html b/docs/oimo/dynamics/callback/index.html index 14ae981..a0a755b 100644 --- a/docs/oimo/dynamics/callback/index.html +++ b/docs/oimo/dynamics/callback/index.html @@ -1,12 +1,13 @@ -oimo.dynamics.callback - OimoPhysics API documentation

oimo.dynamics.callback

OimoPhysics API Documentation

..
AabbTestCallback

A callback interface for aabb tests in a world.

ContactCallback

A callback class for contact events. Contact events between two shapes +} +

oimo.dynamics.callback

OimoPhysics API Documentation

..
AabbTestCallback

A callback interface for aabb tests in a world.

ContactCallback

A callback class for contact events. Contact events between two shapes will occur in following order:

RayCastCallback

A callback class for ray casts in a world.

RayCastClosest

A ray cast callback implementation that keeps only the closest hit data. This is reusable, but make sure to clear the old result by calling -RayCastClosest.clear if used once or more before.

\ No newline at end of file +RayCastClosest.clear if used once or more before.

\ No newline at end of file diff --git a/docs/oimo/dynamics/common/DebugDraw.html b/docs/oimo/dynamics/common/DebugDraw.html index 74037e1..b7e0c10 100644 --- a/docs/oimo/dynamics/common/DebugDraw.html +++ b/docs/oimo/dynamics/common/DebugDraw.html @@ -1,14 +1,15 @@ -oimo.dynamics.common.DebugDraw - OimoPhysics API documentationoimo.dynamics.common.DebugDraw - OimoPhysics API documentation

The interface of debug drawer. This provides graphical information of a physics world +} +

The interface of debug drawer. This provides graphical information of a physics world for debugging softwares. Users should override at least three methods DebugDraw.point, DebugDraw.triangle, DebugDraw.line.

Constructor

new()

Default constructor.

Variables

drawAabbs:Bool

Whether to draw the AABBs.

drawBases:Bool

Whether to draw the bases of the rigid bodies.

drawBvh:Bool

Whether to draw the bounding volume hierarchy of the broad-phase collision detection. If BvhBroadPhase is not used, nothing will be drawn regardless @@ -64,4 +65,4 @@

color is the color of the sphere.

triangle(v1:Vec3, v2:Vec3, v3:Vec3, n1:Vec3, n2:Vec3, n3:Vec3, color:Vec3):Void

Draws a triangle.

v1, v2, v3 are the triangle's vertices in CCW order.

n1, n2, n3 are the normals of the triangle's vertices in CCW order.

-

color is the color of the triangle.

\ No newline at end of file +

color is the color of the triangle.

\ No newline at end of file diff --git a/docs/oimo/dynamics/common/DebugDrawStyle.html b/docs/oimo/dynamics/common/DebugDrawStyle.html index 1a813ad..7ac85d6 100644 --- a/docs/oimo/dynamics/common/DebugDrawStyle.html +++ b/docs/oimo/dynamics/common/DebugDrawStyle.html @@ -1,9 +1,10 @@ -oimo.dynamics.common.DebugDrawStyle - OimoPhysics API documentation

Style settings of the debug draw.

Constructor

new()

Default constructor.

Variables

@:value(new Vec3(1.0, 0.1, 0.1))aabbColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(1.0, 0.0, 0.0))basisColorX:Vec3 = new Vec3(1.0, 0.0, 0.0)

@:value(new Vec3(0.0, 1.0, 0.0))basisColorY:Vec3 = new Vec3(0.0, 1.0, 0.0)

@:value(new Vec3(0.0, 0.0, 1.0))basisColorZ:Vec3 = new Vec3(0.0, 0.0, 1.0)

@:value(0.5)basisLength:Float = 0.5

@:value(new Vec3(0.4, 0.4, 0.4))bvhNodeColor:Vec3 = new Vec3(0.4, 0.4, 0.4)

@:value(new Vec3(0.2, 0.2, 1.0))contactBinormalColor:Vec3 = new Vec3(0.2, 0.2, 1.0)

@:value(0.5)contactBinormalLength:Float = 0.5

@:value(new Vec3(1.0, 0.1, 0.1))contactColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(1.0, 0.6, 0.1))contactColor2:Vec3 = new Vec3(1.0, 0.6, 0.1)

@:value(new Vec3(0.1, 0.8, 0.6))contactColor3:Vec3 = new Vec3(0.1, 0.8, 0.6)

@:value(new Vec3(0.8, 0.1, 1.0))contactColor4:Vec3 = new Vec3(0.8, 0.1, 1.0)

@:value(new Vec3(1.0, 0.1, 0.1))contactNormalColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(0.5)contactNormalLength:Float = 0.5

@:value(new Vec3(0.1, 0.8, 0.1))contactTangentColor:Vec3 = new Vec3(0.1, 0.8, 0.1)

@:value(0.5)contactTangentLength:Float = 0.5

@:value(new Vec3(0.5, 0.1, 0.1))disabledContactColor:Vec3 = new Vec3(0.5, 0.1, 0.1)

@:value(new Vec3(1.0, 0.1, 0.1))jointErrorColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(0.8, 0.8, 0.8))jointLineColor:Vec3 = new Vec3(0.8, 0.8, 0.8)

@:value(0.3)jointRotationalConstraintRadius:Float = 0.3

@:value(new Vec3(1.0, 0.5, 0.1))kinematicShapeColor:Vec3 = new Vec3(1.0, 0.5, 0.1)

@:value(new Vec3(1.0, 1.0, 0.1))newContactColor:Vec3 = new Vec3(1.0, 1.0, 0.1)

@:value(new Vec3(1.0, 1.0, 0.1))pairColor:Vec3 = new Vec3(1.0, 1.0, 0.1)

@:value(new Vec3(0.7, 0.2, 0.4))shapeColor1:Vec3 = new Vec3(0.7, 0.2, 0.4)

@:value(new Vec3(1.0, 0.8, 0.1))shapeColor2:Vec3 = new Vec3(1.0, 0.8, 0.1)

@:value(new Vec3(0.3, 0.3, 0.8))sleepingShapeColor1:Vec3 = new Vec3(0.3, 0.3, 0.8)

@:value(new Vec3(0.2, 0.8, 0.5))sleepingShapeColor2:Vec3 = new Vec3(0.2, 0.8, 0.5)

@:value(new Vec3(0.5, 0.25, 0.6))sleepyShapeColor1:Vec3 = new Vec3(0.5, 0.25, 0.6)

@:value(new Vec3(0.6, 0.8, 0.3))sleepyShapeColor2:Vec3 = new Vec3(0.6, 0.8, 0.3)

@:value(new Vec3(0.7, 0.7, 0.7))staticShapeColor:Vec3 = new Vec3(0.7, 0.7, 0.7)

\ No newline at end of file +} +

Style settings of the debug draw.

Constructor

new()

Default constructor.

Variables

@:value(new Vec3(1.0, 0.1, 0.1))aabbColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(1.0, 0.0, 0.0))basisColorX:Vec3 = new Vec3(1.0, 0.0, 0.0)

@:value(new Vec3(0.0, 1.0, 0.0))basisColorY:Vec3 = new Vec3(0.0, 1.0, 0.0)

@:value(new Vec3(0.0, 0.0, 1.0))basisColorZ:Vec3 = new Vec3(0.0, 0.0, 1.0)

@:value(0.5)basisLength:Float = 0.5

@:value(new Vec3(0.4, 0.4, 0.4))bvhNodeColor:Vec3 = new Vec3(0.4, 0.4, 0.4)

@:value(new Vec3(0.2, 0.2, 1.0))contactBinormalColor:Vec3 = new Vec3(0.2, 0.2, 1.0)

@:value(0.5)contactBinormalLength:Float = 0.5

@:value(new Vec3(1.0, 0.1, 0.1))contactColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(1.0, 0.6, 0.1))contactColor2:Vec3 = new Vec3(1.0, 0.6, 0.1)

@:value(new Vec3(0.1, 0.8, 0.6))contactColor3:Vec3 = new Vec3(0.1, 0.8, 0.6)

@:value(new Vec3(0.8, 0.1, 1.0))contactColor4:Vec3 = new Vec3(0.8, 0.1, 1.0)

@:value(new Vec3(1.0, 0.1, 0.1))contactNormalColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(0.5)contactNormalLength:Float = 0.5

@:value(new Vec3(0.1, 0.8, 0.1))contactTangentColor:Vec3 = new Vec3(0.1, 0.8, 0.1)

@:value(0.5)contactTangentLength:Float = 0.5

@:value(new Vec3(0.5, 0.1, 0.1))disabledContactColor:Vec3 = new Vec3(0.5, 0.1, 0.1)

@:value(new Vec3(1.0, 0.1, 0.1))jointErrorColor:Vec3 = new Vec3(1.0, 0.1, 0.1)

@:value(new Vec3(0.8, 0.8, 0.8))jointLineColor:Vec3 = new Vec3(0.8, 0.8, 0.8)

@:value(0.3)jointRotationalConstraintRadius:Float = 0.3

@:value(new Vec3(1.0, 0.5, 0.1))kinematicShapeColor:Vec3 = new Vec3(1.0, 0.5, 0.1)

@:value(new Vec3(1.0, 1.0, 0.1))newContactColor:Vec3 = new Vec3(1.0, 1.0, 0.1)

@:value(new Vec3(1.0, 1.0, 0.1))pairColor:Vec3 = new Vec3(1.0, 1.0, 0.1)

@:value(new Vec3(0.7, 0.2, 0.4))shapeColor1:Vec3 = new Vec3(0.7, 0.2, 0.4)

@:value(new Vec3(1.0, 0.8, 0.1))shapeColor2:Vec3 = new Vec3(1.0, 0.8, 0.1)

@:value(new Vec3(0.3, 0.3, 0.8))sleepingShapeColor1:Vec3 = new Vec3(0.3, 0.3, 0.8)

@:value(new Vec3(0.2, 0.8, 0.5))sleepingShapeColor2:Vec3 = new Vec3(0.2, 0.8, 0.5)

@:value(new Vec3(0.5, 0.25, 0.6))sleepyShapeColor1:Vec3 = new Vec3(0.5, 0.25, 0.6)

@:value(new Vec3(0.6, 0.8, 0.3))sleepyShapeColor2:Vec3 = new Vec3(0.6, 0.8, 0.3)

@:value(new Vec3(0.7, 0.7, 0.7))staticShapeColor:Vec3 = new Vec3(0.7, 0.7, 0.7)

\ No newline at end of file diff --git a/docs/oimo/dynamics/common/Performance.html b/docs/oimo/dynamics/common/Performance.html index 8f13d47..c41545d 100644 --- a/docs/oimo/dynamics/common/Performance.html +++ b/docs/oimo/dynamics/common/Performance.html @@ -1,9 +1,10 @@ -oimo.dynamics.common.Performance - OimoPhysics API documentation

Performance

Static variables

@:value(0)staticbroadPhaseCollisionTime:Float = 0

@:value(0)staticdynamicsTime:Float = 0

@:value(0)staticnarrowPhaseCollisionTime:Float = 0

@:value(0)statictotalTime:Float = 0

\ No newline at end of file +} +

Performance

Static variables

@:value(0)staticbroadPhaseCollisionTime:Float = 0

@:value(0)staticdynamicsTime:Float = 0

@:value(0)staticnarrowPhaseCollisionTime:Float = 0

@:value(0)statictotalTime:Float = 0

\ No newline at end of file diff --git a/docs/oimo/dynamics/common/index.html b/docs/oimo/dynamics/common/index.html index c4ec7bc..06a60d9 100644 --- a/docs/oimo/dynamics/common/index.html +++ b/docs/oimo/dynamics/common/index.html @@ -1,11 +1,12 @@ -oimo.dynamics.common - OimoPhysics API documentation

oimo.dynamics.common

OimoPhysics API Documentation

..
DebugDraw

The interface of debug drawer. This provides graphical information of a physics world +} +

oimo.dynamics.common

OimoPhysics API Documentation

..
DebugDraw

The interface of debug drawer. This provides graphical information of a physics world for debugging softwares. Users should override at least three methods DebugDraw.point, -DebugDraw.triangle, DebugDraw.line.

DebugDrawStyle

Style settings of the debug draw.

Performance

Performance

\ No newline at end of file +DebugDraw.triangle, DebugDraw.line.

DebugDrawStyle

Style settings of the debug draw.

Performance

Performance

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/ConstraintSolver.html b/docs/oimo/dynamics/constraint/ConstraintSolver.html index 141da1a..0240926 100644 --- a/docs/oimo/dynamics/constraint/ConstraintSolver.html +++ b/docs/oimo/dynamics/constraint/ConstraintSolver.html @@ -1,13 +1,14 @@ -oimo.dynamics.constraint.ConstraintSolver - OimoPhysics API documentation

The base class of all constarint solvers.

Methods

postSolve():Void

Performs post-processes.

postSolveVelocity(timeStep:TimeStep):Void

Performs post-processes of velocity part. Time step information timeStep is given +} +

The base class of all constarint solvers.

Methods

postSolve():Void

Performs post-processes.

postSolveVelocity(timeStep:TimeStep):Void

Performs post-processes of velocity part. Time step information timeStep is given for computing time-depending data.

preSolvePosition(timeStep:TimeStep):Void

Prepares for position iteration (split impulse or nonlinear Gauss-Seidel). Time step information timeStep is given for computing time-depending data.

This may not be called depending on position correction algorithm.

preSolveVelocity(timeStep:TimeStep):Void

Prepares for velocity iteration. Time step information timeStep is given for -computing time-depending data.

solvePositionNgs(timeStep:TimeStep):Void

Performs single position iteration (nonlinear Gauss-Seidel)

solvePositionSplitImpulse():Void

Performs single position iteration (split impulse)

solveVelocity():Void

Performs single velocity iteration.

warmStart(timeStep:TimeStep):Void

Applies initial impulses.

\ No newline at end of file +computing time-depending data.

solvePositionNgs(timeStep:TimeStep):Void

Performs single position iteration (nonlinear Gauss-Seidel)

solvePositionSplitImpulse():Void

Performs single position iteration (split impulse)

solveVelocity():Void

Performs single velocity iteration.

warmStart(timeStep:TimeStep):Void

Applies initial impulses.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/PositionCorrectionAlgorithm.html b/docs/oimo/dynamics/constraint/PositionCorrectionAlgorithm.html index 3ae36a3..120a459 100644 --- a/docs/oimo/dynamics/constraint/PositionCorrectionAlgorithm.html +++ b/docs/oimo/dynamics/constraint/PositionCorrectionAlgorithm.html @@ -1,10 +1,11 @@ -oimo.dynamics.constraint.PositionCorrectionAlgorithm - OimoPhysics API documentation

The list of the algorithms for position corretion.

Static variables

@:value(_BAUMGARTE)staticread onlyBAUMGARTE:Int = _BAUMGARTE

Baumgarte stabilizaiton. Fastest but introduces extra energy.

@:value(_NGS)staticread onlyNGS:Int = _NGS

Nonlinear Gauss-Seidel method. Slow but stable.

@:value(_SPLIT_IMPULSE)staticread onlySPLIT_IMPULSE:Int = _SPLIT_IMPULSE

Use split impulse and pseudo velocity. Fast enough and does not introduce extra -energy, but somewhat unstable, especially for joints.

\ No newline at end of file +} +

The list of the algorithms for position corretion.

Static variables

@:value(_BAUMGARTE)staticread onlyBAUMGARTE:Int = _BAUMGARTE

Baumgarte stabilizaiton. Fastest but introduces extra energy.

@:value(_NGS)staticread onlyNGS:Int = _NGS

Nonlinear Gauss-Seidel method. Slow but stable.

@:value(_SPLIT_IMPULSE)staticread onlySPLIT_IMPULSE:Int = _SPLIT_IMPULSE

Use split impulse and pseudo velocity. Fast enough and does not introduce extra +energy, but somewhat unstable, especially for joints.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/contact/ContactConstraint.html b/docs/oimo/dynamics/constraint/contact/ContactConstraint.html index d44006a..e309d99 100644 --- a/docs/oimo/dynamics/constraint/contact/ContactConstraint.html +++ b/docs/oimo/dynamics/constraint/contact/ContactConstraint.html @@ -1,13 +1,14 @@ -oimo.dynamics.constraint.contact.ContactConstraint - OimoPhysics API documentationoimo.dynamics.constraint.contact.ContactConstraint - OimoPhysics API documentation

A contact constraint provides collision information for a contact constraint solver. +} +

A contact constraint provides collision information for a contact constraint solver. This holds a contact manifold, which has some contact points, contact normals, and -contact impulses. See Manifold for more information.

Methods

inlinegetManifold():Manifold

Returns the contact manifold.

inlinegetShape1():Shape

Returns the first shape of the contact.

inlinegetShape2():Shape

Returns the second shape of the contact.

isTouching():Bool

Returns whether the two rigid bodies are touching.

\ No newline at end of file +contact impulses. See Manifold for more information.

Methods

inlinegetManifold():Manifold

Returns the contact manifold.

inlinegetShape1():Shape

Returns the first shape of the contact.

inlinegetShape2():Shape

Returns the second shape of the contact.

isTouching():Bool

Returns whether the two rigid bodies are touching.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/contact/Manifold.html b/docs/oimo/dynamics/constraint/contact/Manifold.html index fbf0110..73e8ef9 100644 --- a/docs/oimo/dynamics/constraint/contact/Manifold.html +++ b/docs/oimo/dynamics/constraint/contact/Manifold.html @@ -1,12 +1,13 @@ -oimo.dynamics.constraint.contact.Manifold - OimoPhysics API documentation

A contact manifold holds collision data of a pair of shapes.

Methods

inlinegetBinormal():Vec3

Returns the binormal vector of the contact manifold. The binormal vector has unit +} +

A contact manifold holds collision data of a pair of shapes.

Methods

inlinegetBinormal():Vec3

Returns the binormal vector of the contact manifold. The binormal vector has unit length and is perpendicular to both the normal and the tangent vector.

inlinegetBinormalTo(binormal:Vec3):Void

Sets binormal to the binormal vector of the contact manifold. The binormal vector has unit length and is perpendicular to both the normal and the tangent vector.

This does not create a new instance of Vec3.

inlinegetNormal():Vec3

Returns the normal vector of the contact manifold. The normal vector has unit @@ -17,4 +18,4 @@ be disabled (see ManifoldPoint.isEnabled).

inlinegetTangent():Vec3

Returns the tangent vector of the contact manifold. The tangent vector has unit length and is perpendicular to the normal vector.

inlinegetTangentTo(tangent:Vec3):Void

Sets tangent to the tangent vector of the contact manifold. The tangent vector has unit length and is perpendicular to the normal vector.

-

This does not create a new instance of Vec3.

\ No newline at end of file +

This does not create a new instance of Vec3.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/contact/ManifoldPoint.html b/docs/oimo/dynamics/constraint/contact/ManifoldPoint.html index b54dd5c..01730ad 100644 --- a/docs/oimo/dynamics/constraint/contact/ManifoldPoint.html +++ b/docs/oimo/dynamics/constraint/contact/ManifoldPoint.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.contact.ManifoldPoint - OimoPhysics API documentation

A manifold point is a contact point in a contact manifold. This holds detailed collision +} +

A manifold point is a contact point in a contact manifold. This holds detailed collision data (position, overlap depth, impulse, etc...) for collision response.

Methods

inlinegetBinormalImpulse():Float

Returns the binormal impulse of the manifold point.

inlinegetDepth():Float

Returns the amount of the overlap. If the manifold point is separate, a negative value is returned.

inlinegetNormalImpulse():Float

Returns the normal impulse of the manifold point.

inlinegetPosition1():Vec3

Returns the first rigid body's manifold point in world coordinate.

inlinegetPosition1To(position:Vec3):Void

Sets position to the first rigid body's manifold point in world coordinate. This does not create a new instance of Vec3.

inlinegetPosition2():Vec3

Returns the second rigid body's manifold point in world coordinate.

inlinegetPosition2To(position:Vec3):Void

Sets position to the second rigid body's manifold point in world coordinate. -This does not create a new instance of Vec3.

inlinegetTangentImpulse():Float

Returns the tangent impulse of the manifold point.

inlineisEnabled():Bool

Returns whether the manifold point is enabled.

inlineisWarmStarted():Bool

Returns whether the manifold point has existed for more than two steps.

\ No newline at end of file +This does not create a new instance of Vec3.

inlinegetTangentImpulse():Float

Returns the tangent impulse of the manifold point.

inlineisEnabled():Bool

Returns whether the manifold point is enabled.

inlineisWarmStarted():Bool

Returns whether the manifold point has existed for more than two steps.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/contact/index.html b/docs/oimo/dynamics/constraint/contact/index.html index cc6a60f..aaa43f5 100644 --- a/docs/oimo/dynamics/constraint/contact/index.html +++ b/docs/oimo/dynamics/constraint/contact/index.html @@ -1,12 +1,13 @@ -oimo.dynamics.constraint.contact - OimoPhysics API documentation

oimo.dynamics.constraint.contact

OimoPhysics API Documentation

..
ContactConstraint

A contact constraint provides collision information for a contact constraint solver. +} +

oimo.dynamics.constraint.contact

OimoPhysics API Documentation

..
ContactConstraint

A contact constraint provides collision information for a contact constraint solver. This holds a contact manifold, which has some contact points, contact normals, and contact impulses. See Manifold for more information.

Manifold

A contact manifold holds collision data of a pair of shapes.

ManifoldPoint

A manifold point is a contact point in a contact manifold. This holds detailed collision -data (position, overlap depth, impulse, etc...) for collision response.

\ No newline at end of file +data (position, overlap depth, impulse, etc...) for collision response.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/index.html b/docs/oimo/dynamics/constraint/index.html index 4aa54f8..87f92f5 100644 --- a/docs/oimo/dynamics/constraint/index.html +++ b/docs/oimo/dynamics/constraint/index.html @@ -1,9 +1,10 @@ -oimo.dynamics.constraint - OimoPhysics API documentation

oimo.dynamics.constraint

OimoPhysics API Documentation

..
contact
joint
solver
ConstraintSolver

The base class of all constarint solvers.

PositionCorrectionAlgorithm

The list of the algorithms for position corretion.

\ No newline at end of file +} +

oimo.dynamics.constraint

OimoPhysics API Documentation

..
contact
joint
solver
ConstraintSolver

The base class of all constarint solvers.

PositionCorrectionAlgorithm

The list of the algorithms for position corretion.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/CylindricalJoint.html b/docs/oimo/dynamics/constraint/joint/CylindricalJoint.html index c26c027..5c4d2d4 100644 --- a/docs/oimo/dynamics/constraint/joint/CylindricalJoint.html +++ b/docs/oimo/dynamics/constraint/joint/CylindricalJoint.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.CylindricalJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.CylindricalJoint - OimoPhysics API documentation

A cylindrical joint constrains two rigid bodies to share their constraint +} +

A cylindrical joint constrains two rigid bodies to share their constraint axes, and restricts relative translation and rotation onto the constraint axis. This joint provides two degrees of freedom. You can enable lower and upper limits, motors, spring and damper effects of both translation and @@ -35,4 +36,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/CylindricalJointConfig.html b/docs/oimo/dynamics/constraint/joint/CylindricalJointConfig.html index 4915c19..5a69e26 100644 --- a/docs/oimo/dynamics/constraint/joint/CylindricalJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/CylindricalJointConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.CylindricalJointConfig - OimoPhysics API documentation

A cylindrical joint config is used for constructions of cylindrical joints.

Constructor

new()

Default constructor.

Variables

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

rotationalLimitMotor:RotationalLimitMotor

The rotational limit and motor along the constraint axis of the joint.

rotationalSpringDamper:SpringDamper

The rotational spring and damper along the constraint axis of the joint.

translationalLimitMotor:TranslationalLimitMotor

The translational limit and motor along the constraint axis of the joint.

translationalSpringDamper:SpringDamper

The translational spring and damper along constraint the axis of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):CylindricalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes +} +

A cylindrical joint config is used for constructions of cylindrical joints.

Constructor

new()

Default constructor.

Variables

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

rotationalLimitMotor:RotationalLimitMotor

The rotational limit and motor along the constraint axis of the joint.

rotationalSpringDamper:SpringDamper

The rotational spring and damper along the constraint axis of the joint.

translationalLimitMotor:TranslationalLimitMotor

The translational limit and motor along the constraint axis of the joint.

translationalSpringDamper:SpringDamper

The translational spring and damper along constraint the axis of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):CylindricalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes from the world axis worldAxis, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/GenericJoint.html b/docs/oimo/dynamics/constraint/joint/GenericJoint.html index 41a73f8..1c29407 100644 --- a/docs/oimo/dynamics/constraint/joint/GenericJoint.html +++ b/docs/oimo/dynamics/constraint/joint/GenericJoint.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.GenericJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.GenericJoint - OimoPhysics API documentation

A generic joint (a.k.a. 6-DoF joint) constrains two rigid bodies in +} +

A generic joint (a.k.a. 6-DoF joint) constrains two rigid bodies in highly flexible way, so that every translational and rotational axis can be locked, unlocked, springy, or powered by a motor like other joints. Note that rotation angles are measured as x-y-z Euler angles, @@ -31,4 +32,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/GenericJointConfig.html b/docs/oimo/dynamics/constraint/joint/GenericJointConfig.html index 0dd7063..09e6b69 100644 --- a/docs/oimo/dynamics/constraint/joint/GenericJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/GenericJointConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.GenericJointConfig - OimoPhysics API documentation

A generic joint config is used for constructions of generic joints.

Constructor

new()

Default constructor.

Variables

localBasis1:Mat3

The first body's local constraint basis.

localBasis2:Mat3

The second body's local constraint basis.

rotationalLimitMotors:Array<RotationalLimitMotor>

The rotational limits and motors along the rotation axes of the relative x-y-z Euler angles.

rotationalSpringDampers:Array<SpringDamper>

The rotational springs and dampers along the rotation axes of the relative x-y-z Euler angles.

translationalLimitMotors:Array<TranslationalLimitMotor>

The translational limits and motors along the first body's the constraint basis.

translationalSpringDampers:Array<SpringDamper>

The translational springs and dampers along the first body's constraint basis.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldBasis1:Mat3, worldBasis2:Mat3):GenericJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local bases +} +

A generic joint config is used for constructions of generic joints.

Constructor

new()

Default constructor.

Variables

localBasis1:Mat3

The first body's local constraint basis.

localBasis2:Mat3

The second body's local constraint basis.

rotationalLimitMotors:Array<RotationalLimitMotor>

The rotational limits and motors along the rotation axes of the relative x-y-z Euler angles.

rotationalSpringDampers:Array<SpringDamper>

The rotational springs and dampers along the rotation axes of the relative x-y-z Euler angles.

translationalLimitMotors:Array<TranslationalLimitMotor>

The translational limits and motors along the first body's the constraint basis.

translationalSpringDampers:Array<SpringDamper>

The translational springs and dampers along the first body's constraint basis.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldBasis1:Mat3, worldBasis2:Mat3):GenericJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local bases from the world bases worldBasis1 and worldBasis2, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/Joint.html b/docs/oimo/dynamics/constraint/joint/Joint.html index 7e733fc..278804c 100644 --- a/docs/oimo/dynamics/constraint/joint/Joint.html +++ b/docs/oimo/dynamics/constraint/joint/Joint.html @@ -1,13 +1,14 @@ -oimo.dynamics.constraint.joint.Joint - OimoPhysics API documentation

The base class of joints. Joints are used to connect two rigid bodies +} +

The base class of joints. Joints are used to connect two rigid bodies in various ways. See JointType for all types of joints.

Variables

userData:Any

Extra field that users can use for their own purposes.

Methods

inlinegetAllowCollision():Bool

Returns whether to allow the connected rigid bodies to collide each other.

inlinegetAnchor1():Vec3

Returns the first rigid body's anchor point in world coordinates.

inlinegetAnchor1To(anchor:Vec3):Void

Sets anchor to the first rigid body's anchor point in world coordinates.

This does not create a new instance of Vec3.

inlinegetAnchor2():Vec3

Returns the second rigid body's anchor point in world coordinates.

inlinegetAnchor2To(anchor:Vec3):Void

Sets anchor to the second rigid body's anchor point in world coordinates.

This does not create a new instance of Vec3.

inlinegetAppliedForce():Vec3

Returns the force applied to the first rigid body at the last time step.

inlinegetAppliedForceTo(appliedForce:Vec3):Void

Sets appliedForce to the force applied to the first rigid body at the last time step.

@@ -25,4 +26,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/JointConfig.html b/docs/oimo/dynamics/constraint/joint/JointConfig.html index bf95c29..3dbccd6 100644 --- a/docs/oimo/dynamics/constraint/joint/JointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/JointConfig.html @@ -1,15 +1,16 @@ -oimo.dynamics.constraint.joint.JointConfig - OimoPhysics API documentation

A joint configuration is used for constructions of various joints. +} +

A joint configuration is used for constructions of various joints. An instance of any kind of the joint configurations can safely be reused.

Variables

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

\ No newline at end of file +

See ConstraintSolverType for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/JointLink.html b/docs/oimo/dynamics/constraint/joint/JointLink.html index 5d2a18a..b030075 100644 --- a/docs/oimo/dynamics/constraint/joint/JointLink.html +++ b/docs/oimo/dynamics/constraint/joint/JointLink.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.JointLink - OimoPhysics API documentationoimo.dynamics.constraint.joint.JointLink - OimoPhysics API documentation

A joint link is used to build a constraint graph for clustering rigid bodies. +} +

A joint link is used to build a constraint graph for clustering rigid bodies. In a constraint graph, rigid bodies are nodes and constraints are edges. See also ContactLink.

Methods

getContact():Joint

Returns the contact the rigid body is attached to.

getNext():JointLink

Returns the next joint link in the rigid body.

If the previous one does not exist, null will be returned.

getOther():RigidBody

Returns the other rigid body attached to the constraint. This provides a quick access from a rigid body to the other one attached to the constraint.

getPrev():JointLink

Returns the previous joint link in the rigid body.

-

If the previous one does not exist, null will be returned.

\ No newline at end of file +

If the previous one does not exist, null will be returned.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/JointType.html b/docs/oimo/dynamics/constraint/joint/JointType.html index f294a36..2878f43 100644 --- a/docs/oimo/dynamics/constraint/joint/JointType.html +++ b/docs/oimo/dynamics/constraint/joint/JointType.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.JointType - OimoPhysics API documentation

The list of the types of the joints.

Static variables

@:value(_CYLINDRICAL)staticread onlyCYLINDRICAL:Int = _CYLINDRICAL

Represents a cylindrical joint.

+} +

The list of the types of the joints.

Static variables

@:value(_CYLINDRICAL)staticread onlyCYLINDRICAL:Int = _CYLINDRICAL

Represents a cylindrical joint.

See CylindricalJoint for details.

@:value(_GENERIC)staticread onlyGENERIC:Int = _GENERIC

Represents a generic joint.

See GenericJoint for details.

@:value(_PRISMATIC)staticread onlyPRISMATIC:Int = _PRISMATIC

Represents a prismatic joint.

See PrismaticJoint for details.

@:value(_RAGDOLL)staticread onlyRAGDOLL:Int = _RAGDOLL

Represents a ragdoll joint.

See RagdollJoint for details.

@:value(_REVOLUTE)staticread onlyREVOLUTE:Int = _REVOLUTE

Represents a revolute joint.

See RevoluteJoint for details.

@:value(_SPHERICAL)staticread onlySPHERICAL:Int = _SPHERICAL

Represents a spherical joint.

See SphericalJoint for details.

@:value(_UNIVERSAL)staticread onlyUNIVERSAL:Int = _UNIVERSAL

Represents a universal joint.

-

See UniversalJoint for details.

\ No newline at end of file +

See UniversalJoint for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/PrismaticJoint.html b/docs/oimo/dynamics/constraint/joint/PrismaticJoint.html index 6777407..c466d3a 100644 --- a/docs/oimo/dynamics/constraint/joint/PrismaticJoint.html +++ b/docs/oimo/dynamics/constraint/joint/PrismaticJoint.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.PrismaticJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.PrismaticJoint - OimoPhysics API documentation

A prismatic joint (a.k.a. slider joint) constrains two rigid bodies to +} +

A prismatic joint (a.k.a. slider joint) constrains two rigid bodies to share their anchor points and constraint axes, and restricts relative translation onto the constraint axis. This joint provides one degree of freedom. You can enable lower and upper limits, a motor, a spring and @@ -35,4 +36,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/PrismaticJointConfig.html b/docs/oimo/dynamics/constraint/joint/PrismaticJointConfig.html index bd6e17e..64d4707 100644 --- a/docs/oimo/dynamics/constraint/joint/PrismaticJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/PrismaticJointConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.PrismaticJointConfig - OimoPhysics API documentation

A prismatic joint config is used for constructions of prismatic joints.

Constructor

new()

Default constructor.

Variables

limitMotor:TranslationalLimitMotor

The translational limit and motor along the constraint axis of the joint.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper:SpringDamper

The translational spring and damper along the constraint axis of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):PrismaticJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes +} +

A prismatic joint config is used for constructions of prismatic joints.

Constructor

new()

Default constructor.

Variables

limitMotor:TranslationalLimitMotor

The translational limit and motor along the constraint axis of the joint.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper:SpringDamper

The translational spring and damper along the constraint axis of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):PrismaticJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes from the world axis worldAxis, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/RagdollJoint.html b/docs/oimo/dynamics/constraint/joint/RagdollJoint.html index 4454e7a..290670b 100644 --- a/docs/oimo/dynamics/constraint/joint/RagdollJoint.html +++ b/docs/oimo/dynamics/constraint/joint/RagdollJoint.html @@ -1,7 +1,7 @@ -oimo.dynamics.constraint.joint.RagdollJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.RagdollJoint - OimoPhysics API documentation

A ragdoll joint is designed to simulate ragdoll's limbs. It constrains +} +

A ragdoll joint is designed to simulate ragdoll's limbs. It constrains swing and twist angles between two rigid bodies. The two rigid bodies have constraint axes, and the swing angle is defined by the angle of two constraint axes, while the twist angle is defined by the rotation @@ -46,4 +47,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/RagdollJointConfig.html b/docs/oimo/dynamics/constraint/joint/RagdollJointConfig.html index abd9351..f68486c 100644 --- a/docs/oimo/dynamics/constraint/joint/RagdollJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/RagdollJointConfig.html @@ -1,12 +1,13 @@ -oimo.dynamics.constraint.joint.RagdollJointConfig - OimoPhysics API documentation

A ragdoll joint config is used for constructions of ragdoll joints.

Constructor

new()

Default constructor.

Variables

localSwingAxis1:Vec3

The first body's local swing axis.

+} +

A ragdoll joint config is used for constructions of ragdoll joints.

Constructor

new()

Default constructor.

Variables

localSwingAxis1:Vec3

The first body's local swing axis.

The second swing axis is also attached to the first body. It is perpendicular to the first swing axis, and is automatically computed when the joint is created.

localTwistAxis1:Vec3

The first body's local twist axis.

localTwistAxis2:Vec3

The second body's local twist axis.

maxSwingAngle1:Float

The max angle of rotation along the first swing axis. This value must be positive.

maxSwingAngle2:Float

The max angle of rotation along the second swing axis. @@ -16,4 +17,4 @@

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/RevoluteJoint.html b/docs/oimo/dynamics/constraint/joint/RevoluteJoint.html index 6d6fd8d..2ec0723 100644 --- a/docs/oimo/dynamics/constraint/joint/RevoluteJoint.html +++ b/docs/oimo/dynamics/constraint/joint/RevoluteJoint.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.RevoluteJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.RevoluteJoint - OimoPhysics API documentation

A revolute joint (a.k.a. hinge joint) constrains two rigid bodies to share +} +

A revolute joint (a.k.a. hinge joint) constrains two rigid bodies to share their anchor points and constraint axes, and restricts relative rotation onto the constraint axis. This joint provides one degree of freedom. You can enable lower and upper limits, a motor, a spring and damper effect of the rotational @@ -35,4 +36,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/RevoluteJointConfig.html b/docs/oimo/dynamics/constraint/joint/RevoluteJointConfig.html index a2fdea4..b85aae7 100644 --- a/docs/oimo/dynamics/constraint/joint/RevoluteJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/RevoluteJointConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.RevoluteJointConfig - OimoPhysics API documentation

A revolute joint config is used for constructions of revolute joints.

Constructor

new()

Default constructor.

Variables

limitMotor:RotationalLimitMotor

The rotational limits and motor settings.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper:SpringDamper

The rotational spring and damper settings.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):RevoluteJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes +} +

A revolute joint config is used for constructions of revolute joints.

Constructor

new()

Default constructor.

Variables

limitMotor:RotationalLimitMotor

The rotational limits and motor settings.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper:SpringDamper

The rotational spring and damper settings.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis:Vec3):RevoluteJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes from the world axis worldAxis, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/RotationalLimitMotor.html b/docs/oimo/dynamics/constraint/joint/RotationalLimitMotor.html index 501d576..1b784ec 100644 --- a/docs/oimo/dynamics/constraint/joint/RotationalLimitMotor.html +++ b/docs/oimo/dynamics/constraint/joint/RotationalLimitMotor.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.RotationalLimitMotor - OimoPhysics API documentation

Rotational limits and motor settings of a joint.

Constructor

new()

Default constructor.

Variables

lowerLimit:Float

The lower bound of the limit in radians.

+} +

Rotational limits and motor settings of a joint.

Constructor

new()

Default constructor.

Variables

lowerLimit:Float

The lower bound of the limit in radians.

The limit is disabled if lowerLimit > upperLimit.

motorSpeed:Float

The target speed of the motor in usually radians per second.

motorTorque:Float

The maximum torque of the motor in usually newton meters.

The motor is disabled if motorTorque <= 0.

upperLimit:Float

The upper bound of the limit in radians.

The limit is disabled if lowerLimit > upperLimit.

Methods

clone():RotationalLimitMotor

Returns a clone of the object.

setLimits(lower:Float, upper:Float):RotationalLimitMotor

Sets limit properties at once and returns this. this.lowerLimit is set to lower, and this.upperLimit is set to upper.

setMotor(speed:Float, torque:Float):RotationalLimitMotor

Sets motor properties at once and returns this. -this.motorSpeed is set to speed, and this.motorTorque is set to torque.

\ No newline at end of file +this.motorSpeed is set to speed, and this.motorTorque is set to torque.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/SphericalJoint.html b/docs/oimo/dynamics/constraint/joint/SphericalJoint.html index 037a82b..3de1742 100644 --- a/docs/oimo/dynamics/constraint/joint/SphericalJoint.html +++ b/docs/oimo/dynamics/constraint/joint/SphericalJoint.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.SphericalJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.SphericalJoint - OimoPhysics API documentation

A spherical joint (a.k.a. ball and socket joint) constrains two rigid bodies to share +} +

A spherical joint (a.k.a. ball and socket joint) constrains two rigid bodies to share their anchor points. This joint provides three degrees of freedom. You can enable a spring and damper effect of the constraint.

Constructor

new(config:SphericalJointConfig)

Creates a new spherical joint by configuration config.

Methods

inlinegetSpringDamper():SpringDamper

Returns the spring and damper settings.

Inherited Variables

Defined by Joint

userData:Any

Extra field that users can use for their own purposes.

Inherited Methods

Defined by Joint

inlinegetAllowCollision():Bool

Returns whether to allow the connected rigid bodies to collide each other.

inlinegetAnchor1():Vec3

Returns the first rigid body's anchor point in world coordinates.

inlinegetAnchor1To(anchor:Vec3):Void

Sets anchor to the first rigid body's anchor point in world coordinates.

This does not create a new instance of Vec3.

inlinegetAnchor2():Vec3

Returns the second rigid body's anchor point in world coordinates.

inlinegetAnchor2To(anchor:Vec3):Void

Sets anchor to the second rigid body's anchor point in world coordinates.

@@ -27,4 +28,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/SphericalJointConfig.html b/docs/oimo/dynamics/constraint/joint/SphericalJointConfig.html index ae1b48d..8f3d05c 100644 --- a/docs/oimo/dynamics/constraint/joint/SphericalJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/SphericalJointConfig.html @@ -1,13 +1,14 @@ -oimo.dynamics.constraint.joint.SphericalJointConfig - OimoPhysics API documentation

A spherical joint config is used for constructions of spherical joints.

Constructor

new()

Default constructor.

Variables

springDamper:SpringDamper

The spring and damper setting of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3):SphericalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

+} +

A spherical joint config is used for constructions of spherical joints.

Constructor

new()

Default constructor.

Variables

springDamper:SpringDamper

The spring and damper setting of the joint.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3):SphericalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/SpringDamper.html b/docs/oimo/dynamics/constraint/joint/SpringDamper.html index c9ec097..42dac02 100644 --- a/docs/oimo/dynamics/constraint/joint/SpringDamper.html +++ b/docs/oimo/dynamics/constraint/joint/SpringDamper.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.SpringDamper - OimoPhysics API documentation

Spring and damper settings of a joint.

Constructor

new()

Default constructor.

Variables

dampingRatio:Float

The damping ratio of the constraint. +} +

Spring and damper settings of a joint.

Constructor

new()

Default constructor.

Variables

dampingRatio:Float

The damping ratio of the constraint. Set 1.0 to make the constraint critically dumped.

frequency:Float

The frequency of the spring in Hz. Set 0.0 to disable the spring and make the constraint totally rigid.

useSymplecticEuler:Bool

Whether to use symplectic Euler method instead of implicit Euler method, to numarically integrate the constraint. Note that symplectic Euler method conserves energy better than implicit Euler method does, but the constraint will be unstable under the high frequency.

Methods

clone():SpringDamper

Returns a clone of the object.

setSpring(frequency:Float, dampingRatio:Float):SpringDamper

Sets spring and damper parameters at once and returns this. -this.frequency is set to frequency, and this.dampingRatio is set to dampingRatio.

setSymplecticEuler(useSymplecticEuler:Bool):SpringDamper

\ No newline at end of file +this.frequency is set to frequency, and this.dampingRatio is set to dampingRatio.

setSymplecticEuler(useSymplecticEuler:Bool):SpringDamper

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/TranslationalLimitMotor.html b/docs/oimo/dynamics/constraint/joint/TranslationalLimitMotor.html index 7fe795b..cb191dd 100644 --- a/docs/oimo/dynamics/constraint/joint/TranslationalLimitMotor.html +++ b/docs/oimo/dynamics/constraint/joint/TranslationalLimitMotor.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.TranslationalLimitMotor - OimoPhysics API documentation

Translational limits and motor settings of a joint.

Constructor

new()

Default constructor.

Variables

lowerLimit:Float

The lower bound of the limit in usually meters.

+} +

Translational limits and motor settings of a joint.

Constructor

new()

Default constructor.

Variables

lowerLimit:Float

The lower bound of the limit in usually meters.

The limit is disabled if lowerLimit > upperLimit.

motorForce:Float

The maximum force of the motor in usually newtons.

The motor is disabled if motorForce <= 0.

motorSpeed:Float

The target speed of the motor in usually meters per second.

upperLimit:Float

The upper bound of the limit in usually meters.

The limit is disabled if lowerLimit > upperLimit.

Methods

clone():TranslationalLimitMotor

Returns a clone of the object.

setLimits(lower:Float, upper:Float):TranslationalLimitMotor

Sets limit properties at once and returns this. this.lowerLimit is set to lower, and this.upperLimit is set to upper.

setMotor(speed:Float, force:Float):TranslationalLimitMotor

Sets motor properties at once and returns this. -this.motorSpeed is set to speed, and this.motorForce is set to force.

\ No newline at end of file +this.motorSpeed is set to speed, and this.motorForce is set to force.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/UniversalJoint.html b/docs/oimo/dynamics/constraint/joint/UniversalJoint.html index 8000e2a..ffb9686 100644 --- a/docs/oimo/dynamics/constraint/joint/UniversalJoint.html +++ b/docs/oimo/dynamics/constraint/joint/UniversalJoint.html @@ -1,16 +1,17 @@ -oimo.dynamics.constraint.joint.UniversalJoint - OimoPhysics API documentationoimo.dynamics.constraint.joint.UniversalJoint - OimoPhysics API documentation

A universal joint constrains two rigid bodies' constraint axes to be perpendicular +} +

A universal joint constrains two rigid bodies' constraint axes to be perpendicular to each other. Rigid bodies can rotate along their constraint axes, but cannot along the direction perpendicular to two constraint axes. This joint provides two degrees of freedom. You can enable lower and upper limits, motors, spring and damper effects @@ -35,4 +36,4 @@

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

-

See PositionCorrectionAlgorithm for details.

\ No newline at end of file +

See PositionCorrectionAlgorithm for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/UniversalJointConfig.html b/docs/oimo/dynamics/constraint/joint/UniversalJointConfig.html index 9422f0f..2a952e8 100644 --- a/docs/oimo/dynamics/constraint/joint/UniversalJointConfig.html +++ b/docs/oimo/dynamics/constraint/joint/UniversalJointConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.constraint.joint.UniversalJointConfig - OimoPhysics API documentation

A universal joint config is used for constructions of universal joints.

Constructor

new()

Default constructor.

Variables

limitMotor1:RotationalLimitMotor

The rotational limit and motor along the first body's constraint axis.

limitMotor2:RotationalLimitMotor

The rotational limit and motor along the second body's constraint axis.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper1:SpringDamper

The rotational spring and damper along the first body's constraint axis.

springDamper2:SpringDamper

The rotational spring and damper along the second body's constraint axis.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis1:Vec3, worldAxis2:Vec3):UniversalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes +} +

A universal joint config is used for constructions of universal joints.

Constructor

new()

Default constructor.

Variables

limitMotor1:RotationalLimitMotor

The rotational limit and motor along the first body's constraint axis.

limitMotor2:RotationalLimitMotor

The rotational limit and motor along the second body's constraint axis.

localAxis1:Vec3

The first body's local constraint axis.

localAxis2:Vec3

The second body's local constraint axis.

springDamper1:SpringDamper

The rotational spring and damper along the first body's constraint axis.

springDamper2:SpringDamper

The rotational spring and damper along the second body's constraint axis.

Methods

init(rigidBody1:RigidBody, rigidBody2:RigidBody, worldAnchor:Vec3, worldAxis1:Vec3, worldAxis2:Vec3):UniversalJointConfig

Sets rigid bodies, local anchors from the world anchor worldAnchor, local axes from the world axes worldAxis1 and worldAxis2, and returns this.

Inherited Variables

Defined by JointConfig

allowCollision:Bool

Whether to allow the connected rigid bodies to collide each other.

breakForce:Float

The joint will be destroyed when magnitude of the constraint force exceeds the value.

Set 0 for unbreakable joints.

breakTorque:Float

The joint will be destroyed when magnitude of the constraint torque exceeds the value.

Set 0 for unbreakable joints.

localAnchor1:Vec3

The local position of the first rigid body's anchor point.

localAnchor2:Vec3

The local position of the second rigid body's anchor point.

positionCorrectionAlgorithm:Int

The type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

rigidBody1:RigidBody

The first rigid body attached to the joint.

rigidBody2:RigidBody

The second rigid body attached to the joint.

solverType:Int

The type of the constraint solver for the joint.

-

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file +

See ConstraintSolverType for details.

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/joint/index.html b/docs/oimo/dynamics/constraint/joint/index.html index 05a7e4f..b6964f4 100644 --- a/docs/oimo/dynamics/constraint/joint/index.html +++ b/docs/oimo/dynamics/constraint/joint/index.html @@ -1,12 +1,13 @@ -oimo.dynamics.constraint.joint - OimoPhysics API documentation

oimo.dynamics.constraint.joint

OimoPhysics API Documentation

..
CylindricalJoint

A cylindrical joint constrains two rigid bodies to share their constraint +} +

oimo.dynamics.constraint.joint

OimoPhysics API Documentation

..
CylindricalJoint

A cylindrical joint constrains two rigid bodies to share their constraint axes, and restricts relative translation and rotation onto the constraint axis. This joint provides two degrees of freedom. You can enable lower and upper limits, motors, spring and damper effects of both translation and @@ -41,4 +42,4 @@ to each other. Rigid bodies can rotate along their constraint axes, but cannot along the direction perpendicular to two constraint axes. This joint provides two degrees of freedom. You can enable lower and upper limits, motors, spring and damper effects -of the two rotational constraints.

UniversalJointConfig

A universal joint config is used for constructions of universal joints.

\ No newline at end of file +of the two rotational constraints.

UniversalJointConfig

A universal joint config is used for constructions of universal joints.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/ConstraintSolverType.html b/docs/oimo/dynamics/constraint/solver/ConstraintSolverType.html index 50c5b6f..06961ed 100644 --- a/docs/oimo/dynamics/constraint/solver/ConstraintSolverType.html +++ b/docs/oimo/dynamics/constraint/solver/ConstraintSolverType.html @@ -1,10 +1,11 @@ -oimo.dynamics.constraint.solver.ConstraintSolverType - OimoPhysics API documentation

The list of the constraint solvers.

Static variables

@:value(_DIRECT)staticread onlyDIRECT:Int = _DIRECT

Direct constraint solver. Very stable but not suitable for a situation where fast -computation is required.

@:value(_ITERATIVE)staticread onlyITERATIVE:Int = _ITERATIVE

Iterative constraint solver. Fast and stable enough for common usages.

\ No newline at end of file +} +

The list of the constraint solvers.

Static variables

@:value(_DIRECT)staticread onlyDIRECT:Int = _DIRECT

Direct constraint solver. Very stable but not suitable for a situation where fast +computation is required.

@:value(_ITERATIVE)staticread onlyITERATIVE:Int = _ITERATIVE

Iterative constraint solver. Fast and stable enough for common usages.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/direct/DirectJointConstraintSolver.html b/docs/oimo/dynamics/constraint/solver/direct/DirectJointConstraintSolver.html index e8f8e00..9857804 100644 --- a/docs/oimo/dynamics/constraint/solver/direct/DirectJointConstraintSolver.html +++ b/docs/oimo/dynamics/constraint/solver/direct/DirectJointConstraintSolver.html @@ -1,11 +1,12 @@ -oimo.dynamics.constraint.solver.direct.DirectJointConstraintSolver - OimoPhysics API documentation

The direct solver of a mixed linear complementality problem (MLCP) for -joint constraints.

Methods

Inherited Variables

Inherited Methods

\ No newline at end of file +} +

The direct solver of a mixed linear complementality problem (MLCP) for +joint constraints.

Methods

Inherited Variables

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/direct/index.html b/docs/oimo/dynamics/constraint/solver/direct/index.html index 68433b2..e4acb59 100644 --- a/docs/oimo/dynamics/constraint/solver/direct/index.html +++ b/docs/oimo/dynamics/constraint/solver/direct/index.html @@ -1,10 +1,11 @@ -oimo.dynamics.constraint.solver.direct - OimoPhysics API documentation

oimo.dynamics.constraint.solver.direct

OimoPhysics API Documentation

..
DirectJointConstraintSolver

The direct solver of a mixed linear complementality problem (MLCP) for -joint constraints.

\ No newline at end of file +} +

oimo.dynamics.constraint.solver.direct

OimoPhysics API Documentation

..
DirectJointConstraintSolver

The direct solver of a mixed linear complementality problem (MLCP) for +joint constraints.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/index.html b/docs/oimo/dynamics/constraint/solver/index.html index 01cceae..59f6900 100644 --- a/docs/oimo/dynamics/constraint/solver/index.html +++ b/docs/oimo/dynamics/constraint/solver/index.html @@ -1,9 +1,10 @@ -oimo.dynamics.constraint.solver - OimoPhysics API documentation

oimo.dynamics.constraint.solver

OimoPhysics API Documentation

..
direct
pgs
ConstraintSolverType

The list of the constraint solvers.

\ No newline at end of file +} +

oimo.dynamics.constraint.solver

OimoPhysics API Documentation

..
direct
pgs
ConstraintSolverType

The list of the constraint solvers.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/pgs/PgsContactConstraintSolver.html b/docs/oimo/dynamics/constraint/solver/pgs/PgsContactConstraintSolver.html index 0ac05e1..b0d758d 100644 --- a/docs/oimo/dynamics/constraint/solver/pgs/PgsContactConstraintSolver.html +++ b/docs/oimo/dynamics/constraint/solver/pgs/PgsContactConstraintSolver.html @@ -1,10 +1,11 @@ -oimo.dynamics.constraint.solver.pgs.PgsContactConstraintSolver - OimoPhysics API documentation

A contact constraint solver using projected Gauss-Seidel (sequential impulse).

Methods

Inherited Variables

Inherited Methods

Defined by ConstraintSolver

postSolveVelocity(timeStep:TimeStep):Void

Performs post-processes of velocity part. Time step information timeStep is given -for computing time-depending data.

\ No newline at end of file +} +

A contact constraint solver using projected Gauss-Seidel (sequential impulse).

Methods

Inherited Variables

Inherited Methods

Defined by ConstraintSolver

postSolveVelocity(timeStep:TimeStep):Void

Performs post-processes of velocity part. Time step information timeStep is given +for computing time-depending data.

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/pgs/PgsJointConstraintSolver.html b/docs/oimo/dynamics/constraint/solver/pgs/PgsJointConstraintSolver.html index 98441f1..c6a6114 100644 --- a/docs/oimo/dynamics/constraint/solver/pgs/PgsJointConstraintSolver.html +++ b/docs/oimo/dynamics/constraint/solver/pgs/PgsJointConstraintSolver.html @@ -1,9 +1,10 @@ -oimo.dynamics.constraint.solver.pgs.PgsJointConstraintSolver - OimoPhysics API documentation

A joint constraint solver using projected Gauss-Seidel (sequential impulse).

Methods

Inherited Variables

Inherited Methods

\ No newline at end of file +} +

A joint constraint solver using projected Gauss-Seidel (sequential impulse).

Methods

Inherited Variables

Inherited Methods

\ No newline at end of file diff --git a/docs/oimo/dynamics/constraint/solver/pgs/index.html b/docs/oimo/dynamics/constraint/solver/pgs/index.html index 0051d08..55b67da 100644 --- a/docs/oimo/dynamics/constraint/solver/pgs/index.html +++ b/docs/oimo/dynamics/constraint/solver/pgs/index.html @@ -1,9 +1,10 @@ -oimo.dynamics.constraint.solver.pgs - OimoPhysics API documentation

oimo.dynamics.constraint.solver.pgs

OimoPhysics API Documentation

..
PgsContactConstraintSolver

A contact constraint solver using projected Gauss-Seidel (sequential impulse).

PgsJointConstraintSolver

A joint constraint solver using projected Gauss-Seidel (sequential impulse).

\ No newline at end of file +} +

oimo.dynamics.constraint.solver.pgs

OimoPhysics API Documentation

..
PgsContactConstraintSolver

A contact constraint solver using projected Gauss-Seidel (sequential impulse).

PgsJointConstraintSolver

A joint constraint solver using projected Gauss-Seidel (sequential impulse).

\ No newline at end of file diff --git a/docs/oimo/dynamics/index.html b/docs/oimo/dynamics/index.html index d778581..018fba1 100644 --- a/docs/oimo/dynamics/index.html +++ b/docs/oimo/dynamics/index.html @@ -1,15 +1,16 @@ -oimo.dynamics - OimoPhysics API documentation

oimo.dynamics

OimoPhysics API Documentation

..
callback
common
constraint
rigidbody
Contact

A contact is a cached pair of overlapping shapes in the physics world. contacts +} +

oimo.dynamics

OimoPhysics API Documentation

..
callback
common
constraint
rigidbody
Contact

A contact is a cached pair of overlapping shapes in the physics world. contacts are created by ContactManager when two AABBs of shapes begin overlapping.

ContactLink

A contact link is used to build a constraint graph for clustering rigid bodies. In a constraint graph, rigid bodies are nodes and constraints are edges. See also JointLink.

ContactManager

The manager of the contacts in the physics world. A contact of two shapes is created when the AABBs of them begin overlapping, and is destroyed when they end overlapping.

TimeStep

Information of time-step sizes of the simulation.

World

The physics simulation world. This manages entire the dynamic simulation. You can add -rigid bodies and joints to the world to simulate them.

\ No newline at end of file +rigid bodies and joints to the world to simulate them.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/MassData.html b/docs/oimo/dynamics/rigidbody/MassData.html index 2e2d882..9625099 100644 --- a/docs/oimo/dynamics/rigidbody/MassData.html +++ b/docs/oimo/dynamics/rigidbody/MassData.html @@ -1,9 +1,10 @@ -oimo.dynamics.rigidbody.MassData - OimoPhysics API documentation

This class holds mass and moment of inertia for a rigid body.

Constructor

new()

Default constructor.

Variables

localInertia:Mat3

Inertia tensor in local space. Zero matrix for a non-dynamic rigid body.

mass:Float

Mass. 0 for a non-dynamic rigid body.

\ No newline at end of file +} +

This class holds mass and moment of inertia for a rigid body.

Constructor

new()

Default constructor.

Variables

localInertia:Mat3

Inertia tensor in local space. Zero matrix for a non-dynamic rigid body.

mass:Float

Mass. 0 for a non-dynamic rigid body.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/RigidBody.html b/docs/oimo/dynamics/rigidbody/RigidBody.html index e98bec9..075abbb 100644 --- a/docs/oimo/dynamics/rigidbody/RigidBody.html +++ b/docs/oimo/dynamics/rigidbody/RigidBody.html @@ -1,16 +1,17 @@ -oimo.dynamics.rigidbody.RigidBody - OimoPhysics API documentationoimo.dynamics.rigidbody.RigidBody - OimoPhysics API documentation

A rigid body. To add a rigid body to a physics world, create a RigidBody +} +

A rigid body. To add a rigid body to a physics world, create a RigidBody instance, create and add shapes via RigidBody.addShape, and add the rigid body to the physics world through World.addRigidBody. Rigid bodies have three motion types: dynamic, static, and kinematic. See RigidBodyType for @@ -46,4 +47,4 @@

This does not keep any references to transform.

setType(type:Int):Void

Sets the rigid body's type of behaviour.

See RigidBodyType class for details.

inlinesleep():Void

Sets the rigid body's sleep flag true.

This also resets the sleeping timer of the rigid body.

inlinetranslate(translation:Vec3):Void

Translates the position of the rigid body by translation.

inlinewakeUp():Void

Sets the rigid body's sleep flag false.

-

This also resets the sleeping timer of the rigid body.

\ No newline at end of file +

This also resets the sleeping timer of the rigid body.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/RigidBodyConfig.html b/docs/oimo/dynamics/rigidbody/RigidBodyConfig.html index ff1362c..353b40d 100644 --- a/docs/oimo/dynamics/rigidbody/RigidBodyConfig.html +++ b/docs/oimo/dynamics/rigidbody/RigidBodyConfig.html @@ -1,16 +1,17 @@ -oimo.dynamics.rigidbody.RigidBodyConfig - OimoPhysics API documentationoimo.dynamics.rigidbody.RigidBodyConfig - OimoPhysics API documentation

A rigid body configuration is used for constructions of rigid bodies. An instance of this +} +

A rigid body configuration is used for constructions of rigid bodies. An instance of this class can safely be reused, as a rigid body will not have any references to a field of this class.

Constructor

new()

Default constructor.

Variables

angularDamping:Float

The damping coefficient of the angular velocity. Set positive values to gradually reduce the angular velocity.

angularVelocity:Vec3

The initial value of the rigid body's angular velocity.

autoSleep:Bool

Whether to automatically sleep the rigid body when it stops moving -for a certain period of time, namely Setting.sleepingTimeThreshold.

linearDamping:Float

The damping coefficient of the linear velocity. Set positive values to -gradually reduce the linear velocity.

linearVelocity:Vec3

The initial value of the rigid body's linear velocity.

position:Vec3

The world position of the rigid body's center of gravity.

rotation:Mat3

The rotation matrix of the rigid body.

type:Int

The rigid body's motion type. See RigidBodyType for details.

\ No newline at end of file +for a certain period of time, namely sleepingTimeThreshold.

linearDamping:Float

The damping coefficient of the linear velocity. Set positive values to +gradually reduce the linear velocity.

linearVelocity:Vec3

The initial value of the rigid body's linear velocity.

position:Vec3

The world position of the rigid body's center of gravity.

rotation:Mat3

The rotation matrix of the rigid body.

sleepingAngularVelocityThreshold:Float

The angular velocity threshold to sleep the rigid body.

sleepingTimeThreshold:Float

The time threshold to sleep the rigid body.

sleepingVelocityThreshold:Float

The linear velocity threshold to sleep the rigid body.

type:Int

The rigid body's motion type. See RigidBodyType for details.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/RigidBodyType.html b/docs/oimo/dynamics/rigidbody/RigidBodyType.html index 3aafb52..bff086a 100644 --- a/docs/oimo/dynamics/rigidbody/RigidBodyType.html +++ b/docs/oimo/dynamics/rigidbody/RigidBodyType.html @@ -1,14 +1,15 @@ -oimo.dynamics.rigidbody.RigidBodyType - OimoPhysics API documentation

The list of a rigid body's motion types.

Static variables

@:value(_DYNAMIC)staticread onlyDYNAMIC:Int = _DYNAMIC

Represents a dynamic rigid body. A dynamic rigid body has finite mass (and usually inertia +} +

The list of a rigid body's motion types.

Static variables

@:value(_DYNAMIC)staticread onlyDYNAMIC:Int = _DYNAMIC

Represents a dynamic rigid body. A dynamic rigid body has finite mass (and usually inertia tensor). The rigid body is affected by gravity, or by constraints the rigid body is involved.

@:value(_KINEMATIC)staticread onlyKINEMATIC:Int = _KINEMATIC

Represents a kinematic rigid body. A kinematic rigid body is similar to a static one, except that it can have non-zero linear and angular velocities. This is useful for overlapping rigid bodies to pre-computed motions.

@:value(_STATIC)staticread onlySTATIC:Int = _STATIC

Represents a static rigid body. A static rigid body has zero velocities and infinite mass and inertia tensor. The rigid body is not affected by any force or impulse, such as gravity, -constraints, or external forces or impulses added by an user.

\ No newline at end of file +constraints, or external forces or impulses added by an user.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/Shape.html b/docs/oimo/dynamics/rigidbody/Shape.html index bba13a1..890721d 100644 --- a/docs/oimo/dynamics/rigidbody/Shape.html +++ b/docs/oimo/dynamics/rigidbody/Shape.html @@ -1,14 +1,15 @@ -oimo.dynamics.rigidbody.Shape - OimoPhysics API documentationoimo.dynamics.rigidbody.Shape - OimoPhysics API documentation

A shape is a component of a rigid body. It attaches a collision geometry to the parent rigid body +} +

A shape is a component of a rigid body. It attaches a collision geometry to the parent rigid body with some physical properties such as coefficients of friction and restitution. The collision geometry can locally be transformed relative to the parent rigid body's center of gravity.

Constructor

new(config:ShapeConfig)

Creates a new shape by configuration config.

Variables

userData:Any

Extra field that users can use for their own purposes.

Methods

inlinegetAabb():Aabb

Returns the AABB of the shape. The AABB may be incorrect if the shape doesn't have a parent rigid body.

inlinegetAabbTo(aabb:Aabb):Void

Sets aabb to the AABB of the shape. The AABB may be incorrect if the shape doesn't have a @@ -21,4 +22,4 @@ rigid body.

inlinegetTransform():Transform

Returns the world transform of the shape.

inlinegetTransformTo(transform:Transform):Void

Sets transform to the world transform of the shape.

This does not create a new instance of Transform.

inlinesetCollisionGroup(collisionGroup:Int):Void

Sets the shape's collision group bits to collisionGroup.

inlinesetCollisionMask(collisionMask:Int):Void

Sets the shape's collision mask bits to collisionMask.

inlinesetContactCallback(callback:ContactCallback):Void

Sets the contact callback of the shape to callback.

inlinesetDensity(density:Float):Void

Sets the density of the shape to density.

This affects the parent rigid body's mass data.

inlinesetFriction(friction:Float):Void

Sets the coefficient of friction to friction.

inlinesetLocalTransform(transform:Transform):Void

Sets the shape's transform to transform relative to the parent rigid body's transform.

-

This affects the parent rigid body's mass data.

inlinesetRestitution(restitution:Float):Void

Sets the coefficient of restitution to restitution.

\ No newline at end of file +

This affects the parent rigid body's mass data.

inlinesetRestitution(restitution:Float):Void

Sets the coefficient of restitution to restitution.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/ShapeConfig.html b/docs/oimo/dynamics/rigidbody/ShapeConfig.html index 6734ac9..3245b07 100644 --- a/docs/oimo/dynamics/rigidbody/ShapeConfig.html +++ b/docs/oimo/dynamics/rigidbody/ShapeConfig.html @@ -1,14 +1,15 @@ -oimo.dynamics.rigidbody.ShapeConfig - OimoPhysics API documentationoimo.dynamics.rigidbody.ShapeConfig - OimoPhysics API documentation

A shape configuration is used for construction of shapes. An instance of +} +

A shape configuration is used for construction of shapes. An instance of this class can safely be reused as a shape will not have any references of a field of this class.

Constructor

new()

Default constructor.

Variables

collisionGroup:Int

The collision group bits the shape belongs to. This is used for collision filtering.

@@ -20,4 +21,4 @@ shape1.collisionGroup & shape2.collisionMask and shape2.collisionGroup & shape1.collisionMask are not zero.

contactCallback:ContactCallback

The contact callback of the shape. The callback methods are called when contact events the shape is involved occurred.

density:Float

The density of the shape, usually in Kg/m^3.

friction:Float

The coefficient of friction of the shape.

geometry:Geometry

The collision geometry of the shape.

position:Vec3

The shape's local position relative to the parent rigid body's origin.

restitution:Float

The coefficient of restitution of the shape.

rotation:Mat3

The shape's local rotation matrix relative to the parent rigid body's -rotation.

\ No newline at end of file +rotation.

\ No newline at end of file diff --git a/docs/oimo/dynamics/rigidbody/index.html b/docs/oimo/dynamics/rigidbody/index.html index cc4308e..9755f59 100644 --- a/docs/oimo/dynamics/rigidbody/index.html +++ b/docs/oimo/dynamics/rigidbody/index.html @@ -1,12 +1,13 @@ -oimo.dynamics.rigidbody - OimoPhysics API documentation

oimo.dynamics.rigidbody

OimoPhysics API Documentation

..
MassData

This class holds mass and moment of inertia for a rigid body.

RigidBody

A rigid body. To add a rigid body to a physics world, create a RigidBody +} +

oimo.dynamics.rigidbody

OimoPhysics API Documentation

..
MassData

This class holds mass and moment of inertia for a rigid body.

RigidBody

A rigid body. To add a rigid body to a physics world, create a RigidBody instance, create and add shapes via RigidBody.addShape, and add the rigid body to the physics world through World.addRigidBody. Rigid bodies have three motion types: dynamic, static, and kinematic. See RigidBodyType for @@ -16,4 +17,4 @@ with some physical properties such as coefficients of friction and restitution. The collision geometry can locally be transformed relative to the parent rigid body's center of gravity.

ShapeConfig

A shape configuration is used for construction of shapes. An instance of this class can safely be reused as a shape will not have any references -of a field of this class.

\ No newline at end of file +of a field of this class.

\ No newline at end of file diff --git a/docs/oimo/index.html b/docs/oimo/index.html index f18a13e..92222db 100644 --- a/docs/oimo/index.html +++ b/docs/oimo/index.html @@ -1,9 +1,10 @@ -oimo - OimoPhysics API documentation

oimo

OimoPhysics API Documentation

..
collision
common
dynamics
\ No newline at end of file +} +

oimo

OimoPhysics API Documentation

..
collision
common
dynamics
\ No newline at end of file diff --git a/package.json b/package.json index b02749f..07a3071 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oimophysics", - "version": "1.2.4", + "version": "1.2.5", "description": "A lightweight 3D physics engine.", "type": "module", "main": "./bin/js_modules/OimoPhysics.js",