├── .DS_Store ├── .gitignore ├── .project ├── README ├── build ├── build.xml ├── buildtodemo.xml ├── output │ ├── docs │ │ ├── files.html │ │ ├── index.html │ │ └── symbols │ │ │ ├── AbstractPhysics.html │ │ │ ├── BodyPair.html │ │ │ ├── CachedImpulse.html │ │ │ ├── CollDetectBoxBox.html │ │ │ ├── CollDetectBoxPlane.html │ │ │ ├── CollDetectBoxTerrain.html │ │ │ ├── CollDetectCapsuleBox.html │ │ │ ├── CollDetectCapsuleCapsule.html │ │ │ ├── CollDetectCapsulePlane.html │ │ │ ├── CollDetectCapsuleTerrain.html │ │ │ ├── CollDetectFunctor.html │ │ │ ├── CollDetectInfo.html │ │ │ ├── CollDetectSphereBox.html │ │ │ ├── CollDetectSphereCapsule.html │ │ │ ├── CollDetectSpherePlane.html │ │ │ ├── CollDetectSphereSphere.html │ │ │ ├── CollDetectSphereTerrain.html │ │ │ ├── CollPointInfo.html │ │ │ ├── CollisionInfo.html │ │ │ ├── CollisionSystem.html │ │ │ ├── ContactData.html │ │ │ ├── EdgeData.html │ │ │ ├── Explosion.html │ │ │ ├── GravityField.html │ │ │ ├── HingeJoint.html │ │ │ ├── ISkin3D.html │ │ │ ├── ITerrain.html │ │ │ ├── JAABox.html │ │ │ ├── JBox.html │ │ │ ├── JCapsule.html │ │ │ ├── JCar.html │ │ │ ├── JChassis.html │ │ │ ├── JCollisionEvent.html │ │ │ ├── JConstraint.html │ │ │ ├── JConstraintMaxDistance.html │ │ │ ├── JConstraintPoint.html │ │ │ ├── JConstraintWorldPoint.html │ │ │ ├── JEffect.html │ │ │ ├── JEvent.html │ │ │ ├── JEventDispatcher.html │ │ │ ├── JMath3D.html │ │ │ ├── JMatrix3D.html │ │ │ ├── JNumber3D.html │ │ │ ├── JPlane.html │ │ │ ├── JRay.html │ │ │ ├── JSegment.html │ │ │ ├── JSphere.html │ │ │ ├── JTerrain.html │ │ │ ├── JWheel.html │ │ │ ├── MaterialProperties.html │ │ │ ├── Matrix3D.html │ │ │ ├── PhysicsController.html │ │ │ ├── PhysicsState.html │ │ │ ├── PhysicsSystem.html │ │ │ ├── PlaneData.html │ │ │ ├── RigidBody.html │ │ │ ├── SpanData.html │ │ │ ├── Vector3DUtil.html │ │ │ ├── Wind.html │ │ │ ├── _global_.html │ │ │ ├── jigLib.JConfig.html │ │ │ ├── jigLib.html │ │ │ └── src │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_cof_jconfig.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectboxbox.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectboxmesh.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectboxplane.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectboxterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectcapsulebox.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectcapsulecapsule.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectcapsuleplane.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectcapsuleterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectfunctor.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectinfo.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectspherebox.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectspherecapsule.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectspheremesh.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectsphereplane.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectspheresphere.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectsphereterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisioninfo.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisionsystem.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisionsystemabstract.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisionsystembrute.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisionsystemgrid.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collisionsystemgridentry.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_collpointinfo.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_CollOutBodyData.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_CollOutData.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_OctreeCell.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_TriangleVertexIndices.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_contactdata.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_edgedata.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_planedata.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_spandata.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_events_JCollisionEvent.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_events_JEvent.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_events_JEventDispatcher.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_JIndexedTriangle.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_JOctree.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_JTriangle.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_JTriangleMesh.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jaabox.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jbox.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jcapsule.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jimageterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jplane.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jray.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jsegment.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jsphere.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_geometry_jterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_jiglib.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_glmatrix.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_jmaths3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_jmatrix3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_jnumber3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_matrix3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_oldmatrix3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_maths_vector3dutil.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_bodypair.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_cachedimpluse.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_constraint_jconstraint.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_constraint_jconstraintmaxdistance.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_constraint_jconstraintpoint.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_constraint_jconstraintworldpoint.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_effect_explosion.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_effect_gravityField.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_effect_jeffect.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_effect_wind.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_hingejoint.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_materialproperties.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_physicscontroller.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_physicsstate.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_physicssystem.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_physics_rigid_body.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_plugins_abstractphysics.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_plugins_iskin3d.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_plugins_iterrain.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_vehicles_jcar.js.html │ │ │ ├── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_vehicles_jchassis.js.html │ │ │ └── _Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_vehicles_jwheel.js.html │ ├── jiglib.all.full.js │ ├── jiglib.all.min.js │ ├── jiglib_code.tar │ └── jiglib_docs.tar └── tasks │ ├── JSDoc │ ├── js_rhino_17R1.jar │ ├── js_rhino_17R2.jar │ ├── js_rhino_17R3pre.jar │ ├── jsdoc-toolkit-2.4.0 │ │ ├── README.txt │ │ ├── app │ │ │ ├── frame.js │ │ │ ├── frame │ │ │ │ ├── Chain.js │ │ │ │ ├── Dumper.js │ │ │ │ ├── Hash.js │ │ │ │ ├── Link.js │ │ │ │ ├── Namespace.js │ │ │ │ ├── Opt.js │ │ │ │ ├── Reflection.js │ │ │ │ ├── String.js │ │ │ │ └── Testrun.js │ │ │ ├── handlers │ │ │ │ ├── FOODOC.js │ │ │ │ ├── XMLDOC.js │ │ │ │ └── XMLDOC │ │ │ │ │ ├── DomReader.js │ │ │ │ │ ├── XMLDoc.js │ │ │ │ │ └── XMLParse.js │ │ │ ├── lib │ │ │ │ ├── JSDOC.js │ │ │ │ └── JSDOC │ │ │ │ │ ├── DocComment.js │ │ │ │ │ ├── DocTag.js │ │ │ │ │ ├── JsDoc.js │ │ │ │ │ ├── JsPlate.js │ │ │ │ │ ├── Lang.js │ │ │ │ │ ├── Parser.js │ │ │ │ │ ├── PluginManager.js │ │ │ │ │ ├── Symbol.js │ │ │ │ │ ├── SymbolSet.js │ │ │ │ │ ├── TextStream.js │ │ │ │ │ ├── Token.js │ │ │ │ │ ├── TokenReader.js │ │ │ │ │ ├── TokenStream.js │ │ │ │ │ ├── Util.js │ │ │ │ │ └── Walker.js │ │ │ ├── main.js │ │ │ ├── plugins │ │ │ │ ├── commentSrcJson.js │ │ │ │ ├── frameworkPrototype.js │ │ │ │ ├── functionCall.js │ │ │ │ ├── publishSrcHilite.js │ │ │ │ ├── symbolLink.js │ │ │ │ ├── tagParamConfig.js │ │ │ │ └── tagSynonyms.js │ │ │ ├── run.js │ │ │ ├── t │ │ │ │ ├── TestDoc.js │ │ │ │ └── runner.js │ │ │ ├── test.js │ │ │ └── test │ │ │ │ ├── addon.js │ │ │ │ ├── anon_inner.js │ │ │ │ ├── augments.js │ │ │ │ ├── augments2.js │ │ │ │ ├── borrows.js │ │ │ │ ├── borrows2.js │ │ │ │ ├── config.js │ │ │ │ ├── constructs.js │ │ │ │ ├── encoding.js │ │ │ │ ├── encoding_other.js │ │ │ │ ├── event.js │ │ │ │ ├── exports.js │ │ │ │ ├── functions_anon.js │ │ │ │ ├── functions_nested.js │ │ │ │ ├── global.js │ │ │ │ ├── globals.js │ │ │ │ ├── ignore.js │ │ │ │ ├── inner.js │ │ │ │ ├── jsdoc_test.js │ │ │ │ ├── lend.js │ │ │ │ ├── memberof.js │ │ │ │ ├── memberof2.js │ │ │ │ ├── memberof3.js │ │ │ │ ├── memberof_constructor.js │ │ │ │ ├── module.js │ │ │ │ ├── multi_methods.js │ │ │ │ ├── name.js │ │ │ │ ├── namespace_nested.js │ │ │ │ ├── nocode.js │ │ │ │ ├── oblit_anon.js │ │ │ │ ├── overview.js │ │ │ │ ├── param_inline.js │ │ │ │ ├── params_optional.js │ │ │ │ ├── prototype.js │ │ │ │ ├── prototype_nested.js │ │ │ │ ├── prototype_oblit.js │ │ │ │ ├── prototype_oblit_constructor.js │ │ │ │ ├── public.js │ │ │ │ ├── scripts │ │ │ │ ├── code.js │ │ │ │ └── notcode.txt │ │ │ │ ├── shared.js │ │ │ │ ├── shared2.js │ │ │ │ ├── shortcuts.js │ │ │ │ ├── static_this.js │ │ │ │ ├── synonyms.js │ │ │ │ ├── tosource.js │ │ │ │ └── variable_redefine.js │ │ ├── changes.txt │ │ ├── conf │ │ │ └── sample.conf │ │ ├── java │ │ │ ├── build.xml │ │ │ ├── build_1.4.xml │ │ │ ├── classes │ │ │ │ └── js.jar │ │ │ └── src │ │ │ │ ├── JsDebugRun.java │ │ │ │ └── JsRun.java │ │ ├── jsdebug.jar │ │ ├── jsrun.jar │ │ ├── jsrun.sh │ │ └── templates │ │ │ └── jsdoc │ │ │ ├── allclasses.tmpl │ │ │ ├── allfiles.tmpl │ │ │ ├── class.tmpl │ │ │ ├── index.tmpl │ │ │ ├── publish.js │ │ │ ├── static │ │ │ ├── default.css │ │ │ ├── header.html │ │ │ └── index.html │ │ │ └── symbol.tmpl │ └── jsdoctoolkit-ant-task-1.0.2.jar │ └── YUICompress │ ├── YUIAnt.jar │ └── yuicompressor-2.4.2.jar ├── cof └── jconfig.js ├── collision ├── colldetectboxbox.js ├── colldetectboxmesh.js ├── colldetectboxplane.js ├── colldetectboxterrain.js ├── colldetectcapsulebox.js ├── colldetectcapsulecapsule.js ├── colldetectcapsuleplane.js ├── colldetectcapsuleterrain.js ├── colldetectfunctor.js ├── colldetectinfo.js ├── colldetectspherebox.js ├── colldetectspherecapsule.js ├── colldetectspheremesh.js ├── colldetectsphereplane.js ├── colldetectspheresphere.js ├── colldetectsphereterrain.js ├── collisioninfo.js ├── collisionsystem.js ├── collisionsystemabstract.js ├── collisionsystembrute.js ├── collisionsystemgrid.js ├── collisionsystemgridentry.js └── collpointinfo.js ├── data ├── colloutbodydata.js ├── colloutdata.js ├── contactdata.js ├── edgedata.js ├── octreecell.js ├── planedata.js ├── spandata.js └── trianglevertexindices.js ├── events ├── JCollisionEvent.js ├── JEvent.js └── JEventDispatcher.js ├── geometry ├── jaabox.js ├── jbox.js ├── jcapsule.js ├── jimageterrain.js ├── jindexedtriangle.js ├── joctree.js ├── jplane.js ├── jray.js ├── jsegment.js ├── jsphere.js ├── jterrain.js ├── jtriangle.js └── jtrianglemesh.js ├── jiglib.js ├── maths ├── glmatrix.js ├── jmaths3d.js ├── jmatrix3d.js ├── jnumber3d.js ├── matrix3d.js ├── oldmatrix3d.js └── vector3dutil.js ├── official_demos ├── .gitignore ├── collisions_mixed.htm ├── collisions_similar.htm ├── constraints_point.htm ├── effects_explosion.htm ├── effects_gravityfield.htm ├── effects_wind.htm ├── events_collision.htm ├── glge │ └── glge-compiled-min.js ├── grid.png ├── index.htm └── slider │ ├── .gitignore │ ├── range.js │ ├── slider.js │ ├── timer.js │ └── winclassic.css ├── physics ├── bodypair.js ├── cachedimpluse.js ├── constraint │ ├── jconstraint.js │ ├── jconstraintmaxdistance.js │ ├── jconstraintpoint.js │ └── jconstraintworldpoint.js ├── effect │ ├── explosion.js │ ├── gravityField.js │ ├── jeffect.js │ └── wind.js ├── hingejoint.js ├── materialproperties.js ├── physicscontroller.js ├── physicsstate.js ├── physicssystem.js └── rigid_body.js ├── plugins ├── abstractphysics.js ├── iskin3d.js └── iterrain.js └── vehicles ├── jcar.js ├── jchassis.js └── jwheel.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /test 2 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JigLibJS 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.wst.jsdt.core.jsNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | prerelease - coming soon 2 | This release is mainly due to the great foundation the JigLibFlash guys have put in place, big thanks you from me and I'm sure everyone else. 3 | 4 | http://www.jiglibflash.com/blog/ 5 | -------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_collision_colldetectinfo.js.html: -------------------------------------------------------------------------------- 1 |
  1 /*
 9 |   2    Copyright (c) 2007 Danny Chapman
10 |   3    http://www.rowlhouse.co.uk
11 |   4 
12 |   5    This software is provided 'as-is', without any express or implied
13 |   6    warranty. In no event will the authors be held liable for any damages
14 |   7    arising from the use of this software.
15 |   8    Permission is granted to anyone to use this software for any purpose,
16 |   9    including commercial applications, and to alter it and redistribute it
17 |  10    freely, subject to the following restrictions:
18 |  11    1. The origin of this software must not be misrepresented; you must not
19 |  12    claim that you wrote the original software. If you use this software
20 |  13    in a product, an acknowledgment in the product documentation would be
21 |  14    appreciated but is not required.
22 |  15    2. Altered source versions must be plainly marked as such, and must not be
23 |  16    misrepresented as being the original software.
24 |  17    3. This notice may not be removed or altered from any source
25 |  18    distribution.
26 |  19  */
27 |  20 
28 |  21  (function(jigLib){
29 |  22 	 /**
30 |  23 	  * @author Muzer(muzerly@gmail.com)
31 |  24 	  * 
32 |  25 	  * @name CollDetectInfo
33 |  26 	  * @class CollDetectInfo stores 2 rigid bodies and is used by collision detection classes
34 |  27 	  * @property {RigidBody} body0
35 |  28 	  * @property {RigidBody} body1
36 |  29 	  * @constructor
37 |  30 	  */
38 |  31 	 var CollDetectInfo=function(){
39 |  32 	 };
40 |  33 	 CollDetectInfo.prototype.body0=null;
41 |  34 	 CollDetectInfo.prototype.body1=null;
42 |  35 	 
43 |  36 	 jigLib.CollDetectInfo=CollDetectInfo;
44 |  37  })(jigLib);
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_CollOutBodyData.js.html: -------------------------------------------------------------------------------- 1 |
  1 (function(jigLib){
 9 |   2 	var Vector3DUtil=jigLib.Vector3DUtil;
10 |   3 	var RigidBody=jigLib.RigidBody;
11 |   4 	
12 |   5 	var CollOutBodyData=function(frac, positionl, normal, rigidBody){
13 |   6 		if(frac==undefined) frac=0;
14 |   7 		this.Super(frac, position, normal);
15 |   8 		this.rigidBody = rigidBody;
16 |   9 	};
17 |  10 	jigLib.extend(CollOutBodyData,jigLib.CollOutData);
18 |  11 	
19 |  12 	jigLib.CollOutBodyData=CollOutBodyData;
20 |  13 
21 |  14 })(jigLib);	
22 |  15 	
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_TriangleVertexIndices.js.html: -------------------------------------------------------------------------------- 1 |
  1 
 9 |   2 (function(jigLib){
10 |   3         // structure used to set up the mesh
11 |   4 	var TriangleVertexIndices=function(_i0, _i1, _i2){
12 |   5 		this.i0 = _i0;
13 |   6 		this.i1 = _i1;
14 |   7 		this.i2 = _i2;
15 |   8 	}
16 |   9 	
17 |  10 	jigLib.TriangleVertexIndices=TriangleVertexIndices;
18 |  11 
19 |  12 })(jigLib);	
20 |  13 
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_contactdata.js.html: -------------------------------------------------------------------------------- 1 |
  1 (function(jigLib){
 9 |   2 	/**
10 |   3 	 * @author katopz
11 |   4 	 * 
12 |   5 	 * @name ContactData
13 |   6 	 * @class ContactData stores information about a contact between 2 objects
14 |   7 	 * @property {BodyPair} pair
15 |   8 	 * @property {CachedImpulse} impulse
16 |   9 	 * @constructor
17 |  10 	 **/
18 |  11 	var ContactData=function(){};
19 |  12 	ContactData.prototype.pair=null;
20 |  13 	ContactData.prototype.impulse=null;
21 |  14 	
22 |  15 	jigLib.ContactData=ContactData;
23 |  16 })(jigLib);
24 |  17 
25 |  18 
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_edgedata.js.html: -------------------------------------------------------------------------------- 1 |
  1 
 9 |   2 (function(jigLib){
10 |   3 	/**
11 |   4 	 * @author katopz
12 |   5 	 * 
13 |   6 	 * @name EdgeData
14 |   7 	 * @class EdgeData describes an edge in terms of the numbers of it's connecting vertices - used by JBox 
15 |   8 	 * @property {number} ind0 the number of the vertex at the start of the edge
16 |   9 	 * @property {number} ind1 the number of the vertex at the end of the edge
17 |  10 	 * @constructor
18 |  11 	 **/
19 |  12 	var EdgeData=function(ind0, ind1){
20 |  13 		this.ind0 = ind0;
21 |  14 		this.ind1 = ind1;
22 |  15 	};
23 |  16 	
24 |  17 	jigLib.EdgeData=EdgeData;
25 |  18 })(jigLib);
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_data_spandata.js.html: -------------------------------------------------------------------------------- 1 |
  1 
 9 |   2 (function(jigLib){
10 |   3 	/**
11 |   4 	 * @author katopz
12 |   5 	 * 
13 |   6 	 * @name SpanData
14 |   7 	 * @class SpanData
15 |   8 	 * @property {number} min
16 |   9 	 * @property {number} max
17 |  10 	 * @property {boolean} flag
18 |  11 	 * @property {number} depth
19 |  12 	 * @constructor
20 |  13 	 **/
21 |  14 	var SpanData=function(){};
22 |  15 	SpanData.prototype.min=null;
23 |  16 	SpanData.prototype.max=null;
24 |  17 	SpanData.prototype.flag=null;
25 |  18 	SpanData.prototype.depth=null;
26 |  19 	
27 |  20 	jigLib.SpanData=SpanData;
28 |  21 })(jigLib);
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_events_JEvent.js.html: -------------------------------------------------------------------------------- 1 |
  1 (function(jigLib){
 9 |   2 	/**
10 |   3 	 * @author Jim Sangwine
11 |   4 	 * 
12 |   5 	 * @name JEvent
13 |   6 	 * @class JEvent Base class for JigLib events
14 |   7 	 * @constant {string} COLLISION
15 |   8 	 * @constructor
16 |   9 	 * @param type {string}
17 |  10 	 **/
18 |  11 	var JEvent=function(type)
19 |  12 	{
20 |  13 		this.type=type;
21 |  14 	};
22 |  15 	
23 |  16 	JEvent.prototype.type=null;
24 |  17 	
25 |  18 	Event.EVENT='JigLibJSEvent';
26 |  19 	
27 |  20 	jigLib.JEvent=JEvent;
28 |  21 })(jigLib);
-------------------------------------------------------------------------------- /build/output/docs/symbols/src/_Applications_MAMP_htdocs_SubVersionWorkingVersions_JS_JigLibJS_jiglib.js.html: -------------------------------------------------------------------------------- 1 |
  1 /**
 9 |   2  * @name jigLib
10 |   3  * @class jigLib the main library class
11 |   4  * @constructor
12 |   5  **/
13 |   6 jigLib={};
14 |   7 
15 |   8 /**
16 |   9  * @function extend handles class inheritance
17 |  10  * @param {} dest the child class
18 |  11  * @param {} source the parent class
19 |  12  * @type void
20 |  13  **/
21 |  14 jigLib.extend=function(dest,source){
22 |  15 	for(proto in source.prototype){
23 |  16 		dest.prototype[proto]=source.prototype[proto];
24 |  17 	}
25 |  18 	dest.prototype.Super=source;
26 |  19 };
-------------------------------------------------------------------------------- /build/tasks/JSDoc/js_rhino_17R1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/js_rhino_17R1.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/js_rhino_17R2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/js_rhino_17R2.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/js_rhino_17R3pre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/js_rhino_17R3pre.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame.js: -------------------------------------------------------------------------------- 1 | IO.include("frame/Opt.js"); 2 | IO.include("frame/Chain.js"); 3 | IO.include("frame/Link.js"); 4 | IO.include("frame/String.js"); 5 | IO.include("frame/Hash.js"); 6 | IO.include("frame/Namespace.js"); 7 | //IO.include("frame/Reflection.js"); 8 | 9 | /** A few helper functions to make life a little easier. */ 10 | 11 | function defined(o) { 12 | return (o !== undefined); 13 | } 14 | 15 | function copy(o) { // todo check for circular refs 16 | if (o == null || typeof(o) != 'object') return o; 17 | var c = new o.constructor(); 18 | for(var p in o) c[p] = copy(o[p]); 19 | return c; 20 | } 21 | 22 | function isUnique(arr) { 23 | var l = arr.length; 24 | for(var i = 0; i < l; i++ ) { 25 | if (arr.lastIndexOf(arr[i]) > i) return false; 26 | } 27 | return true; 28 | } 29 | 30 | /** Returns the given string with all regex meta characters backslashed. */ 31 | RegExp.escapeMeta = function(str) { 32 | return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1"); 33 | } 34 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Chain.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function ChainNode(object, link) { 3 | this.value = object; 4 | this.link = link; // describes this node's relationship to the previous node 5 | } 6 | 7 | /**@constructor*/ 8 | function Chain(valueLinks) { 9 | this.nodes = []; 10 | this.cursor = -1; 11 | 12 | if (valueLinks && valueLinks.length > 0) { 13 | this.push(valueLinks[0], "//"); 14 | for (var i = 1, l = valueLinks.length; i < l; i+=2) { 15 | this.push(valueLinks[i+1], valueLinks[i]); 16 | } 17 | } 18 | } 19 | 20 | Chain.prototype.push = function(o, link) { 21 | if (this.nodes.length > 0 && link) this.nodes.push(new ChainNode(o, link)); 22 | else this.nodes.push(new ChainNode(o)); 23 | } 24 | 25 | Chain.prototype.unshift = function(o, link) { 26 | if (this.nodes.length > 0 && link) this.nodes[0].link = link; 27 | this.nodes.unshift(new ChainNode(o)); 28 | this.cursor++; 29 | } 30 | 31 | Chain.prototype.get = function() { 32 | if (this.cursor < 0 || this.cursor > this.nodes.length-1) return null; 33 | return this.nodes[this.cursor]; 34 | } 35 | 36 | Chain.prototype.first = function() { 37 | this.cursor = 0; 38 | return this.get(); 39 | } 40 | 41 | Chain.prototype.last = function() { 42 | this.cursor = this.nodes.length-1; 43 | return this.get(); 44 | } 45 | 46 | Chain.prototype.next = function() { 47 | this.cursor++; 48 | return this.get(); 49 | } 50 | 51 | Chain.prototype.prev = function() { 52 | this.cursor--; 53 | return this.get(); 54 | } 55 | 56 | Chain.prototype.toString = function() { 57 | var string = ""; 58 | for (var i = 0, l = this.nodes.length; i < l; i++) { 59 | if (this.nodes[i].link) string += " -("+this.nodes[i].link+")-> "; 60 | string += this.nodes[i].value.toString(); 61 | } 62 | return string; 63 | } 64 | 65 | Chain.prototype.joinLeft = function() { 66 | var result = ""; 67 | for (var i = 0, l = this.cursor; i < l; i++) { 68 | if (result && this.nodes[i].link) result += this.nodes[i].link; 69 | result += this.nodes[i].value.toString(); 70 | } 71 | return result; 72 | } 73 | 74 | 75 | /* USAGE: 76 | 77 | var path = "one/two/three.four/five-six"; 78 | var pathChain = new Chain(path.split(/([\/.-])/)); 79 | print(pathChain); 80 | 81 | var lineage = new Chain(); 82 | lineage.push("Port"); 83 | lineage.push("Les", "son"); 84 | lineage.push("Dawn", "daughter"); 85 | lineage.unshift("Purdie", "son"); 86 | 87 | print(lineage); 88 | 89 | // walk left 90 | for (var node = lineage.last(); node !== null; node = lineage.prev()) { 91 | print("< "+node.value); 92 | } 93 | 94 | // walk right 95 | var node = lineage.first() 96 | while (node !== null) { 97 | print(node.value); 98 | node = lineage.next(); 99 | if (node && node.link) print("had a "+node.link+" named"); 100 | } 101 | 102 | */ -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Dumper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @class 3 |
  4 | This is a lightly modified version of Kevin Jones' JavaScript
  5 | library Data.Dump. To download the original visit:
  6 |     http://openjsan.org/doc/k/ke/kevinj/Data/Dump/
  7 | 
  8 | AUTHORS
  9 | 
 10 | The Data.Dump JavaScript module is written by Kevin Jones 
 11 | (kevinj@cpan.org), based on Data::Dump by Gisle Aas (gisle@aas.no),
 12 | based on Data::Dumper by Gurusamy Sarathy (gsar@umich.edu).
 13 | 
 14 | COPYRIGHT
 15 | 
 16 | Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
 17 | Copyright 1996-1998 Gurusamy Sarathy.
 18 | 
 19 | This program is free software; you can redistribute it and/or modify
 20 | it under the terms of the Perl Artistic License
 21 | 
 22 | See http://www.perl.com/perl/misc/Artistic.html
 23 | 
24 | * @static 25 | */ 26 | Dumper = { 27 | /** @param [...] The objects to dump. */ 28 | dump: function () { 29 | if (arguments.length > 1) 30 | return this._dump(arguments); 31 | else if (arguments.length == 1) 32 | return this._dump(arguments[0]); 33 | else 34 | return "()"; 35 | }, 36 | 37 | _dump: function (obj) { 38 | if (typeof obj == 'undefined') return 'undefined'; 39 | var out; 40 | if (obj.serialize) { return obj.serialize(); } 41 | var type = this._typeof(obj); 42 | if (obj.circularReference) obj.circularReference++; 43 | switch (type) { 44 | case 'circular': 45 | out = "{ //circularReference\n}"; 46 | break; 47 | case 'object': 48 | var pairs = new Array; 49 | 50 | for (var prop in obj) { 51 | if (prop != "circularReference" && obj.hasOwnProperty(prop)) { //hide inherited properties 52 | pairs.push(prop + ': ' + this._dump(obj[prop])); 53 | } 54 | } 55 | 56 | out = '{' + this._format_list(pairs) + '}'; 57 | break; 58 | 59 | case 'string': 60 | for (var prop in Dumper.ESC) { 61 | if (Dumper.ESC.hasOwnProperty(prop)) { 62 | obj = obj.replace(prop, Dumper.ESC[prop]); 63 | } 64 | } 65 | 66 | // Escape UTF-8 Strings 67 | if (obj.match(/^[\x00-\x7f]*$/)) { 68 | out = '"' + obj.replace(/\"/g, "\\\"").replace(/([\n\r]+)/g, "\\$1") + '"'; 69 | } 70 | else { 71 | out = "unescape('"+escape(obj)+"')"; 72 | } 73 | break; 74 | 75 | case 'array': 76 | var elems = new Array; 77 | 78 | for (var i=0; i 60 ? '\n' : ' '; 109 | return nl + list.join(',' + nl) + nl; 110 | }, 111 | 112 | _typeof: function (obj) { 113 | if (obj && obj.circularReference && obj.circularReference > 1) return 'circular'; 114 | if (Array.prototype.isPrototypeOf(obj)) return 'array'; 115 | if (Date.prototype.isPrototypeOf(obj)) return 'date'; 116 | if (typeof obj.nodeType != 'undefined') return 'element'; 117 | return typeof(obj); 118 | }, 119 | 120 | _dump_dom: function (obj) { 121 | return '"' + Dumper.nodeTypes[obj.nodeType] + '"'; 122 | } 123 | }; 124 | 125 | Dumper.ESC = { 126 | "\t": "\\t", 127 | "\n": "\\n", 128 | "\f": "\\f" 129 | }; 130 | 131 | Dumper.nodeTypes = { 132 | 1: "ELEMENT_NODE", 133 | 2: "ATTRIBUTE_NODE", 134 | 3: "TEXT_NODE", 135 | 4: "CDATA_SECTION_NODE", 136 | 5: "ENTITY_REFERENCE_NODE", 137 | 6: "ENTITY_NODE", 138 | 7: "PROCESSING_INSTRUCTION_NODE", 139 | 8: "COMMENT_NODE", 140 | 9: "DOCUMENT_NODE", 141 | 10: "DOCUMENT_TYPE_NODE", 142 | 11: "DOCUMENT_FRAGMENT_NODE", 143 | 12: "NOTATION_NODE" 144 | }; -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Hash.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | @example 4 | var _index = new Hash(); 5 | _index.set("a", "apple"); 6 | _index.set("b", "blue"); 7 | _index.set("c", "coffee"); 8 | 9 | for (var p = _index.first(); p; p = _index.next()) { 10 | print(p.key+" is for "+p.value); 11 | } 12 | 13 | */ 14 | var Hash = function() { 15 | this._map = {}; 16 | this._keys = []; 17 | this._vals = []; 18 | this.reset(); 19 | } 20 | 21 | Hash.prototype.set = function(k, v) { 22 | if (k != "") { 23 | this._keys.push(k); 24 | this._map["="+k] = this._vals.length; 25 | this._vals.push(v); 26 | } 27 | } 28 | 29 | Hash.prototype.replace = function(k, k2, v) { 30 | if (k == k2) return; 31 | 32 | var offset = this._map["="+k]; 33 | this._keys[offset] = k2; 34 | if (typeof v != "undefined") this._vals[offset] = v; 35 | this._map["="+k2] = offset; 36 | delete(this._map["="+k]); 37 | } 38 | 39 | Hash.prototype.drop = function(k) { 40 | if (k != "") { 41 | var offset = this._map["="+k]; 42 | this._keys.splice(offset, 1); 43 | this._vals.splice(offset, 1); 44 | delete(this._map["="+k]); 45 | for (var p in this._map) { 46 | if (this._map[p] >= offset) this._map[p]--; 47 | } 48 | if (this._cursor >= offset && this._cursor > 0) this._cursor--; 49 | } 50 | } 51 | 52 | Hash.prototype.get = function(k) { 53 | if (k != "") { 54 | return this._vals[this._map["="+k]]; 55 | } 56 | } 57 | 58 | Hash.prototype.keys = function() { 59 | return this._keys; 60 | } 61 | 62 | Hash.prototype.hasKey = function(k) { 63 | if (k != "") { 64 | return (typeof this._map["="+k] != "undefined"); 65 | } 66 | } 67 | 68 | Hash.prototype.values = function() { 69 | return this._vals; 70 | } 71 | 72 | Hash.prototype.reset = function() { 73 | this._cursor = 0; 74 | } 75 | 76 | Hash.prototype.first = function() { 77 | this.reset(); 78 | return this.next(); 79 | } 80 | 81 | Hash.prototype.next = function() { 82 | if (this._cursor++ < this._keys.length) 83 | return {key: this._keys[this._cursor-1], value: this._vals[this._cursor-1]}; 84 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Namespace.js: -------------------------------------------------------------------------------- 1 | _global_ = this; 2 | 3 | function Namespace(name, f) { 4 | var n = name.split("."); 5 | for (var o = _global_, i = 0, l = n.length; i < l; i++) { 6 | o = o[n[i]] = o[n[i]] || {}; 7 | } 8 | 9 | if (f) f(); 10 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Opt.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | Opt = { 3 | /** 4 | * Get commandline option values. 5 | * @param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"] 6 | * @param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}. 7 | * @return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true} 8 | */ 9 | get: function(args, optNames) { 10 | var opt = {"_": []}; // the unnamed option allows multiple values 11 | for (var i = 0; i < args.length; i++) { 12 | var arg = new String(args[i]); 13 | var name; 14 | var value; 15 | if (arg.charAt(0) == "-") { 16 | if (arg.charAt(1) == "-") { // it's a longname like --foo 17 | arg = arg.substring(2); 18 | var m = arg.split("="); 19 | name = m.shift(); 20 | value = m.shift(); 21 | if (typeof value == "undefined") value = true; 22 | 23 | for (var n in optNames) { // convert it to a shortname 24 | if (name == optNames[n]) { 25 | name = n; 26 | } 27 | } 28 | } 29 | else { // it's a shortname like -f 30 | arg = arg.substring(1); 31 | var m = arg.split("="); 32 | name = m.shift(); 33 | value = m.shift(); 34 | if (typeof value == "undefined") value = true; 35 | 36 | for (var n in optNames) { // find the matching key 37 | if (name == n || name+'[]' == n) { 38 | name = n; 39 | break; 40 | } 41 | } 42 | } 43 | if (name.match(/(.+)\[\]$/)) { // it's an array type like n[] 44 | name = RegExp.$1; 45 | if (!opt[name]) opt[name] = []; 46 | } 47 | 48 | if (opt[name] && opt[name].push) { 49 | opt[name].push(value); 50 | } 51 | else { 52 | opt[name] = value; 53 | } 54 | } 55 | else { // not associated with any optname 56 | opt._.push(args[i]); 57 | } 58 | } 59 | return opt; 60 | } 61 | } 62 | 63 | /*t: 64 | plan(11, "Testing Opt."); 65 | 66 | is( 67 | typeof Opt, 68 | "object", 69 | "Opt is an object." 70 | ); 71 | 72 | is( 73 | typeof Opt.get, 74 | "function", 75 | "Opt.get is a function." 76 | ); 77 | 78 | var optNames = {a:"accept", b:"backtrace", c:"class", d:"debug", "e[]":"exceptions"}; 79 | var t_options = Opt.get(["-a=xml", "-b", "--class=new", "--debug", "-e=one", "-e=two", "foo", "bar"], optNames); 80 | 81 | is( 82 | t_options.a, 83 | "xml", 84 | "an option defined with a short name can be accessed by its short name." 85 | ); 86 | 87 | is( 88 | t_options.b, 89 | true, 90 | "an option defined with a short name and no value are true." 91 | ); 92 | 93 | is( 94 | t_options.c, 95 | "new", 96 | "an option defined with a long name can be accessed by its short name." 97 | ); 98 | 99 | is( 100 | t_options.d, 101 | true, 102 | "an option defined with a long name and no value are true." 103 | ); 104 | 105 | is( 106 | typeof t_options.e, 107 | "object", 108 | "an option that can accept multiple values is defined." 109 | ); 110 | 111 | is( 112 | t_options.e.length, 113 | 2, 114 | "an option that can accept multiple values can have more than one value." 115 | ); 116 | 117 | is( 118 | t_options.e[1], 119 | "two", 120 | "an option that can accept multiple values can be accessed as an array." 121 | ); 122 | 123 | is( 124 | typeof t_options._, 125 | "object", 126 | "the property '_' is defined for unnamed options." 127 | ); 128 | 129 | is( 130 | t_options._[0], 131 | "foo", 132 | "the property '_' can be accessed as an array." 133 | ); 134 | */ -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/Reflection.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function Reflection(obj) { 3 | this.obj = obj; 4 | } 5 | 6 | Reflection.prototype.getConstructorName = function() { 7 | if (this.obj.constructor.name) return this.obj.constructor.name; 8 | var src = this.obj.constructor.toSource(); 9 | var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,''); 10 | return name; 11 | } 12 | 13 | Reflection.prototype.getMethod = function(name) { 14 | for (var p in this.obj) { 15 | if (p == name && typeof(this.obj[p]) == "function") return this.obj[p]; 16 | } 17 | return null; 18 | } 19 | 20 | Reflection.prototype.getParameterNames = function() { 21 | var src = this.obj.toSource(); 22 | src = src.substring( 23 | src.indexOf("(", 8)+1, src.indexOf(")") 24 | ); 25 | return src.split(/, ?/); 26 | } 27 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/frame/String.js: -------------------------------------------------------------------------------- 1 | /** 2 | @name String 3 | @class Additions to the core string object. 4 | */ 5 | 6 | /** @author Steven Levithan, released as public domain. */ 7 | String.prototype.trim = function() { 8 | var str = this.replace(/^\s+/, ''); 9 | for (var i = str.length - 1; i >= 0; i--) { 10 | if (/\S/.test(str.charAt(i))) { 11 | str = str.substring(0, i + 1); 12 | break; 13 | } 14 | } 15 | return str; 16 | } 17 | /*t: 18 | plan(6, "Testing String.prototype.trim."); 19 | 20 | var s = " a bc ".trim(); 21 | is(s, "a bc", "multiple spaces front and back are trimmed."); 22 | 23 | s = "a bc\n\n".trim(); 24 | is(s, "a bc", "newlines only in back are trimmed."); 25 | 26 | s = "\ta bc".trim(); 27 | is(s, "a bc", "tabs only in front are trimmed."); 28 | 29 | s = "\n \t".trim(); 30 | is(s, "", "an all-space string is trimmed to empty."); 31 | 32 | s = "a b\nc".trim(); 33 | is(s, "a b\nc", "a string with no spaces in front or back is trimmed to itself."); 34 | 35 | s = "".trim(); 36 | is(s, "", "an empty string is trimmed to empty."); 37 | 38 | */ 39 | 40 | String.prototype.balance = function(open, close) { 41 | var i = 0; 42 | while (this.charAt(i) != open) { 43 | if (i == this.length) return [-1, -1]; 44 | i++; 45 | } 46 | 47 | var j = i+1; 48 | var balance = 1; 49 | while (j < this.length) { 50 | if (this.charAt(j) == open) balance++; 51 | if (this.charAt(j) == close) balance--; 52 | if (balance == 0) break; 53 | j++; 54 | if (j == this.length) return [-1, -1]; 55 | } 56 | 57 | return [i, j]; 58 | } 59 | /*t: 60 | plan(16, "Testing String.prototype.balance."); 61 | 62 | var s = "{abc}".balance("{","}"); 63 | is(s[0], 0, "opener in first is found."); 64 | is(s[1], 4, "closer in last is found."); 65 | 66 | s = "ab{c}de".balance("{","}"); 67 | is(s[0], 2, "opener in middle is found."); 68 | is(s[1], 4, "closer in middle is found."); 69 | 70 | s = "a{b{c}de}f".balance("{","}"); 71 | is(s[0], 1, "nested opener is found."); 72 | is(s[1], 8, "nested closer is found."); 73 | 74 | s = "{}".balance("{","}"); 75 | is(s[0], 0, "opener with no content is found."); 76 | is(s[1], 1, "closer with no content is found."); 77 | 78 | s = "".balance("{","}"); 79 | is(s[0], -1, "empty string opener is -1."); 80 | is(s[1], -1, "empty string closer is -1."); 81 | 82 | s = "{abc".balance("{","}"); 83 | is(s[0], -1, "opener with no closer returns -1."); 84 | is(s[1], -1, "no closer returns -1."); 85 | 86 | s = "abc".balance("{","}"); 87 | is(s[0], -1, "no opener or closer returns -1 for opener."); 88 | is(s[1], -1, "no opener or closer returns -1 for closer."); 89 | 90 | s = "aX11/MIT License 8 | * (See the accompanying README file for full details.) 9 | */ 10 | 11 | /** 12 | Yet another unit testing tool for JavaScript. 13 | @author Michael Mathews micmath@gmail.com 14 | @param {object} testCases Properties are testcase names, values are functions to execute as tests. 15 | */ 16 | function testrun(testCases) { 17 | var ran = 0; 18 | for (t in testCases) { 19 | var result = testCases[t](); 20 | ran++; 21 | } 22 | 23 | return testrun.reportOut+"-------------------------------\n"+((testrun.fails>0)? ":( Failed "+testrun.fails+"/" : ":) Passed all ")+testrun.count+" test"+((testrun.count == 1)? "":"s")+".\n"; 24 | } 25 | 26 | 27 | testrun.count = 0; 28 | testrun.current = null; 29 | testrun.passes = 0; 30 | testrun.fails = 0; 31 | testrun.reportOut = ""; 32 | 33 | /** @private */ 34 | testrun.report = function(text) { 35 | testrun.reportOut += text+"\n"; 36 | } 37 | 38 | /** 39 | Check if test evaluates to true. 40 | @param {string} test To be evaluated. 41 | @param {string} message Optional. To be displayed in the report. 42 | @return {boolean} True if the string test evaluates to true. 43 | */ 44 | ok = function(test, message) { 45 | testrun.count++; 46 | 47 | var result; 48 | try { 49 | result = eval(test); 50 | 51 | if (result) { 52 | testrun.passes++; 53 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 54 | } 55 | else { 56 | testrun.fails++; 57 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 58 | } 59 | } 60 | catch(e) { 61 | testrun.fails++ 62 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 63 | 64 | } 65 | } 66 | 67 | /** 68 | Check if test is same as expected. 69 | @param {string} test To be evaluated. 70 | @param {string} expected 71 | @param {string} message Optional. To be displayed in the report. 72 | @return {boolean} True if (test == expected). Note that the comparison is not a strict equality check. 73 | */ 74 | is = function(test, expected, message) { 75 | testrun.count++; 76 | 77 | var result; 78 | try { 79 | result = eval(test); 80 | 81 | if (result == expected) { 82 | testrun.passes++ 83 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 84 | } 85 | else { 86 | testrun.fails++ 87 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 88 | testrun.report("expected: "+expected); 89 | testrun.report(" got: "+result); 90 | } 91 | } 92 | catch(e) { 93 | testrun.fails++ 94 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 95 | testrun.report("expected: "+expected); 96 | testrun.report(" got: "+result);} 97 | } 98 | 99 | /** 100 | Check if test matches pattern. 101 | @param {string} test To be evaluated. 102 | @param {string} pattern Used to create a RegExp. 103 | @param {string} message Optional. To be displayed in the report. 104 | @return {boolean} True if test matches pattern. 105 | */ 106 | like = function(test, pattern, message) { 107 | testrun.count++; 108 | 109 | var result; 110 | try { 111 | result = eval(test); 112 | var rgx = new RegExp(pattern); 113 | 114 | if (rgx.test(result)) { 115 | testrun.passes++ 116 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 117 | } 118 | else { 119 | testrun.fails++ 120 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 121 | testrun.report(" this: "+result); 122 | testrun.report("is not like: "+pattern); 123 | } 124 | } 125 | catch(e) { 126 | testrun.fails++ 127 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 128 | } 129 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/handlers/FOODOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | This is the main container for the FOODOC handler. 3 | @namespace 4 | */ 5 | FOODOC = { 6 | }; 7 | 8 | /** The current version string of this application. */ 9 | FOODOC.VERSION = "1.0"; 10 | 11 | FOODOC.handle = function(srcFile, src) { 12 | LOG.inform("Handling file '" + srcFile + "'"); 13 | 14 | return [ 15 | new JSDOC.Symbol( 16 | "foo", 17 | [], 18 | "VIRTUAL", 19 | new JSDOC.DocComment("/** This is a foo. */") 20 | ) 21 | ]; 22 | }; 23 | 24 | FOODOC.publish = function(symbolgroup) { 25 | LOG.inform("Publishing symbolgroup."); 26 | }; 27 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/handlers/XMLDOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the main container for the XMLDOC handler. 3 | * @namespace 4 | * @author Brett Fattori (bfattori@fry.com) 5 | * @version $Revision: 498 $ 6 | */ 7 | XMLDOC = { 8 | 9 | }; 10 | 11 | /** The current version string of this application. */ 12 | XMLDOC.VERSION = "1.0"; 13 | 14 | /** Include the library necessary to handle XML files */ 15 | IO.includeDir("handlers/XMLDOC/"); 16 | 17 | /** 18 | * @type Symbol[] 19 | */ 20 | XMLDOC.handle = function(srcFile, src) { 21 | 22 | }; 23 | 24 | XMLDOC.publish = function(symbolgroup) { 25 | 26 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/handlers/XMLDOC/XMLDoc.js: -------------------------------------------------------------------------------- 1 | LOG.inform("XMLDOC.symbolize loaded"); 2 | 3 | /** 4 | * Convert the source file to a set of symbols 5 | */ 6 | XMLDOC.symbolize = function(srcFile, src) { 7 | 8 | LOG.inform("Symbolizing file '" + srcFile + "'"); 9 | 10 | // XML files already have a defined structure, so we don't need to 11 | // do anything but parse them. The DOM reader can create a symbol 12 | // table from the parsed XML. 13 | var dr = new XMLDOC.DomReader(XMLDOC.Parser.parse(src)); 14 | return dr.getSymbols(srcFile); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | @overview 3 | @date $Date: 2010-06-13 22:02:44 +0100 (Sun, 13 Jun 2010) $ 4 | @version $Revision: 837 $ 5 | @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/lib/JSDOC.js $ 6 | @name JSDOC.js 7 | */ 8 | 9 | /** 10 | This is the main container for the JSDOC application. 11 | @namespace 12 | */ 13 | JSDOC = { 14 | }; 15 | 16 | /** 17 | @requires Opt 18 | */ 19 | if (typeof arguments == "undefined") arguments = []; 20 | JSDOC.opt = Opt.get( 21 | arguments, 22 | { 23 | a: "allfunctions", 24 | c: "conf", 25 | d: "directory", 26 | "D[]": "define", 27 | e: "encoding", 28 | "E[]": "exclude", 29 | h: "help", 30 | m: "multiple", 31 | n: "nocode", 32 | o: "out", 33 | p: "private", 34 | q: "quiet", 35 | r: "recurse", 36 | S: "securemodules", 37 | s: "suppress", 38 | t: "template", 39 | T: "testmode", 40 | u: "unique", 41 | v: "verbose", 42 | x: "ext" 43 | } 44 | ); 45 | 46 | /** The current version string of this application. */ 47 | JSDOC.VERSION = "2.4.0"; 48 | 49 | /** Print out usage information and quit. */ 50 | JSDOC.usage = function() { 51 | print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] ..."); 52 | print(""); 53 | print("OPTIONS:"); 54 | print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n"); 55 | print(" -c or --conf\n Load a configuration file.\n"); 56 | print(" -d= or --directory=\n Output to this directory (defaults to \"out\").\n"); 57 | print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n"); 58 | print(" -e= or --encoding=\n Use this encoding to read and write files.\n"); 59 | print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n"); 60 | print(" -h or --help\n Show this message and exit.\n"); 61 | print(" -m or --multiples\n Don't warn about symbols being documented more than once.\n"); 62 | print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n"); 63 | print(" -o= or --out=\n Print log messages to a file (defaults to stdout).\n"); 64 | print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n"); 65 | print(" -q or --quiet\n Do not output any messages, not even warnings.\n"); 66 | print(" -r= or --recurse=\n Descend into src directories.\n"); 67 | print(" -s or --suppress\n Suppress source code output.\n"); 68 | print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n"); 69 | print(" -t= or --template=\n Required. Use this template to format the output.\n"); 70 | print(" -T or --test\n Run all unit tests and exit.\n"); 71 | print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n"); 72 | print(" -v or --verbose\n Provide verbose feedback about what is happening.\n"); 73 | print(" -x=[,EXT]... or --ext=[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n"); 74 | 75 | quit(); 76 | } 77 | 78 | /*t: 79 | plan(4, "Testing JSDOC namespace."); 80 | 81 | is( 82 | typeof JSDOC, 83 | "object", 84 | "JSDOC.usage is a function." 85 | ); 86 | 87 | is( 88 | typeof JSDOC.VERSION, 89 | "string", 90 | "JSDOC.VERSION is a string." 91 | ); 92 | 93 | is( 94 | typeof JSDOC.usage, 95 | "function", 96 | "JSDOC.usage is a function." 97 | ); 98 | 99 | is( 100 | typeof JSDOC.opt, 101 | "object", 102 | "JSDOC.opt is a object." 103 | ); 104 | */ 105 | 106 | if (this.IO) IO.includeDir("lib/JSDOC/"); 107 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/JsPlate.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | JSDOC.JsPlate = function(templateFile) { 5 | if (templateFile) this.template = IO.readFile(templateFile); 6 | 7 | this.templateFile = templateFile; 8 | this.code = ""; 9 | this.parse(); 10 | } 11 | 12 | JSDOC.JsPlate.prototype.parse = function() { 13 | this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, ""); 14 | this.code = "var output=\u001e"+this.template; 15 | 16 | this.code = this.code.replace( 17 | //gi, 18 | function (match, eachName, inName) { 19 | return "\u001e;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=\u001e"; 20 | } 21 | ); 22 | this.code = this.code.replace(//g, "\u001e;\rif ($1) { output+=\u001e"); 23 | this.code = this.code.replace(//g, "\u001e;}\relse if ($1) { output+=\u001e"); 24 | this.code = this.code.replace(//g, "\u001e;}\relse { output+=\u001e"); 25 | this.code = this.code.replace(/<\/(if|for)>/g, "\u001e;\r};\routput+=\u001e"); 26 | this.code = this.code.replace( 27 | /\{\+\s*([\s\S]+?)\s*\+\}/gi, 28 | function (match, code) { 29 | code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code 30 | code = code.replace(/(\r?\n)/g, " "); 31 | return "\u001e+ ("+code+") +\u001e"; 32 | } 33 | ); 34 | this.code = this.code.replace( 35 | /\{!\s*([\s\S]+?)\s*!\}/gi, 36 | function (match, code) { 37 | code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code 38 | code = code.replace(/(\n)/g, " "); 39 | return "\u001e; "+code+";\routput+=\u001e"; 40 | } 41 | ); 42 | this.code = this.code+"\u001e;"; 43 | 44 | this.code = this.code.replace(/(\r?\n)/g, "\\n"); 45 | this.code = this.code.replace(/"/g, "\\\""); 46 | this.code = this.code.replace(/\u001e/g, "\""); 47 | } 48 | 49 | JSDOC.JsPlate.prototype.toCode = function() { 50 | return this.code; 51 | } 52 | 53 | JSDOC.JsPlate.keys = function(obj) { 54 | var keys = []; 55 | if (obj.constructor.toString().indexOf("Array") > -1) { 56 | for (var i = 0; i < obj.length; i++) { 57 | keys.push(i); 58 | } 59 | } 60 | else { 61 | for (var i in obj) { 62 | keys.push(i); 63 | } 64 | } 65 | return keys; 66 | }; 67 | 68 | JSDOC.JsPlate.values = function(obj) { 69 | var values = []; 70 | if (obj.constructor.toString().indexOf("Array") > -1) { 71 | for (var i = 0; i < obj.length; i++) { 72 | values.push(obj[i]); 73 | } 74 | } 75 | else { 76 | for (var i in obj) { 77 | values.push(obj[i]); 78 | } 79 | } 80 | return values; 81 | }; 82 | 83 | JSDOC.JsPlate.prototype.process = function(data, compact) { 84 | var keys = JSDOC.JsPlate.keys; 85 | var values = JSDOC.JsPlate.values; 86 | 87 | try { 88 | eval(this.code); 89 | } 90 | catch (e) { 91 | print(">> There was an error evaluating the compiled code from template: "+this.templateFile); 92 | print(" The error was on line "+e.lineNumber+" "+e.name+": "+e.message); 93 | var lines = this.code.split("\r"); 94 | if (e.lineNumber-2 >= 0) print("line "+(e.lineNumber-1)+": "+lines[e.lineNumber-2]); 95 | print("line "+e.lineNumber+": "+lines[e.lineNumber-1]); 96 | print(""); 97 | } 98 | 99 | if (compact) { // patch by mcbain.asm 100 | // Remove lines that contain only space-characters, usually left by lines in the template 101 | // which originally only contained JSPlate tags or code. This makes it easier to write 102 | // non-tricky templates which still put out nice code (not bloated with extra lines). 103 | // Lines purposely left blank (just a line ending) are left alone. 104 | output = output.replace(/\s+?(\r?)\n/g, "$1\n"); 105 | } 106 | 107 | /*debug*///print(this.code); 108 | return output; 109 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/Lang.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace 3 | */ 4 | JSDOC.Lang = { 5 | } 6 | 7 | JSDOC.Lang.isBuiltin = function(name) { 8 | return (JSDOC.Lang.isBuiltin.coreObjects.indexOf(name) > -1); 9 | } 10 | JSDOC.Lang.isBuiltin.coreObjects = ['_global_', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String']; 11 | 12 | JSDOC.Lang.whitespace = function(ch) { 13 | return JSDOC.Lang.whitespace.names[ch]; 14 | } 15 | JSDOC.Lang.whitespace.names = { 16 | " ": "SPACE", 17 | "\f": "FORMFEED", 18 | "\t": "TAB", 19 | "\u0009": "UNICODE_TAB", 20 | "\u000A": "UNICODE_NBR", 21 | "\u0008": "VERTICAL_TAB" 22 | }; 23 | 24 | JSDOC.Lang.newline = function(ch) { 25 | return JSDOC.Lang.newline.names[ch]; 26 | } 27 | JSDOC.Lang.newline.names = { 28 | "\n": "NEWLINE", 29 | "\r": "RETURN", 30 | "\u000A": "UNICODE_LF", 31 | "\u000D": "UNICODE_CR", 32 | "\u2029": "UNICODE_PS", 33 | "\u2028": "UNICODE_LS" 34 | }; 35 | 36 | JSDOC.Lang.keyword = function(word) { 37 | return JSDOC.Lang.keyword.names["="+word]; 38 | } 39 | JSDOC.Lang.keyword.names = { 40 | "=break": "BREAK", 41 | "=case": "CASE", 42 | "=catch": "CATCH", 43 | "=const": "VAR", 44 | "=continue": "CONTINUE", 45 | "=default": "DEFAULT", 46 | "=delete": "DELETE", 47 | "=do": "DO", 48 | "=else": "ELSE", 49 | "=false": "FALSE", 50 | "=finally": "FINALLY", 51 | "=for": "FOR", 52 | "=function": "FUNCTION", 53 | "=if": "IF", 54 | "=in": "IN", 55 | "=instanceof": "INSTANCEOF", 56 | "=new": "NEW", 57 | "=null": "NULL", 58 | "=return": "RETURN", 59 | "=switch": "SWITCH", 60 | "=this": "THIS", 61 | "=throw": "THROW", 62 | "=true": "TRUE", 63 | "=try": "TRY", 64 | "=typeof": "TYPEOF", 65 | "=void": "VOID", 66 | "=while": "WHILE", 67 | "=with": "WITH", 68 | "=var": "VAR" 69 | }; 70 | 71 | JSDOC.Lang.punc = function(ch) { 72 | return JSDOC.Lang.punc.names[ch]; 73 | } 74 | JSDOC.Lang.punc.names = { 75 | ";": "SEMICOLON", 76 | ",": "COMMA", 77 | "?": "HOOK", 78 | ":": "COLON", 79 | "||": "OR", 80 | "&&": "AND", 81 | "|": "BITWISE_OR", 82 | "^": "BITWISE_XOR", 83 | "&": "BITWISE_AND", 84 | "===": "STRICT_EQ", 85 | "==": "EQ", 86 | "=": "ASSIGN", 87 | "!==": "STRICT_NE", 88 | "!=": "NE", 89 | "<<": "LSH", 90 | "<=": "LE", 91 | "<": "LT", 92 | ">>>": "URSH", 93 | ">>": "RSH", 94 | ">=": "GE", 95 | ">": "GT", 96 | "++": "INCREMENT", 97 | "--": "DECREMENT", 98 | "+": "PLUS", 99 | "-": "MINUS", 100 | "*": "MUL", 101 | "/": "DIV", 102 | "%": "MOD", 103 | "!": "NOT", 104 | "~": "BITWISE_NOT", 105 | ".": "DOT", 106 | "[": "LEFT_BRACKET", 107 | "]": "RIGHT_BRACKET", 108 | "{": "LEFT_CURLY", 109 | "}": "RIGHT_CURLY", 110 | "(": "LEFT_PAREN", 111 | ")": "RIGHT_PAREN" 112 | }; 113 | 114 | JSDOC.Lang.matching = function(name) { 115 | return JSDOC.Lang.matching.names[name]; 116 | } 117 | JSDOC.Lang.matching.names = { 118 | "LEFT_PAREN": "RIGHT_PAREN", 119 | "RIGHT_PAREN": "LEFT_PAREN", 120 | "LEFT_CURLY": "RIGHT_CURLY", 121 | "RIGHT_CURLY": "LEFT_CURLY", 122 | "LEFT_BRACE": "RIGHT_BRACE", 123 | "RIGHT_BRACE": "LEFT_BRACE" 124 | } 125 | 126 | JSDOC.Lang.isNumber = function(str) { 127 | return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str); 128 | } 129 | 130 | JSDOC.Lang.isHexDec = function(str) { 131 | return /^0x[0-9A-F]+$/i.test(str); 132 | } 133 | 134 | JSDOC.Lang.isWordChar = function(str) { 135 | return /^[a-zA-Z0-9$_.]+$/.test(str); 136 | } 137 | 138 | JSDOC.Lang.isSpace = function(str) { 139 | return (typeof JSDOC.Lang.whitespace(str) != "undefined"); 140 | } 141 | 142 | JSDOC.Lang.isNewline = function(str) { 143 | return (typeof JSDOC.Lang.newline(str) != "undefined"); 144 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/PluginManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace Holds functionality related to running plugins. 3 | */ 4 | JSDOC.PluginManager = { 5 | } 6 | 7 | /** 8 | @param name A unique name that identifies that plugin. 9 | @param handlers A collection of named functions. The names correspond to hooks in the core code. 10 | */ 11 | JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) { 12 | if (!defined(JSDOC.PluginManager.plugins)) 13 | /** The collection of all plugins. Requires a unique name for each. 14 | */ 15 | JSDOC.PluginManager.plugins = {}; 16 | 17 | 18 | JSDOC.PluginManager.plugins[name] = handlers; 19 | } 20 | 21 | /** 22 | @param hook The name of the hook that is being caught. 23 | @param target Any object. This will be passed as the only argument to the handler whose 24 | name matches the hook name. Handlers cannot return a value, so must modify the target 25 | object to have an effect. 26 | */ 27 | JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) { 28 | for (var name in JSDOC.PluginManager.plugins) { 29 | if (defined(JSDOC.PluginManager.plugins[name][hook])) { 30 | JSDOC.PluginManager.plugins[name][hook](target); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/TextStream.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | @constructor 4 | */ 5 | JSDOC.TextStream = function(text) { 6 | if (typeof(text) == "undefined") text = ""; 7 | text = ""+text; 8 | this.text = text; 9 | this.cursor = 0; 10 | } 11 | 12 | JSDOC.TextStream.prototype.look = function(n) { 13 | if (typeof n == "undefined") n = 0; 14 | 15 | if (this.cursor+n < 0 || this.cursor+n >= this.text.length) { 16 | var result = new String(""); 17 | result.eof = true; 18 | return result; 19 | } 20 | return this.text.charAt(this.cursor+n); 21 | } 22 | 23 | JSDOC.TextStream.prototype.next = function(n) { 24 | if (typeof n == "undefined") n = 1; 25 | if (n < 1) return null; 26 | 27 | var pulled = ""; 28 | for (var i = 0; i < n; i++) { 29 | if (this.cursor+i < this.text.length) { 30 | pulled += this.text.charAt(this.cursor+i); 31 | } 32 | else { 33 | var result = new String(""); 34 | result.eof = true; 35 | return result; 36 | } 37 | } 38 | 39 | this.cursor += n; 40 | return pulled; 41 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/Token.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @constructor 5 | */ 6 | JSDOC.Token = function(data, type, name) { 7 | this.data = data; 8 | this.type = type; 9 | this.name = name; 10 | } 11 | 12 | JSDOC.Token.prototype.toString = function() { 13 | return "<"+this.type+" name=\""+this.name+"\">"+this.data+""; 14 | } 15 | 16 | JSDOC.Token.prototype.is = function(what) { 17 | return this.name === what || this.type === what; 18 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/TokenStream.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @constructor 5 | */ 6 | JSDOC.TokenStream = function(tokens) { 7 | this.tokens = (tokens || []); 8 | this.rewind(); 9 | } 10 | 11 | /** 12 | @constructor 13 | @private 14 | */ 15 | function VoidToken(/**String*/type) { 16 | this.toString = function() {return ""}; 17 | this.is = function(){return false;} 18 | } 19 | 20 | JSDOC.TokenStream.prototype.rewind = function() { 21 | this.cursor = -1; 22 | } 23 | 24 | /** 25 | @type JSDOC.Token 26 | */ 27 | JSDOC.TokenStream.prototype.look = function(/**Number*/n, /**Boolean*/considerWhitespace) { 28 | if (typeof n == "undefined") n = 0; 29 | 30 | if (considerWhitespace == true) { 31 | if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {}; 32 | return this.tokens[this.cursor+n]; 33 | } 34 | else { 35 | var count = 0; 36 | var i = this.cursor; 37 | 38 | while (true) { 39 | if (i < 0) return new JSDOC.Token("", "VOID", "START_OF_STREAM"); 40 | else if (i > this.tokens.length) return new JSDOC.Token("", "VOID", "END_OF_STREAM"); 41 | 42 | if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) { 43 | if (n < 0) i--; else i++; 44 | continue; 45 | } 46 | 47 | if (count == Math.abs(n)) { 48 | return this.tokens[i]; 49 | } 50 | count++; 51 | (n < 0)? i-- : i++; 52 | } 53 | 54 | return new JSDOC.Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object 55 | } 56 | } 57 | 58 | /** 59 | @type JSDOC.Token|JSDOC.Token[] 60 | */ 61 | JSDOC.TokenStream.prototype.next = function(/**Number*/howMany) { 62 | if (typeof howMany == "undefined") howMany = 1; 63 | if (howMany < 1) return null; 64 | var got = []; 65 | 66 | for (var i = 1; i <= howMany; i++) { 67 | if (this.cursor+i >= this.tokens.length) { 68 | return null; 69 | } 70 | got.push(this.tokens[this.cursor+i]); 71 | } 72 | this.cursor += howMany; 73 | 74 | if (howMany == 1) { 75 | return got[0]; 76 | } 77 | else return got; 78 | } 79 | 80 | /** 81 | @type JSDOC.Token[] 82 | */ 83 | JSDOC.TokenStream.prototype.balance = function(/**String*/start, /**String*/stop) { 84 | if (!stop) stop = JSDOC.Lang.matching(start); 85 | 86 | var depth = 0; 87 | var got = []; 88 | var started = false; 89 | 90 | while ((token = this.look())) { 91 | if (token.is(start)) { 92 | depth++; 93 | started = true; 94 | } 95 | 96 | if (started) { 97 | got.push(token); 98 | } 99 | 100 | if (token.is(stop)) { 101 | depth--; 102 | if (depth == 0) return got; 103 | } 104 | if (!this.next()) break; 105 | } 106 | } 107 | 108 | JSDOC.TokenStream.prototype.getMatchingToken = function(/**String*/start, /**String*/stop) { 109 | var depth = 0; 110 | var cursor = this.cursor; 111 | 112 | if (!start) { 113 | start = JSDOC.Lang.matching(stop); 114 | depth = 1; 115 | } 116 | if (!stop) stop = JSDOC.Lang.matching(start); 117 | 118 | while ((token = this.tokens[cursor])) { 119 | if (token.is(start)) { 120 | depth++; 121 | } 122 | 123 | if (token.is(stop) && cursor) { 124 | depth--; 125 | if (depth == 0) return this.tokens[cursor]; 126 | } 127 | cursor++; 128 | } 129 | } 130 | 131 | JSDOC.TokenStream.prototype.insertAhead = function(/**JSDOC.Token*/token) { 132 | this.tokens.splice(this.cursor+1, 0, token); 133 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/lib/JSDOC/Util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @deprecated Use {@link FilePath} instead. 4 | */ 5 | JSDOC.Util = { 6 | } 7 | 8 | /** 9 | * @deprecated Use {@link FilePath.fileName} instead. 10 | */ 11 | JSDOC.Util.fileName = function(path) { 12 | LOG.warn("JSDOC.Util.fileName is deprecated. Use FilePath.fileName instead."); 13 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 14 | return path.substring(nameStart); 15 | } 16 | 17 | /** 18 | * @deprecated Use {@link FilePath.fileExtension} instead. 19 | */ 20 | JSDOC.Util.fileExtension = function(filename) { 21 | LOG.warn("JSDOC.Util.fileExtension is deprecated. Use FilePath.fileExtension instead."); 22 | return filename.split(".").pop().toLowerCase(); 23 | }; 24 | 25 | /** 26 | * @deprecated Use {@link FilePath.dir} instead. 27 | */ 28 | JSDOC.Util.dir = function(path) { 29 | LOG.warn("JSDOC.Util.dir is deprecated. Use FilePath.dir instead."); 30 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 31 | return path.substring(0, nameStart-1); 32 | } 33 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @version $Id: main.js 818 2009-11-08 14:51:41Z micmath $ 3 | */ 4 | 5 | function main() { 6 | IO.include("lib/JSDOC.js"); 7 | IO.includeDir("plugins/"); 8 | 9 | // process the options 10 | 11 | // the -c option: options are defined in a configuration file 12 | if (JSDOC.opt.c) { 13 | eval("JSDOC.conf = " + IO.readFile(JSDOC.opt.c)); 14 | 15 | LOG.inform("Using configuration file at '"+JSDOC.opt.c+"'."); 16 | 17 | for (var c in JSDOC.conf) { 18 | if (c !== "D" && !defined(JSDOC.opt[c])) { // commandline overrules config file 19 | JSDOC.opt[c] = JSDOC.conf[c]; 20 | } 21 | } 22 | 23 | if (typeof JSDOC.conf["_"] != "undefined") { 24 | JSDOC.opt["_"] = JSDOC.opt["_"].concat(JSDOC.conf["_"]); 25 | } 26 | 27 | LOG.inform("With configuration: "); 28 | for (var o in JSDOC.opt) { 29 | LOG.inform(" "+o+": "+JSDOC.opt[o]); 30 | } 31 | } 32 | 33 | // be verbose 34 | if (JSDOC.opt.v) LOG.verbose = true; 35 | 36 | // send log messages to a file 37 | if (JSDOC.opt.o) LOG.out = IO.open(JSDOC.opt.o); 38 | 39 | // run the unit tests 40 | if (JSDOC.opt.T) { 41 | LOG.inform("JsDoc Toolkit running in test mode at "+new Date()+"."); 42 | IO.include("frame/Testrun.js"); 43 | IO.include("test.js"); 44 | } 45 | else { 46 | // a template must be defined and must be a directory path 47 | if (!JSDOC.opt.t && System.getProperty("jsdoc.template.dir")) { 48 | JSDOC.opt.t = System.getProperty("jsdoc.template.dir"); 49 | } 50 | if (JSDOC.opt.t && SYS.slash != JSDOC.opt.t.slice(-1)) { 51 | JSDOC.opt.t += SYS.slash; 52 | } 53 | 54 | // verbose messages about the options we were given 55 | LOG.inform("JsDoc Toolkit main() running at "+new Date()+"."); 56 | LOG.inform("With options: "); 57 | for (var o in JSDOC.opt) { 58 | LOG.inform(" "+o+": "+JSDOC.opt[o]); 59 | } 60 | 61 | // initialize and build a symbolSet from your code 62 | JSDOC.JsDoc(); 63 | 64 | // debugger's option: dump the entire symbolSet produced from your code 65 | if (JSDOC.opt.Z) { 66 | LOG.warn("So you want to see the data structure, eh? This might hang if you have circular refs..."); 67 | IO.include("frame/Dumper.js"); 68 | var symbols = JSDOC.JsDoc.symbolSet.toArray(); 69 | for (var i = 0, l = symbols.length; i < l; i++) { 70 | var symbol = symbols[i]; 71 | print("// symbol: " + symbol.alias); 72 | print(symbol.serialize()); 73 | } 74 | } 75 | else { 76 | if (typeof JSDOC.opt.t != "undefined") { 77 | try { 78 | // a file named "publish.js" must exist in the template directory 79 | load(JSDOC.opt.t+"publish.js"); 80 | 81 | // and must define a function named "publish" 82 | if (!publish) { 83 | LOG.warn("No publish() function is defined in that template so nothing to do."); 84 | } 85 | else { 86 | // which will be called with the symbolSet produced from your code 87 | publish(JSDOC.JsDoc.symbolSet); 88 | } 89 | } 90 | catch(e) { 91 | LOG.warn("Sorry, that doesn't seem to be a valid template: "+JSDOC.opt.t+"publish.js : "+e); 92 | } 93 | } 94 | else { 95 | LOG.warn("No template given. Might as well read the usage notes."); 96 | JSDOC.usage(); 97 | } 98 | } 99 | } 100 | 101 | // notify of any warnings 102 | if (!JSDOC.opt.q && LOG.warnings.length) { 103 | print(LOG.warnings.length+" warning"+(LOG.warnings.length != 1? "s":"")+"."); 104 | } 105 | 106 | // stop sending log messages to a file 107 | if (LOG.out) { 108 | LOG.out.flush(); 109 | LOG.out.close(); 110 | } 111 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/commentSrcJson.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.commentSrcJson", 3 | { 4 | onDocCommentSrc: function(comment) { 5 | var json; 6 | if (/^\s*@json\b/.test(comment)) { 7 | comment.src = new String(comment.src).replace("@json", ""); 8 | 9 | eval("json = "+comment.src); 10 | var tagged = ""; 11 | for (var i in json) { 12 | var tag = json[i]; 13 | // todo handle cases where tag is an object 14 | tagged += "@"+i+" "+tag+"\n"; 15 | } 16 | comment.src = tagged; 17 | } 18 | } 19 | } 20 | ); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/frameworkPrototype.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.frameworkPrototype", 3 | { 4 | onPrototypeClassCreate: function(classCreator) { 5 | var desc = ""; 6 | if (classCreator.comment) { 7 | desc = classCreator.comment; 8 | } 9 | var insert = desc+"/** @name "+classCreator.name+"\n@constructor\n@scope "+classCreator.name+".prototype */" 10 | 11 | insert = insert.replace(/\*\/\/\*\*/g, "\n"); 12 | /*DEBUG*///print("insert is "+insert); 13 | classCreator.addComment.data = insert; 14 | } 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/functionCall.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.functionCall", 3 | { 4 | onFunctionCall: function(functionCall) { 5 | if (functionCall.name == "dojo.define" && functionCall.arg1) { 6 | functionCall.doc = "/** @lends "+eval(functionCall.arg1)+".prototype */"; 7 | } 8 | } 9 | } 10 | ); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/publishSrcHilite.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.publishSrcHilite", 3 | { 4 | onPublishSrc: function(src) { 5 | if (src.path in JsHilite.cache) { 6 | return; // already generated src code 7 | } 8 | else JsHilite.cache[src.path] = true; 9 | 10 | try { 11 | var sourceCode = IO.readFile(src.path); 12 | } 13 | catch(e) { 14 | print(e.message); 15 | quit(); 16 | } 17 | 18 | var hiliter = new JsHilite(sourceCode, src.charset); 19 | src.hilited = hiliter.hilite(); 20 | } 21 | } 22 | ); 23 | 24 | function JsHilite(src, charset) { 25 | 26 | var tr = new JSDOC.TokenReader(); 27 | 28 | tr.keepComments = true; 29 | tr.keepDocs = true; 30 | tr.keepWhite = true; 31 | 32 | this.tokens = tr.tokenize(new JSDOC.TextStream(src)); 33 | 34 | // TODO is redefining toString() the best way? 35 | JSDOC.Token.prototype.toString = function() { 36 | return ""+this.data.replace(/"; 37 | } 38 | 39 | if (!charset) charset = "utf-8"; 40 | 41 | this.header = ' '+ 42 | "
";
50 | 	this.footer = "
"; 51 | this.showLinenumbers = true; 52 | } 53 | 54 | JsHilite.cache = {}; 55 | 56 | JsHilite.prototype.hilite = function() { 57 | var hilited = this.tokens.join(""); 58 | var line = 1; 59 | if (this.showLinenumbers) hilited = hilited.replace(/(^|\n)/g, function(m){return m+""+((line<10)? " ":"")+((line<100)? " ":"")+(line++)+" "}); 60 | 61 | return this.header+hilited+this.footer; 62 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/symbolLink.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.symbolLink", 3 | { 4 | onSymbolLink: function(link) { 5 | // modify link.linkPath (the href part of the link) 6 | // or link.linkText (the text displayed) 7 | // or link.linkInner (the #name part of the link) 8 | } 9 | } 10 | ); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/tagParamConfig.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.tagParamConfig", 3 | { 4 | onDocCommentTags: function(comment) { 5 | var currentParam = null; 6 | var tags = comment.tags; 7 | for (var i = 0, l = tags.length; i < l; i++) { 8 | 9 | if (tags[i].title == "param") { 10 | if (tags[i].name.indexOf(".") == -1) { 11 | currentParam = i; 12 | } 13 | } 14 | else if (tags[i].title == "config") { 15 | tags[i].title = "param"; 16 | if (currentParam == null) { 17 | tags[i].name = "arguments"+"."+tags[i].name; 18 | } 19 | else if (tags[i].name.indexOf(tags[currentParam].name+".") != 0) { 20 | tags[i].name = tags[currentParam].name+"."+tags[i].name; 21 | } 22 | currentParam != null 23 | //tags[currentParam].properties.push(tags[i]); 24 | } 25 | else { 26 | currentParam = null; 27 | } 28 | } 29 | } 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/plugins/tagSynonyms.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.tagSynonyms", 3 | { 4 | onDocCommentSrc: function(comment) { 5 | comment.src = comment.src.replace(/@methodOf\b/i, "@function\n@memberOf"); 6 | comment.src = comment.src.replace(/@fieldOf\b/i, "@field\n@memberOf"); 7 | }, 8 | 9 | onDocCommentTags: function(comment) { 10 | for (var i = 0, l = comment.tags.length; i < l; i++) { 11 | var title = comment.tags[i].title.toLowerCase(); 12 | var syn; 13 | if ((syn = JSDOC.tagSynonyms.synonyms["="+title])) { 14 | comment.tags[i].title = syn; 15 | } 16 | } 17 | } 18 | } 19 | ); 20 | 21 | new Namespace( 22 | "JSDOC.tagSynonyms", 23 | function() { 24 | JSDOC.tagSynonyms.synonyms = { 25 | "=member": "memberOf", 26 | "=memberof": "memberOf", 27 | "=description": "desc", 28 | "=exception": "throws", 29 | "=argument": "param", 30 | "=returns": "return", 31 | "=classdescription": "class", 32 | "=fileoverview": "overview", 33 | "=extends": "augments", 34 | "=base": "augments", 35 | "=projectdescription": "overview", 36 | "=classdescription": "class", 37 | "=link": "see", 38 | "=borrows": "inherits", 39 | "=scope": "lends", 40 | "=construct": "constructor" 41 | } 42 | } 43 | ); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/t/runner.js: -------------------------------------------------------------------------------- 1 | // try: java -jar ../../jsrun.jar runner.js 2 | 3 | load("TestDoc.js"); 4 | 5 | TestDoc.prove("../frame/Opt.js"); 6 | TestDoc.prove("../lib/JSDOC.js"); 7 | TestDoc.prove("../frame/String.js"); 8 | TestDoc.prove("../lib/JSDOC/DocTag.js"); 9 | TestDoc.prove("../lib/JSDOC/DocComment.js"); 10 | TestDoc.prove("../lib/JSDOC/TokenReader.js"); 11 | TestDoc.prove("../lib/JSDOC/Symbol.js"); 12 | 13 | TestDoc.report(); 14 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/addon.js: -------------------------------------------------------------------------------- 1 | String.prototype.reverse = function() { 2 | } 3 | 4 | String.prototype.reverse.utf8 = function() { 5 | } 6 | 7 | Function.count = function() { 8 | } 9 | 10 | /** @memberOf Function */ 11 | Function.count.reset = function() { 12 | } 13 | 14 | /** @memberOf Function */ 15 | count.getValue = function() { 16 | } 17 | 18 | /** @memberOf Function.prototype */ 19 | getSig = function() { 20 | } 21 | 22 | /** @memberOf Function.prototype */ 23 | Function.prototype.getProps = function() { 24 | } 25 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/anon_inner.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name bar 3 | * @namespace 4 | */ 5 | 6 | new function() { 7 | /** 8 | * @name bar-foo 9 | * @function 10 | * @param {number} x 11 | */ 12 | function foo(x) { 13 | } 14 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/augments.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function Layout(p) { 5 | this.init = function(p) { 6 | } 7 | 8 | this.getId = function() { 9 | } 10 | 11 | /** @type Page */ 12 | this.orientation = "landscape"; 13 | } 14 | 15 | /** 16 | @constructor 17 | @augments Layout 18 | */ 19 | function Page() { 20 | this.reset = function(b) { 21 | } 22 | } 23 | 24 | /** 25 | @extends Page 26 | @constructor 27 | */ 28 | function ThreeColumnPage() { 29 | this.init = function(resetCode) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/augments2.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function LibraryItem() { 5 | this.reserve = function() { 6 | } 7 | } 8 | 9 | /** 10 | @constructor 11 | */ 12 | function Junkmail() { 13 | this.annoy = function() { 14 | } 15 | } 16 | 17 | /** 18 | @inherits Junkmail.prototype.annoy as pester 19 | @augments ThreeColumnPage 20 | @augments LibraryItem 21 | @constructor 22 | */ 23 | function NewsletterPage() { 24 | this.getHeadline = function() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/borrows.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function Layout(p) { 5 | /** initilize 1 */ 6 | this.init = function(p) { 7 | } 8 | 9 | /** get the id */ 10 | this.getId = function() { 11 | } 12 | 13 | /** @type string */ 14 | this.orientation = "landscape"; 15 | 16 | function getInnerElements(elementSecretId){ 17 | } 18 | } 19 | 20 | /** A static method. */ 21 | Layout.units = function() { 22 | } 23 | 24 | /** 25 | @constructor 26 | @borrows Layout#orientation 27 | @borrows Layout-getInnerElements 28 | @borrows Layout.units 29 | */ 30 | function Page() { 31 | /** reset the page */ 32 | this.reset = function(b) { 33 | } 34 | } 35 | 36 | /** 37 | @constructor 38 | @borrows Layout.prototype.orientation as this.orientation 39 | @borrows Layout.prototype.init as #init 40 | @inherits Page.prototype.reset as #reset 41 | */ 42 | function ThreeColumnPage() { 43 | /** initilize 2 */ 44 | this.init = function(p) { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/borrows2.js: -------------------------------------------------------------------------------- 1 | // testing circular borrows 2 | 3 | /** 4 | @class 5 | @borrows Bar#zop as this.my_zop 6 | */ 7 | function Foo() { 8 | /** this is a zip. */ 9 | this.zip = function() {} 10 | 11 | this.my_zop = new Bar().zop; 12 | } 13 | 14 | /** 15 | @class 16 | @borrows Foo#zip as this.my_zip 17 | */ 18 | function Bar() { 19 | /** this is a zop. */ 20 | this.zop = function() {} 21 | 22 | this.my_zip = new Foo().zip; 23 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | * @param person The person. 4 | * @param {string} person.name The person's name. 5 | * @config {integer} age The person's age. 6 | * @config [id=1] Optional id number to use. 7 | * @param connection 8 | */ 9 | function Contact(person, connection) { 10 | 11 | } 12 | 13 | /** 14 | * @constructor 15 | * @param persons 16 | * @config {string} Father The paternal person. 17 | * @config {string} Mother The maternal person. 18 | * @config {string[]} Children And the rest. 19 | */ 20 | function Family(/**Object*/persons) { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/constructs.js: -------------------------------------------------------------------------------- 1 | var Person = makeClass( 2 | /** 3 | @scope Person 4 | */ 5 | { 6 | /** 7 | This is just another way to define a constructor. 8 | @constructs 9 | @param {string} name The name of the person. 10 | */ 11 | initialize: function(name) { 12 | this.name = name; 13 | }, 14 | say: function(message) { 15 | return this.name + " says: " + message; 16 | } 17 | } 18 | ); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/encoding.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @Constructor 4 | * @desc 配置文件 5 | * @class 什么也不返回 6 | */ 7 | function Test(conf) { 8 | // do something; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/encoding_other.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/encoding_other.js -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/event.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Kitchen 3 | * @constructor 4 | * @fires Bakery#event:donutOrdered 5 | */ 6 | 7 | /** 8 | * Fired when some cake is eaten. 9 | * @name Kitchen#event:cakeEaten 10 | * @function 11 | * @param {Number} pieces The number of pieces eaten. 12 | */ 13 | 14 | /** 15 | * Find out if cake was eaten. 16 | * @name Kitchen#cakeEaten 17 | * @function 18 | * @param {Boolean} wasEaten 19 | */ 20 | 21 | /** 22 | * @name getDesert 23 | * @function 24 | * @fires Kitchen#event:cakeEaten 25 | */ 26 | 27 | /** 28 | * @name Bakery 29 | * @constructor 30 | * @extends Kitchen 31 | */ 32 | 33 | /** 34 | * Fired when a donut order is made. 35 | * @name Bakery#event:donutOrdered 36 | * @event 37 | * @param {Event} e The event object. 38 | * @param {String} [e.topping] Optional sprinkles. 39 | */ 40 | 41 | /** 42 | * @constructor 43 | * @borrows Bakery#event:donutOrdered as this.event:cakeOrdered 44 | */ 45 | function CakeShop() { 46 | } 47 | 48 | /** @event */ 49 | CakeShop.prototype.icingReady = function(isPink) { 50 | } 51 | 52 | /** @event */ 53 | function amHungry(/**Boolean*/enoughToEatAHorse) { 54 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/exports.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | var mxn = {}; 3 | 4 | (function(){ 5 | /** @exports Map as mxn.Map */ 6 | var Map = 7 | /** @constructor */ 8 | mxn.Map = function() { 9 | }; 10 | 11 | /** A method. */ 12 | Map.prototype.doThings = function() { 13 | }; 14 | })(); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/functions_anon.js: -------------------------------------------------------------------------------- 1 | /** an anonymous constructor executed inline */ 2 | a = new function() { 3 | /** a.b*/ 4 | this.b = 1; 5 | /** a.f */ 6 | this.f = function() { 7 | /** a.c */ 8 | this.c = 2; 9 | } 10 | } 11 | 12 | 13 | /** 14 | named function executed inline 15 | */ 16 | bar1 = function Zoola1() { 17 | /** property of global */ 18 | this.g = 1; 19 | }(); 20 | 21 | /** 22 | named constructor executed inline 23 | */ 24 | bar2 = new function Zoola2() { 25 | /** property of bar */ 26 | this.p = 1; 27 | }; 28 | 29 | /** module pattern */ 30 | module = (function () { 31 | /** won't appear in documentation */ 32 | var priv = 1; 33 | 34 | /** @scope module */ 35 | return { 36 | /** will appear as a property of module */ 37 | pub: 1 38 | } 39 | })(); 40 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/functions_nested.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Zop() { 3 | } 4 | 5 | /** 6 | @class 7 | */ 8 | Foo = function(id) { 9 | // this is a bit twisted, but if you call Foo() you will then 10 | // modify Foo(). This is kinda, sorta non-insane, because you 11 | // would have to call Foo() 100% of the time to use Foo's methods 12 | Foo.prototype.methodOne = function(bar) { 13 | alert(bar); 14 | }; 15 | 16 | // same again 17 | Foo.prototype.methodTwo = function(bar2) { 18 | alert(bar2); 19 | }; 20 | 21 | // and these are only executed if the enclosing function is actually called 22 | // and who knows if that will ever happen? 23 | Bar = function(pez) { 24 | alert(pez); 25 | }; 26 | Zop.prototype.zap = function(p){ 27 | alert(p); 28 | }; 29 | 30 | // but this is only visible inside Foo 31 | function inner() { 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/global.js: -------------------------------------------------------------------------------- 1 | /** ecks */ 2 | var x = [1, 2, 4]; 3 | 4 | var y = { 5 | foo: function(){ 6 | } 7 | } 8 | 9 | bar = function() { 10 | } 11 | 12 | function zop() { 13 | } 14 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/globals.js: -------------------------------------------------------------------------------- 1 | function example(/**Circle*/a, b) { 2 | /** a global defined in function */ 3 | var number = a; 4 | 5 | var hideNumber = function(){ 6 | } 7 | 8 | setNumber = function(){ 9 | } 10 | alert('You have chosen: ' + b); 11 | } 12 | 13 | function initPage() { 14 | var supported = document.createElement && document.getElementsByTagName; 15 | if (!supported) return; 16 | // start of DOM script 17 | var x = document.getElementById('writeroot'); 18 | // etc. 19 | } 20 | 21 | /** an example var */ 22 | var document = new Document(x, y); 23 | 24 | var getNumber = function(){ 25 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/ignore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A test constructor. 3 | * @constructor 4 | * @ignore 5 | */ 6 | function Ignored() { 7 | /** a method */ 8 | this.bar = function() { 9 | } 10 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/inner.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | */ 4 | function Outer() { 5 | /** 6 | * @constructor 7 | */ 8 | function Inner(name) { 9 | /** The name of this. */ 10 | this.name = name; 11 | } 12 | 13 | this.open = function(name) { 14 | return (new Inner(name)); 15 | } 16 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/lend.js: -------------------------------------------------------------------------------- 1 | /** @class */ 2 | var Person = Class.create( 3 | /** 4 | @lends Person.prototype 5 | */ 6 | { 7 | initialize: function(name) { 8 | this.name = name; 9 | }, 10 | say: function(message) { 11 | return this.name + ': ' + message; 12 | } 13 | } 14 | ); 15 | 16 | /** @lends Person.prototype */ 17 | { 18 | /** like say but more musical */ 19 | sing: function(song) { 20 | } 21 | } 22 | 23 | /** @lends Person */ 24 | { 25 | getCount: function() { 26 | } 27 | } 28 | 29 | /** @lends Unknown.prototype */ 30 | { 31 | notok: function() { 32 | } 33 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/memberof.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | pack = function() { 3 | this.init = function(){} 4 | function config(){} 5 | } 6 | 7 | pack.build = function(task) {}; 8 | 9 | /** @memberOf pack */ 10 | pack.install = function() {} 11 | 12 | /** @memberOf pack */ 13 | pack.install.overwrite = function() {} 14 | 15 | /** @memberOf pack */ 16 | clean = function() {} 17 | 18 | /** @memberOf pack-config */ 19 | install = function() {}; 20 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/memberof2.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | */ 4 | function Foo() { 5 | /** 6 | @memberOf Foo.prototype 7 | */ 8 | function bar(a, b) { 9 | } 10 | 11 | /** 12 | @memberOf Foo 13 | */ 14 | var zip = function(p, q) { 15 | } 16 | 17 | /** 18 | @memberOf Foo 19 | */ 20 | function zop( x,y ) { 21 | } 22 | 23 | /** 24 | @memberOf Foo 25 | @constructor 26 | */ 27 | function Fiz() { 28 | /** A method of Foo#Fiz. */ 29 | this.fipple = function(fop){} 30 | } 31 | } 32 | 33 | /** 34 | @memberOf Foo# 35 | */ 36 | var blat = function() { 37 | 38 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/memberof3.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Foo 3 | * @class 4 | */ 5 | 6 | /**#@+ 7 | * @memberOf Foo# 8 | * @field 9 | */ 10 | 11 | /** 12 | * @name bar 13 | * @type Object[] 14 | */ 15 | 16 | /**#@-*/ 17 | 18 | /** 19 | * @name Foo2 20 | * @class 21 | */ 22 | 23 | /**#@+ 24 | * @memberOf Foo2# 25 | * @field 26 | */ 27 | 28 | /** 29 | * @name bar 30 | * @type Object[] 31 | */ 32 | 33 | /**#@-*/ -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/memberof_constructor.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Circle(){} 3 | 4 | /** 5 | @constructor 6 | @memberOf Circle# 7 | */ 8 | Circle.prototype.Tangent = function(){}; 9 | 10 | // renaming Circle#Tangent to Circle#Circle#Tangent 11 | 12 | /** 13 | @memberOf Circle#Tangent# 14 | */ 15 | Circle.prototype.Tangent.prototype.getDiameter = function(){}; 16 | 17 | 18 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/module.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | myProject = myProject || {}; 3 | 4 | /** @namespace */ 5 | myProject.myModule = (function () { 6 | /** describe myPrivateVar here */ 7 | var myPrivateVar = ""; 8 | 9 | var myPrivateMethod = function () { 10 | } 11 | 12 | /** @scope myProject.myModule */ 13 | return { 14 | myPublicMethod: function () { 15 | } 16 | }; 17 | })(); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/multi_methods.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | Get the entire flavor. 4 | @name flavor^3 5 | @function 6 | @returns {Object} The entire flavor hash. 7 | */ 8 | /** 9 | Get a named flavor. 10 | @name flavor^2 11 | @function 12 | @param {String} name The name of the flavor to get. 13 | @returns {String} The value of that flavor. 14 | */ 15 | /** 16 | Set the flavor. 17 | @param {String} name The name of the flavor to set. 18 | @param {String} value The value of the flavor. 19 | @returns {String} The value of that flavor. 20 | */ 21 | function flavor(name, value) { 22 | if (arguments.length > 1) flavor[name] = value; 23 | else if (arguments.length == 1) return flavor[name]; 24 | else return flavor; 25 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/name.js: -------------------------------------------------------------------------------- 1 | /** 2 | @name Response 3 | @class 4 | */ 5 | 6 | Response.prototype = { 7 | /** 8 | @name Response#text 9 | @function 10 | @description 11 | Gets the body of the response as plain text 12 | @returns {String} 13 | Response as text 14 | */ 15 | 16 | text: function() { 17 | return this.nativeResponse.responseText; 18 | } 19 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/namespace_nested.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace This is the first namespace. 3 | */ 4 | ns1 = {}; 5 | 6 | /** 7 | This is the second namespace. 8 | @namespace 9 | */ 10 | ns1.ns2 = {}; 11 | 12 | /** 13 | This part of ns1.ns2 14 | @constructor 15 | */ 16 | ns1.ns2.Function1 = function() { 17 | }; 18 | 19 | ns1.staticFunction = function() { 20 | }; 21 | 22 | /** A static field in a namespace. */ 23 | ns1.ns2.staticField = 1; 24 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/nocode.js: -------------------------------------------------------------------------------- 1 | /**#nocode+*/ 2 | /** 3 | @name star 4 | @function 5 | */ 6 | function blahblah() { 7 | 8 | } 9 | /**#nocode-*/ 10 | 11 | function yaddayadda() { 12 | 13 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/oblit_anon.js: -------------------------------------------------------------------------------- 1 | /** the options */ 2 | opt = Opt.get( 3 | arguments, 4 | { 5 | d: "directory", 6 | c: "conf", 7 | "D[]": "define" 8 | } 9 | ); 10 | 11 | /** configuration */ 12 | opt.conf = { 13 | /** keep */ 14 | keep: true, 15 | /** base */ 16 | base: getBase(this, {p: properties}) 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/overview.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @overview This "library" contains a 3 | * lot of classes and functions. 4 | * @example 5 |
 6 | 	var x (x < 1);
 7 | 	alert("This 'is' \"code\"");
 8 |  
9 | * @name My Cool Library 10 | * @author Joe Smith jsmith@company.com 11 | * @version 0.1 12 | */ 13 | 14 | /** 15 | * Gets the current foo 16 | * @param {String} fooId The unique identifier for the foo. 17 | * @return {Object} Returns the current foo. 18 | */ 19 | function getFoo(fooID){ 20 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/param_inline.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | @param columns The number of columns. 4 | */ 5 | function Layout(/**int*/columns){ 6 | /** 7 | @param [id] The id of the element. 8 | @param elName The name of the element. 9 | */ 10 | this.getElement = function( 11 | /** string */ elName, 12 | /** number|string */ id 13 | ) { 14 | }; 15 | 16 | /** 17 | @constructor 18 | */ 19 | this.Canvas = function(top, left, /**int*/width, height) { 20 | /** Is it initiated yet? */ 21 | this.initiated = true; 22 | } 23 | 24 | this.rotate = function(/**nothing*/) { 25 | } 26 | 27 | /** 28 | @param x 29 | @param y 30 | @param {zoppler} z*/ 31 | this.init = function(x, y, /**abbler*/z) { 32 | /** The xyz. */ 33 | this.xyz = x+y+z; 34 | this.getXyz = function() { 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/params_optional.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @param {Page[]} pages 4 | * @param {number} [id] Specifies the id, if applicable. 5 | * @param {String} [title = This is untitled.] Specifies the title. 6 | */ 7 | function Document(pages, id, title){ 8 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/prototype.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype.init = function(title) { 6 | /** the instance title */ 7 | this.title = title; 8 | 9 | /** the static counter */ 10 | Article.counter = 1; 11 | } 12 | 13 | a = new Article(); 14 | a.Init("my title"); 15 | 16 | print(a.title); 17 | print(Article.counter); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/prototype_nested.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Word() { 3 | } 4 | 5 | Word.prototype.reverse = function() { 6 | } 7 | 8 | Word.prototype.reverse.utf8 = function() { 9 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/prototype_oblit.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype = { 6 | /** instance get title */ 7 | getTitle: function(){ 8 | } 9 | } 10 | 11 | /** static get title */ 12 | Article.getTitle = function(){ 13 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/prototype_oblit_constructor.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype = { 6 | /** @constructor */ 7 | Title: function(title) { 8 | /** the value of the Title instance */ 9 | this.title = title; 10 | }, 11 | 12 | init: function(pages) { 13 | /** the value of the pages of the Article instance */ 14 | this.pages = pages; 15 | } 16 | } 17 | 18 | f = new Article(); 19 | f.init("one two three"); 20 | 21 | t = new f.Title("my title"); 22 | 23 | print(f.pages); 24 | print(t.title); -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/public.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function Foo() { 3 | /** 4 | @public 5 | @static 6 | @field 7 | */ 8 | var bar = function(x) { 9 | } 10 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/scripts/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | @class 3 | */ 4 | function thisiscode() { 5 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/scripts/notcode.txt: -------------------------------------------------------------------------------- 1 | (This is not code) 2 | function foo(){{{{ 3 | ( 4 | ! 5 | @ -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/shared.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Builtin object. 4 | * @class 5 | * @name Array 6 | */ 7 | 8 | /**#@+ 9 | * Extension to builtin array. 10 | * @memberOf Array 11 | * @method 12 | */ 13 | 14 | /** 15 | * @returns Boolen if some array members... 16 | */ 17 | Array.prototype.some = function(){}; 18 | 19 | /** 20 | * Change every element of an array. 21 | * @returns Filtered array copy. 22 | */ 23 | Array.prototype.filter = function(){}; 24 | 25 | /**#@-*/ 26 | 27 | 28 | /** 29 | * A first in, first out data structure. 30 | * @constructor 31 | */ 32 | Queue = function(){}; 33 | 34 | /**#@+ 35 | * Extension to Queue. 36 | * @memberOf Queue 37 | */ 38 | 39 | rewind = function(){ 40 | } 41 | 42 | // should close automatically here. -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/shared2.js: -------------------------------------------------------------------------------- 1 | startOver = function(){ 2 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/shortcuts.js: -------------------------------------------------------------------------------- 1 | // /**#=+ 2 | // * { 3 | // * 'D': 'Date.prototype', 4 | // * '$N': 'Number' 5 | // * } 6 | // */ 7 | // var D = Date.prototype, 8 | // $N = Number; 9 | // 10 | // D.locale = function(){ 11 | // }; 12 | // 13 | // /** 14 | // @return {string} The cardinal number string. 15 | // */ 16 | // $N.nth = function(n){ 17 | // }; 18 | // 19 | // LOAD.file = function(){ 20 | // } 21 | // 22 | // /**#=-*/ -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/static_this.js: -------------------------------------------------------------------------------- 1 | /** the parent */ 2 | var box = {}; 3 | 4 | /** @namespace */ 5 | box.holder = {} 6 | 7 | box.holder.foo = function() { 8 | /** the counter */ 9 | this.counter = 1; 10 | } 11 | 12 | box.holder.foo(); 13 | print(box.holder.counter); 14 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/synonyms.js: -------------------------------------------------------------------------------- 1 | /** 2 | @class 3 | @inherits Bar#zop as #my_zop 4 | */ 5 | function Foo() { 6 | /** this is a zip. */ 7 | this.zip = function() {} 8 | 9 | /** from Bar */ 10 | this.my_zop = new Bar().zop; 11 | } 12 | 13 | /** 14 | @class 15 | @borrows Foo#zip as this.my_zip 16 | */ 17 | function Bar() { 18 | /** this is a zop. */ 19 | this.zop = function() {} 20 | 21 | /** from Foo */ 22 | this.my_zip = new Foo().zip; 23 | } 24 | 25 | /** @namespace */ 26 | var myObject = { 27 | /** 28 | @type function 29 | */ 30 | myFunc: getFunction() 31 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/tosource.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Object} object 3 | * @return {string} 4 | */ 5 | function valueOf(object) {} 6 | 7 | /** 8 | * @param {Object} object 9 | * @return {string} 10 | */ 11 | function toString(object) {} 12 | 13 | /** 14 | * @param {Object} object 15 | * @return {string} 16 | */ 17 | function toSource(object) {} 18 | 19 | /** 20 | * @param {Object} object 21 | * @return {string} 22 | */ 23 | function constructor(object) {} -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/app/test/variable_redefine.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Foo() { 3 | var bar = 1; 4 | bar = 2; // redefining a private 5 | 6 | this.baz = 1; 7 | baz = 2; // global 8 | 9 | /** a private */ 10 | var blap = { 11 | /** in here */ 12 | tada: 1 13 | } 14 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/conf/sample.conf: -------------------------------------------------------------------------------- 1 | /* 2 | This is an example of one way you could set up a configuration file to more 3 | conveniently define some commandline options. You might like to do this if 4 | you frequently reuse the same options. Note that you don't need to define 5 | every option in this file, you can combine a configuration file with 6 | additional options on the commandline if your wish. 7 | 8 | You would include this configuration file by running JsDoc Toolkit like so: 9 | java -jar jsrun.jar app/run.js -c=conf/sample.conf 10 | 11 | */ 12 | 13 | { 14 | // source files to use 15 | _: ['app/test/jsdoc_test.js'], 16 | 17 | // document all functions, even uncommented ones 18 | a: true, 19 | 20 | // including those marked @private 21 | p: true, 22 | 23 | // some extra variables I want to include 24 | D: {generatedBy: "Michael Mathews", copyright: "2008"}, 25 | 26 | // use this directory as the output directory 27 | d: "docs", 28 | 29 | // use this template 30 | t: "templates/jsdoc" 31 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/build_1.4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/classes/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/classes/js.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/src/JsDebugRun.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A trivial bootstrap class that simply adds the path to the 3 | * .js file as an argument to the Rhino call. This little hack 4 | * allows the code in the .js file to have access to it's own 5 | * path via the Rhino arguments object. This is necessary to 6 | * allow the .js code to find resource files in a location 7 | * relative to itself. 8 | * 9 | * USAGE: java -jar jsdebug.jar path/to/file.js 10 | */ 11 | public class JsDebugRun { 12 | public static void main(String[] args) { 13 | String[] jsargs = {"-j="+args[0]}; 14 | 15 | String[] allArgs = new String[jsargs.length + args.length]; 16 | System.arraycopy(args, 0, allArgs, 0, args.length); 17 | System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length); 18 | 19 | org.mozilla.javascript.tools.debugger.Main.main(allArgs); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/java/src/JsRun.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A trivial bootstrap class that simply adds the path to the 3 | * .js file as an argument to the Rhino call. This little hack 4 | * allows the code in the .js file to have access to it's own 5 | * path via the Rhino arguments object. This is necessary to 6 | * allow the .js code to find resource files in a location 7 | * relative to itself. 8 | * 9 | * USAGE: java -jar jsrun.jar path/to/file.js 10 | */ 11 | public class JsRun { 12 | public static void main(String[] args) { 13 | String[] jsargs = {"-j="+args[0]}; 14 | 15 | String[] allArgs = new String[jsargs.length + args.length]; 16 | System.arraycopy(args, 0, allArgs, 0, args.length); 17 | System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length); 18 | 19 | org.mozilla.javascript.tools.shell.Main.main(allArgs); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/jsdebug.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/jsdoc-toolkit-2.4.0/jsdebug.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/jsrun.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/jsdoc-toolkit-2.4.0/jsrun.jar -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/jsrun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | # launcher script for jsdoc 4 | # Author: Avi Deitcher 5 | # 6 | # This program is released under the MIT License as follows: 7 | 8 | # Copyright (c) 2008-2009 Atomic Inc 9 | # 10 | #Permission is hereby granted, free of charge, to any person 11 | #obtaining a copy of this software and associated documentation 12 | #files (the "Software"), to deal in the Software without 13 | #restriction, including without limitation the rights to use, 14 | #copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | #copies of the Software, and to permit persons to whom the 16 | #Software is furnished to do so, subject to the following 17 | #conditions: 18 | ## 19 | #The above copyright notice and this permission notice shall be 20 | #included in all copies or substantial portions of the Software. 21 | # 22 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | #EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 24 | #OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | #NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 26 | #HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 27 | #WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | #FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | #OTHER DEALINGS IN THE SOFTWARE. 30 | # 31 | 32 | 33 | if [[ -n "$JSDOCDIR" ]]; then 34 | _DOCDIR="-Djsdoc.dir=$JSDOCDIR" 35 | _APPDIR="$JSDOCDIR/app" 36 | _BASEDIR="$JSDOCDIR" 37 | else 38 | _DOCDIR="" 39 | _APPDIR="./app" 40 | _BASEDIR="." 41 | fi 42 | 43 | if [[ -n "$JSDOCTEMPLATEDIR" ]]; then 44 | _TDIR="-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" 45 | else 46 | _TDIR="" 47 | fi 48 | 49 | CMD="java $_DOCDIR $_TDIR -jar $_BASEDIR/jsrun.jar $_APPDIR/run.js $@" 50 | echo $CMD 51 | $CMD 52 | 53 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/allclasses.tmpl: -------------------------------------------------------------------------------- 1 |
{+new Link().toFile("index.html").withText("Class Index")+} 2 | | {+new Link().toFile("files.html").withText("File Index")+}
3 |
4 |

Classes

5 |
    6 | 7 |
  • {! 8 | if (thisClass.alias == "_global_") { 9 | output += ""+new Link().toClass(thisClass.alias)+""; 10 | } 11 | else { 12 | output += new Link().toClass(thisClass.alias); 13 | } 14 | !}
  • 15 |
    16 |
17 |
-------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/allfiles.tmpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | {! Link.base = ""; /* all generated links will be relative to this */ !} 7 | JsDoc Reference - File Index 8 | 9 | 10 | 13 | 14 | 15 | 16 | {+include("static/header.html")+} 17 | 18 |
19 | {+publish.classesIndex+} 20 |
21 | 22 |
23 |

File Index

24 | 25 | 26 |
27 |

{+new Link().toSrc(item.alias).withText(item.name)+}

28 | {+resolveLinks(item.desc)+} 29 |
30 | 31 |
Author:
32 |
{+item.author+}
33 |
34 | 35 |
Version:
36 |
{+item.version+}
37 |
38 | {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !} 39 | 40 |
Location:
41 | 42 |
{+location+}
43 |
44 |
45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 | ©{+JSDOC.opt.D.copyright+}
53 | Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} 54 |
55 | 56 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/index.tmpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsDoc Reference - Index 8 | 9 | 10 | 13 | 14 | 15 | 16 | {+include("static/header.html")+} 17 | 18 |
19 | {+publish.classesIndex+} 20 |
21 | 22 |
23 |

Class Index

24 | 25 | 26 |
27 |

{+(new Link().toSymbol(thisClass.alias))+}

28 | {+resolveLinks(summarize(thisClass.classDesc))+} 29 |
30 |
31 |
32 | 33 |
34 |
35 | ©{+JSDOC.opt.D.copyright+}
36 | Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} 37 |
38 | 39 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/static/default.css: -------------------------------------------------------------------------------- 1 | /* default.css */ 2 | body 3 | { 4 | font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; 5 | width: 800px; 6 | } 7 | 8 | .header 9 | { 10 | clear: both; 11 | background-color: #ccc; 12 | padding: 8px; 13 | } 14 | 15 | h1 16 | { 17 | font-size: 150%; 18 | font-weight: bold; 19 | padding: 0; 20 | margin: 1em 0 0 .3em; 21 | } 22 | 23 | hr 24 | { 25 | border: none 0; 26 | border-top: 1px solid #7F8FB1; 27 | height: 1px; 28 | } 29 | 30 | pre.code 31 | { 32 | display: block; 33 | padding: 8px; 34 | border: 1px dashed #ccc; 35 | } 36 | 37 | #index 38 | { 39 | margin-top: 24px; 40 | float: left; 41 | width: 160px; 42 | position: absolute; 43 | left: 8px; 44 | background-color: #F3F3F3; 45 | padding: 8px; 46 | } 47 | 48 | #content 49 | { 50 | margin-left: 190px; 51 | width: 600px; 52 | } 53 | 54 | .classList 55 | { 56 | list-style-type: none; 57 | padding: 0; 58 | margin: 0 0 0 8px; 59 | font-family: arial, sans-serif; 60 | font-size: 1em; 61 | overflow: auto; 62 | } 63 | 64 | .classList li 65 | { 66 | padding: 0; 67 | margin: 0 0 8px 0; 68 | } 69 | 70 | .summaryTable { width: 100%; } 71 | 72 | h1.classTitle 73 | { 74 | font-size:170%; 75 | line-height:130%; 76 | } 77 | 78 | h2 { font-size: 110%; } 79 | caption, div.sectionTitle 80 | { 81 | background-color: #7F8FB1; 82 | color: #fff; 83 | font-size:130%; 84 | text-align: left; 85 | padding: 2px 6px 2px 6px; 86 | border: 1px #7F8FB1 solid; 87 | } 88 | 89 | div.sectionTitle { margin-bottom: 8px; } 90 | .summaryTable thead { display: none; } 91 | 92 | .summaryTable td 93 | { 94 | vertical-align: top; 95 | padding: 4px; 96 | border-bottom: 1px #7F8FB1 solid; 97 | border-right: 1px #7F8FB1 solid; 98 | } 99 | 100 | /*col#summaryAttributes {}*/ 101 | .summaryTable td.attributes 102 | { 103 | border-left: 1px #7F8FB1 solid; 104 | width: 140px; 105 | text-align: right; 106 | } 107 | 108 | td.attributes, .fixedFont 109 | { 110 | line-height: 15px; 111 | color: #002EBE; 112 | font-family: "Courier New",Courier,monospace; 113 | font-size: 13px; 114 | } 115 | 116 | .summaryTable td.nameDescription 117 | { 118 | text-align: left; 119 | font-size: 13px; 120 | line-height: 15px; 121 | } 122 | 123 | .summaryTable td.nameDescription, .description 124 | { 125 | line-height: 15px; 126 | padding: 4px; 127 | padding-left: 4px; 128 | } 129 | 130 | .summaryTable { margin-bottom: 8px; } 131 | 132 | ul.inheritsList 133 | { 134 | list-style: square; 135 | margin-left: 20px; 136 | padding-left: 0; 137 | } 138 | 139 | .detailList { 140 | margin-left: 20px; 141 | line-height: 15px; 142 | } 143 | .detailList dt { margin-left: 20px; } 144 | 145 | .detailList .heading 146 | { 147 | font-weight: bold; 148 | padding-bottom: 6px; 149 | margin-left: 0; 150 | } 151 | 152 | .light, td.attributes, .light a:link, .light a:visited 153 | { 154 | color: #777; 155 | font-style: italic; 156 | } 157 | 158 | .fineprint 159 | { 160 | text-align: right; 161 | font-size: 10px; 162 | } -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/static/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/static/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Generated Javascript Documentation 7 | 8 | 9 | 10 | 11 | 12 | <body> 13 | <p> 14 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 15 | </p> 16 | </body> 17 | 18 | 19 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoc-toolkit-2.4.0/templates/jsdoc/symbol.tmpl: -------------------------------------------------------------------------------- 1 | 2 | {+data.name+} 3 | {+data.memberOf+} 4 | {+data.isStatic+} 5 | {+data.isa+} 6 | {+data.desc+} 7 | {+data.classDesc+} 8 | 9 | 10 | 11 | {+method.name+} 12 | {+method.memberOf+} 13 | {+method.isStatic+} 14 | {+method.desc+} 15 | 16 | 17 | {+param.type+} 18 | {+param.name+} 19 | {+param.desc+} 20 | {+param.defaultValue+} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {+property.name+} 29 | {+property.memberOf+} 30 | {+property.isStatic+} 31 | {+property.desc+} 32 | {+property.type+} 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /build/tasks/JSDoc/jsdoctoolkit-ant-task-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/JSDoc/jsdoctoolkit-ant-task-1.0.2.jar -------------------------------------------------------------------------------- /build/tasks/YUICompress/YUIAnt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/YUICompress/YUIAnt.jar -------------------------------------------------------------------------------- /build/tasks/YUICompress/yuicompressor-2.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/build/tasks/YUICompress/yuicompressor-2.4.2.jar -------------------------------------------------------------------------------- /cof/jconfig.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @namespace JConfig a collection of configuration values 4 | * @property {string} solverType the solver to use - can be one of FAST NORMAL or ACCUMULATED 5 | * @property {string} boxCollisionsType can be one of EDGEBASE or SORTBASE 6 | * @property {string} rotationType the unit of rotation - can be one of DEGREES or RADIANS 7 | * @property {boolean} aabbDetection whether to execute aabb detection 8 | * @property {boolean} doShockStep whether to perform the shock step (helps with stacking) 9 | * @property {number} allowedPenetration the amount of penetration to be permitted 10 | * @property {number} collToll collision detection tolerance 11 | * @property {number} velThreshold the line velocity threshold for freezing 12 | * @property {number} angVelThreshold the angle velocity threshold for freezing 13 | * @property {number} posThreshold the threshold for detecting position changes during deactivation 14 | * @property {number} orientThreshold the threshold for detecting orientation changes during deactivation 15 | * @property {number} deactivationTime how long it takes to go from active to frozen when stationary 16 | * @property {number} numPenetrationRelaxationTimesteps the number of timesteps over which to resolve penetration 17 | * @property {number} numCollisionIterations the number of collision iterations 18 | * @property {number} numContactIterations the number of contact iterations 19 | * @property {number} numConstraintIterations number of constraint iterations 20 | **/ 21 | jigLib.JConfig={ 22 | solverType: "ACCUMULATED", 23 | boxCollisionsType: "EDGEBASE", 24 | rotationType: "DEGREES", 25 | aabbDetection: true, 26 | doShockStep: false, 27 | allowedPenetration: 0.015, 28 | collToll: 0.01, 29 | velThreshold: 0.1, 30 | angVelThreshold: 5, 31 | posThreshold: 0.1, 32 | orientThreshold: 0.1, 33 | deactivationTime: 0.1, 34 | numPenetrationRelaxationTimesteps: 20, 35 | numCollisionIterations: 4, 36 | numContactIterations: 5, 37 | numConstraintIterations: 15 38 | }; 39 | 40 | })(jigLib); 41 | -------------------------------------------------------------------------------- /collision/colldetectboxplane.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | var Vector3DUtil=jigLib.Vector3DUtil; 23 | var JNumber3D=jigLib.JNumber3D; 24 | var JConstraint=jigLib.JConstraint; 25 | var JConfig=jigLib.JConfig; 26 | var JPlane=jigLib.JPlane; 27 | var JSegment=jigLib.JSegment; 28 | var JBox=jigLib.JBox; 29 | var MaterialProperties=jigLib.MaterialProperties; 30 | var RigidBody=jigLib.RigidBody; 31 | var CollPointInfo=jigLib.CollPointInfo; 32 | var CollisionInfo=jigLib.CollisionInfo; 33 | 34 | /** 35 | * @author Muzer(muzerly@gmail.com) 36 | * 37 | * @name CollDetectBoxPlane 38 | * @class CollDetectBoxPlane handles collisions between boxes and planes 39 | * @extends CollDetectFunctor 40 | * @requires CollDetectInfo 41 | * @requires Vector3DUtil 42 | * @constructor 43 | **/ 44 | var CollDetectBoxPlane=function(){ 45 | this.name = "BoxPlane"; 46 | this.type0 = "BOX"; 47 | this.type1 = "PLANE"; 48 | }; 49 | jigLib.extend(CollDetectBoxPlane,jigLib.CollDetectFunctor); 50 | 51 | /** 52 | * @function collDetect detects a collision and updates the info parameter 53 | * @param {CollDetectInfo} info 54 | * @param {array} collArray 55 | * @type void 56 | **/ 57 | CollDetectBoxPlane.prototype.collDetect=function(info, collArr){ 58 | var tempBody; 59 | if (info.body0.get_type() == "PLANE"){ 60 | tempBody = info.body0; 61 | info.body0 = info.body1; 62 | info.body1 = tempBody; 63 | } 64 | 65 | var box = info.body0; 66 | var plane = info.body1; 67 | 68 | var centreDist= plane.pointPlaneDistance(box.get_currentState().position); 69 | 70 | if (centreDist > box.get_boundingSphere() + JConfig.collToll) 71 | return; 72 | 73 | var newPts = box.getCornerPoints(box.get_currentState()); 74 | var oldPts = box.getCornerPoints(box.get_oldState()); 75 | var collPts = []; 76 | var cpInfo; 77 | var newPt; 78 | var oldPt; 79 | var newDepth; 80 | var oldDepth; 81 | 82 | for (var i=0; i<8; i++){ 83 | newPt = newPts[i]; 84 | oldPt = oldPts[i]; 85 | newDepth = -1 * plane.pointPlaneDistance(newPt); 86 | oldDepth = -1 * plane.pointPlaneDistance(oldPt); 87 | if (Math.max(newDepth, oldDepth) > -JConfig.collToll){ 88 | cpInfo = new CollPointInfo(); 89 | cpInfo.r0 = Vector3DUtil.subtract(oldPt, box.get_oldState().position); 90 | cpInfo.r1 = Vector3DUtil.subtract(oldPt, plane.get_oldState().position); 91 | cpInfo.initialPenetration = oldDepth; 92 | collPts.push(cpInfo); 93 | } 94 | } 95 | if (collPts.length > 0){ 96 | var collInfo = new CollisionInfo(); 97 | collInfo.objInfo = info; 98 | collInfo.dirToBody = plane.get_normal(); 99 | collInfo.pointInfo = collPts; 100 | 101 | var mat = new MaterialProperties(); 102 | mat.set_restitution(Math.sqrt(box.get_material().get_restitution() * plane.get_material().get_restitution())); 103 | mat.set_friction(Math.sqrt(box.get_material().get_friction() * plane.get_material().get_friction())); 104 | collInfo.mat = mat; 105 | collArr.push(collInfo); 106 | info.body0.collisions.push(collInfo); 107 | info.body1.collisions.push(collInfo); 108 | } 109 | }; 110 | 111 | jigLib.CollDetectBoxPlane=CollDetectBoxPlane; 112 | 113 | })(jigLib); -------------------------------------------------------------------------------- /collision/colldetectboxterrain.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | var Vector3DUtil=jigLib.Vector3DUtil; 23 | var JNumber3D=jigLib.JNumber3D; 24 | var JConstraint=jigLib.JConstraint; 25 | var JConfig=jigLib.JConfig; 26 | var JTerrain=jigLib.JTerrain; 27 | var JBox=jigLib.JBox; 28 | var MaterialProperties=jigLib.MaterialProperties; 29 | var RigidBody=jigLib.RigidBody; 30 | 31 | /** 32 | * @author Muzer(muzerly@gmail.com) 33 | * 34 | * @name CollDetectBoxTerrain 35 | * @class CollDetectBoxTerrain handles collisions between boxes and terrain 36 | * @extends CollDetectFunctor 37 | * @requires CollDetectInfo 38 | * @requires CollPointInfo 39 | * @requires Vector3DUtil 40 | * @requires MaterialProperties 41 | * @constructor 42 | **/ 43 | var CollDetectBoxTerrain=function(){ 44 | this.name = "BoxTerrain"; 45 | this.type0 = "BOX"; 46 | this.type1 = "TERRAIN"; 47 | }; 48 | jigLib.extend(CollDetectBoxTerrain,jigLib.CollDetectFunctor); 49 | 50 | /** 51 | * @function collDetect detects a collision and updates the info parameter 52 | * @param {CollDetectInfo} info 53 | * @param {array} collArray 54 | * @type void 55 | **/ 56 | CollDetectBoxTerrain.prototype.collDetect=function(info, collArr){ 57 | var tempBody; 58 | if (info.body0.type == "TERRAIN"){ 59 | tempBody = info.body0; 60 | info.body0 = info.body1; 61 | info.body1 = tempBody; 62 | } 63 | 64 | var box = info.body0; 65 | var terrain = info.body1; 66 | 67 | var oldPts = box.getCornerPoints(box.oldState); 68 | var newPts = box.getCornerPoints(box.currentState); 69 | var collNormal = [0,0,0,0]; 70 | 71 | var obj; 72 | var dist; 73 | var newPt; 74 | var oldPt; 75 | 76 | var collPts = []; 77 | var cpInfo; 78 | 79 | for (var i = 0; i < 8; i++ ) { 80 | newPt = newPts[i]; 81 | obj = terrain.getHeightAndNormalByPoint(newPt); 82 | 83 | if (obj.height < JConfig.collToll) { 84 | oldPt = oldPts[i]; 85 | dist = terrain.getHeightByPoint(oldPt); 86 | collNormal = Vector3DUtil.add(collNormal, obj.normal); 87 | cpInfo = new CollPointInfo(); 88 | cpInfo.r0 = Vector3DUtil.subtract(oldPt, box.oldState.position); 89 | cpInfo.r1 = Vector3DUtil.subtract(oldPt, terrain.oldState.position); 90 | cpInfo.initialPenetration = -dist; 91 | collPts.push(cpInfo); 92 | } 93 | } 94 | 95 | if (collPts.length > 0) { 96 | Vector3DUtil.normalize(collNormal); 97 | var collInfo = new CollisionInfo(); 98 | collInfo.objInfo = info; 99 | collInfo.dirToBody = collNormal; 100 | collInfo.pointInfo = collPts; 101 | var mat = new MaterialProperties(); 102 | mat.restitution = Math.sqrt(box.material.restitution * terrain.material.restitution); 103 | mat.friction = Math.sqrt(box.material.friction * terrain.material.friction); 104 | collInfo.mat = mat; 105 | collArr.push(collInfo); 106 | info.body0.collisions.push(collInfo); 107 | info.body1.collisions.push(collInfo); 108 | }; 109 | }; 110 | 111 | jigLib.CollDetectBoxTerrain=CollDetectBoxTerrain; 112 | 113 | })(jigLib); -------------------------------------------------------------------------------- /collision/colldetectfunctor.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | /** 23 | * @author Muzer(muzerly@gmail.com) 24 | * 25 | * @name CollDetectFunctor 26 | * @class CollDetectFunctor base class for collision detection classes 27 | * @property {string} name the inheriting class's collision type e.g. BoxPlane 28 | * @property {string} type0 the first geometry type in the collisions supported by the inheritng class e.g. Box 29 | * @property {string} type1 the second geometry type in the collisions supported by the inheritng class e.g. Plane 30 | * @constructor 31 | **/ 32 | var CollDetectFunctor=function(){ 33 | }; 34 | 35 | CollDetectFunctor.prototype.name=null; 36 | CollDetectFunctor.prototype.type0=null; 37 | CollDetectFunctor.prototype.type1=null; 38 | 39 | /** 40 | * @function collDetect detects a collision and updates the info parameter - must be implemented by the inheriting class 41 | * @param {CollDetectInfo} info 42 | * @param {array} collArray 43 | * @type void 44 | **/ 45 | CollDetectFunctor.prototype.collDetect=function(info,collArr){ 46 | }; 47 | 48 | jigLib.CollDetectFunctor=CollDetectFunctor; 49 | 50 | })(jigLib); -------------------------------------------------------------------------------- /collision/colldetectinfo.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | /** 23 | * @author Muzer(muzerly@gmail.com) 24 | * 25 | * @name CollDetectInfo 26 | * @class CollDetectInfo stores 2 rigid bodies and is used by collision detection classes 27 | * @property {RigidBody} body0 28 | * @property {RigidBody} body1 29 | * @constructor 30 | */ 31 | var CollDetectInfo=function(){ 32 | }; 33 | CollDetectInfo.prototype.body0=null; 34 | CollDetectInfo.prototype.body1=null; 35 | 36 | jigLib.CollDetectInfo=CollDetectInfo; 37 | })(jigLib); -------------------------------------------------------------------------------- /collision/colldetectsphereplane.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | var Vector3DUtil=jigLib.Vector3DUtil; 23 | var JNumber3D=jigLib.JNumber3D; 24 | var JConstraint=jigLib.JConstraint; 25 | var JConfig=jigLib.JConfig; 26 | var JSphere=jigLib.JSphere; 27 | var MaterialProperties=jigLib.MaterialProperties; 28 | var RigidBody=jigLib.RigidBody; 29 | var CollPointInfo=jigLib.CollPointInfo; 30 | var CollisionInfo=jigLib.CollisionInfo; 31 | 32 | /** 33 | * @author Muzer(muzerly@gmail.com) 34 | * 35 | * @name CollDetectSpherePlane 36 | * @class CollDetectSpherePlane handles collisions between spheres and planes 37 | * @extends CollDetectFunctor 38 | * @requires CollDetectInfo 39 | * @requires CollisionInfo 40 | * @requires Vector3DUtil 41 | * @requires JNumber3D 42 | * @requires MaterialProperties 43 | * @constructor 44 | **/ 45 | var CollDetectSpherePlane=function(){ 46 | this.name = "SpherePlane"; 47 | this.type0 = "SPHERE"; 48 | this.type1 = "PLANE"; 49 | }; 50 | jigLib.extend(CollDetectSpherePlane,jigLib.CollDetectFunctor); 51 | 52 | /** 53 | * @function collDetect detects a collision and updates the info parameter 54 | * @param {CollDetectInfo} info 55 | * @param {array} collArray 56 | * @type void 57 | **/ 58 | CollDetectSpherePlane.prototype.collDetect=function(info, collArr){ 59 | var tempBody; 60 | if (info.body0.get_type() == "PLANE"){ 61 | tempBody = info.body0; 62 | info.body0 = info.body1; 63 | info.body1 = tempBody; 64 | } 65 | 66 | var sphere = info.body0; 67 | var plane = info.body1; 68 | var oldDist = plane.pointPlaneDistance(sphere.get_oldState().position); 69 | var newDist = plane.pointPlaneDistance(sphere.get_currentState().position); 70 | 71 | if (Math.min(newDist, oldDist) > sphere.get_boundingSphere() + JConfig.collToll){ 72 | return; 73 | } 74 | 75 | var collPts = []; 76 | var cpInfo; 77 | var depth = sphere.get_radius() - oldDist; 78 | 79 | var worldPos = Vector3DUtil.subtract(sphere.get_oldState().position, JNumber3D.getScaleVector(plane.get_normal(), sphere.get_radius())); 80 | cpInfo = new CollPointInfo(); 81 | cpInfo.r0 = Vector3DUtil.subtract(worldPos, sphere.get_oldState().position); 82 | cpInfo.r1 = Vector3DUtil.subtract(worldPos, plane.get_oldState().position); 83 | cpInfo.initialPenetration = depth; 84 | collPts.push(cpInfo); 85 | 86 | var collInfo = new CollisionInfo(); 87 | collInfo.objInfo = info; 88 | collInfo.dirToBody = plane.get_normal(); 89 | collInfo.pointInfo = collPts; 90 | var mat = new MaterialProperties(); 91 | mat.set_restitution(Math.sqrt(sphere.get_material().get_restitution() * plane.get_material().get_restitution())); 92 | mat.set_friction(Math.sqrt(sphere.get_material().get_friction() * plane.get_material().get_friction())); 93 | collInfo.mat = mat; 94 | collArr.push(collInfo); 95 | info.body0.collisions.push(collInfo); 96 | info.body1.collisions.push(collInfo); 97 | }; 98 | 99 | jigLib.CollDetectSpherePlane=CollDetectSpherePlane; 100 | 101 | })(jigLib); -------------------------------------------------------------------------------- /collision/colldetectsphereterrain.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | var Vector3DUtil=jigLib.Vector3DUtil; 23 | var JNumber3D=jigLib.JNumber3D; 24 | var JConstraint=jigLib.JConstraint; 25 | var JConfig=jigLib.JConfig; 26 | var JSphere=jigLib.JSphere; 27 | var JTerrain=jigLib.JTerrain; 28 | var MaterialProperties=jigLib.MaterialProperties; 29 | var RigidBody=jigLib.RigidBody; 30 | 31 | /** 32 | * @author Muzer(muzerly@gmail.com) 33 | * 34 | * @name CollDetectSphereTerrain 35 | * @class CollDetectSphereTerrain handles collisions between spheres and terrain 36 | * @extends CollDetectFunctor 37 | * @requires CollDetectInfo 38 | * @requires CollPointInfo 39 | * @requires CollisionInfo 40 | * @requires Vector3DUtil 41 | * @requires JNumber3D 42 | * @requires MaterialProperties 43 | * @constructor 44 | **/ 45 | var CollDetectSphereTerrain=function(){ 46 | this.name = "SphereTerrain"; 47 | this.type0 = "SPHERE"; 48 | this.type1 = "TERRAIN"; 49 | }; 50 | jigLib.extend(CollDetectSphereTerrain,jigLib.CollDetectFunctor); 51 | 52 | /** 53 | * @function collDetect detects a collision and updates the info parameter 54 | * @param {CollDetectInfo} info 55 | * @param {array} collArray 56 | * @type void 57 | **/ 58 | CollDetectSphereTerrain.prototype.collDetect=function(info, collArr){ 59 | var tempBody; 60 | if (info.body0.type == "TERRAIN"){ 61 | tempBody = info.body0; 62 | info.body0 = info.body1; 63 | info.body1 = tempBody; 64 | } 65 | 66 | var sphere = info.body0; 67 | var terrain = info.body1; 68 | 69 | var obj = terrain.getHeightAndNormalByPoint(sphere.currentState.position); 70 | if (obj.height < JConfig.collToll + sphere.radius) { 71 | var dist = terrain.getHeightByPoint(sphere.oldState.position); 72 | var depth = sphere.radius - dist; 73 | 74 | var Pt = Vector3DUtil.subtract(sphere.oldState.position, JNumber3D.getScaleVector(obj.normal, sphere.radius)); 75 | 76 | var collPts = []; 77 | var cpInfo = new CollPointInfo(); 78 | cpInfo.r0 = Vector3DUtil.subtract(Pt, sphere.oldState.position); 79 | cpInfo.r1 = Vector3DUtil.subtract(Pt, terrain.oldState.position); 80 | cpInfo.initialPenetration = depth; 81 | collPts.push(cpInfo); 82 | 83 | var collInfo = new CollisionInfo(); 84 | collInfo.objInfo = info; 85 | collInfo.dirToBody = obj.normal; 86 | collInfo.pointInfo = collPts; 87 | var mat = new MaterialProperties(); 88 | mat.restitution = Math.sqrt(sphere.material.restitution * terrain.material.restitution); 89 | mat.friction = Math.sqrt(sphere.material.friction * terrain.material.friction); 90 | collInfo.mat = mat; 91 | collArr.push(collInfo); 92 | info.body0.collisions.push(collInfo); 93 | info.body1.collisions.push(collInfo); 94 | } 95 | }; 96 | jigLib.CollDetectSphereTerrain=CollDetectSphereTerrain; 97 | })(jigLib); -------------------------------------------------------------------------------- /collision/collisioninfo.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | var MaterialProperties=jigLib.MaterialProperties; 23 | 24 | /** 25 | * @author Muzer(muzerly@gmail.com) 26 | * 27 | * @name CollisionInfo 28 | * @class CollisionInfo stores information about a collision 29 | * @requires MaterialProperties 30 | * @property {MaterialProperties} mat 31 | * @property {CollDetectInfo} objInfo 32 | * @property {array} pointInfo a collection of points expressed as 3D vectors 33 | * @property {boolean} satisfied whether the collision has been satisfied 34 | * @constructor 35 | **/ 36 | var CollisionInfo=function(){ 37 | this.mat=new MaterialProperties(); 38 | this.pointInfo=[]; 39 | }; 40 | CollisionInfo.prototype.mat=null; 41 | CollisionInfo.prototype.objInfo=null; 42 | CollisionInfo.prototype.dirToBody=null; 43 | CollisionInfo.prototype.pointInfo=null; 44 | CollisionInfo.prototype.satisfied=null; 45 | 46 | jigLib.CollisionInfo=CollisionInfo; 47 | })(jigLib); 48 | -------------------------------------------------------------------------------- /collision/collisionsystembrute.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | var RigidBody=jigLib.RigidBody; 4 | var CollDetectInfo=jigLib.CollDetectInfo; 5 | 6 | 7 | var CollisionSystemBrute=function(){ 8 | this.Super(); 9 | }; 10 | jigLib.extend(CollisionSystemBrute,jigLib.CollisionSystemAbstract); 11 | 12 | // Detects collisions between the all bodies 13 | CollisionSystemBrute.prototype.detectAllCollisions=function(bodies, collArr){ 14 | var info; 15 | var fu; 16 | var bodyID; 17 | var bodyType; 18 | this._numCollisionsChecks = 0; 19 | 20 | for(j=0;j _collBody.id){ 33 | continue; 34 | } 35 | 36 | if (this.checkCollidables(_body, _collBody) && this.detectionFunctors[bodyType + "_" + _collBody.get_type()] != undefined){ 37 | info = new CollDetectInfo(); 38 | info.body0 = _body; 39 | info.body1 = _collBody; 40 | fu = this.detectionFunctors[info.body0.get_type() + "_" + info.body1.get_type()]; 41 | fu.collDetect(info, collArr); 42 | this._numCollisionsChecks += 1; 43 | } 44 | } 45 | } 46 | } 47 | 48 | jigLib.CollisionSystemBrute=CollisionSystemBrute; 49 | 50 | })(jigLib); 51 | 52 | -------------------------------------------------------------------------------- /collision/collisionsystemgridentry.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | var RigidBody=jigLib.RigidBody; 4 | 5 | var CollisionSystemGridEntry=function(collisionBody) { 6 | this.collisionBody = collisionBody; 7 | this.previous = this.next = null; 8 | }; 9 | 10 | CollisionSystemGridEntry.prototype.collisionBody=null; 11 | CollisionSystemGridEntry.prototype.previous=null; 12 | CollisionSystemGridEntry.prototype.next=null; 13 | CollisionSystemGridEntry.prototype.gridIndex=0; 14 | 15 | /* 16 | * Removes the entry by updating its neighbours. Also zaps the prev/next 17 | * pointers in the entry, to help debugging 18 | */ 19 | CollisionSystemGridEntry.removeGridEntry=function(entry){ 20 | // link the previous to the next (may be 0) 21 | entry.previous.next = entry.next; 22 | // link the next (if it exists) to the previous. 23 | if (entry.next != null) 24 | entry.next.previous = entry.previous; 25 | // tidy up this entry 26 | entry.previous = entry.next = null; 27 | entry.gridIndex = -2; 28 | }; 29 | 30 | /* 31 | * Inserts an entry after prev, updating all links 32 | * @param entry prev 33 | */ 34 | CollisionSystemGridEntry.insertGridEntryAfter=function(entry, prev){ 35 | var next = prev.next; 36 | prev.next = entry; 37 | entry.previous = prev; 38 | entry.next = next; 39 | if (next != null) 40 | next.previous = entry; 41 | entry.gridIndex = prev.gridIndex; 42 | } 43 | 44 | jigLib.CollisionSystemGridEntry=CollisionSystemGridEntry; 45 | 46 | })(jigLib); -------------------------------------------------------------------------------- /collision/collpointinfo.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | /** 23 | * @author Muzer(muzerly@gmail.com) 24 | * 25 | * @name CollPointInfo 26 | * @class CollPointInfo 27 | * @property {number} initialPenetration 28 | * @property {array} r0 a 3D vector 29 | * @property {array} r1 a 3D vector 30 | * @property {array} position a 3D vector 31 | * @property {number} minSeparationVel 32 | * @property {number} denominator 33 | * @property {number} accumulatedNormalImpulse 34 | * @property {number} accumulatedNormalImpulseAux 35 | * @property {array} accumulatedFrictionImpulse a 3D vector 36 | * @constructor 37 | **/ 38 | var CollPointInfo=function(){ 39 | this.accumulatedFrictionImpulse=[0,0,0,0]; 40 | }; 41 | 42 | CollPointInfo.prototype.initialPenetration=null; 43 | CollPointInfo.prototype.r0; 44 | CollPointInfo.prototype.r1; 45 | CollPointInfo.prototype.position; 46 | 47 | CollPointInfo.prototype.minSeparationVel = 0; 48 | CollPointInfo.prototype.denominator = 0; 49 | 50 | CollPointInfo.prototype.accumulatedNormalImpulse = 0; 51 | CollPointInfo.prototype.accumulatedNormalImpulseAux = 0; 52 | CollPointInfo.prototype.accumulatedFrictionImpulse = null; 53 | 54 | jigLib.CollPointInfo=CollPointInfo; 55 | })(jigLib); -------------------------------------------------------------------------------- /data/colloutbodydata.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | var RigidBody=jigLib.RigidBody; 4 | 5 | var CollOutBodyData=function(frac, position, normal, rigidBody){ 6 | if(frac==undefined) frac=0; 7 | this.Super(frac, position, normal); 8 | this.rigidBody = rigidBody; 9 | }; 10 | jigLib.extend(CollOutBodyData,jigLib.CollOutData); 11 | 12 | jigLib.CollOutBodyData=CollOutBodyData; 13 | 14 | })(jigLib); 15 | -------------------------------------------------------------------------------- /data/colloutdata.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | var RigidBody=jigLib.RigidBody; 4 | 5 | var CollOutData=function(frac, position, normal){ 6 | if(frac==undefined)frac=0; 7 | 8 | this.frac = frac; 9 | this.position = position ? position : [0,0,0]; 10 | this.normal = normal ? normal : [0,0,0]; 11 | }; 12 | 13 | jigLib.CollOutData=CollOutData; 14 | 15 | })(jigLib); 16 | -------------------------------------------------------------------------------- /data/contactdata.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @author katopz 4 | * 5 | * @name ContactData 6 | * @class ContactData stores information about a contact between 2 objects 7 | * @property {BodyPair} pair 8 | * @property {CachedImpulse} impulse 9 | * @constructor 10 | **/ 11 | var ContactData=function(){}; 12 | ContactData.prototype.pair=null; 13 | ContactData.prototype.impulse=null; 14 | 15 | jigLib.ContactData=ContactData; 16 | })(jigLib); 17 | 18 | -------------------------------------------------------------------------------- /data/edgedata.js: -------------------------------------------------------------------------------- 1 | 2 | (function(jigLib){ 3 | /** 4 | * @author katopz 5 | * 6 | * @name EdgeData 7 | * @class EdgeData describes an edge in terms of the numbers of it's connecting vertices - used by JBox 8 | * @property {number} ind0 the number of the vertex at the start of the edge 9 | * @property {number} ind1 the number of the vertex at the end of the edge 10 | * @constructor 11 | **/ 12 | var EdgeData=function(ind0, ind1){ 13 | this.ind0 = ind0; 14 | this.ind1 = ind1; 15 | }; 16 | 17 | jigLib.EdgeData=EdgeData; 18 | })(jigLib); -------------------------------------------------------------------------------- /data/octreecell.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | var JAABox=jigLib.JAABox; 4 | var JNumber3D=jigLib.JNumber3D; 5 | 6 | var OctreeCell=function(aabox){ 7 | this.childCellIndices = [-1,-1,-1,-1,-1,-1,-1,-1]; 8 | this.triangleIndices = []; 9 | 10 | this.clear(); 11 | 12 | if(aabox){ 13 | this.AABox = aabox.clone(); 14 | }else { 15 | this.AABox = new JAABox(); 16 | } 17 | this._points = this.AABox.getAllPoints(); 18 | this._egdes = this.AABox.get_edges(); 19 | } 20 | 21 | OctreeCell.NUM_CHILDREN = 8; 22 | 23 | // indices of the children (if not leaf). Will be -1 if there is no child 24 | OctreeCell.prototype.childCellIndices=null; 25 | // indices of the triangles (if leaf) 26 | OctreeCell.prototype.triangleIndices=null; 27 | // Bounding box for the space we own 28 | OctreeCell.prototype.AABox=null; 29 | 30 | OctreeCell.prototype._points=null; 31 | OctreeCell.prototype._egdes=null; 32 | 33 | // Indicates if we contain triangles (if not then we should/might have children) 34 | OctreeCell.prototype.isLeaf=function() { 35 | return this.childCellIndices[0] == -1; 36 | } 37 | 38 | OctreeCell.prototype.clear=function(){ 39 | for (var i = 0; i < this.NUM_CHILDREN; i++ ) { 40 | this.childCellIndices[i] = -1; 41 | } 42 | this.triangleIndices.splice(0, this.triangleIndices.length); 43 | } 44 | 45 | OctreeCell.prototype.get_points=function(){ 46 | return this._points; 47 | } 48 | OctreeCell.prototype.get_egdes=function(){ 49 | return this._egdes; 50 | } 51 | 52 | jigLib.OctreeCell=OctreeCell; 53 | 54 | })(jigLib); -------------------------------------------------------------------------------- /data/planedata.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | 3 | var Vector3DUtil=jigLib.Vector3DUtil; 4 | var JMath3D=jigLib.JMath3D; 5 | 6 | 7 | /** 8 | * @name PlaneData 9 | * @class PlaneData stores information about a contact between 2 objects 10 | * @requires Vector3DUtil 11 | * @property {array} position the position of the plane expressed as a 3D vector 12 | * @property {array} normal the normal direction of the plane expressed as a 3D vector 13 | * @property {number} distance the dot product of position and normal 14 | * @constructor 15 | * @param {array} pos the position of the plane expressed as a 3D vector 16 | * @param {nor} the normal direction of the plane expressed as a 3D vector 17 | **/ 18 | var PlaneData=function(pos, nor){ 19 | if(!pos) pos=[0,0,0]; 20 | if(!nor) nor=[0,1,0]; 21 | this.position = pos.slice(0); 22 | this.normal = nor.slice(0); 23 | this.distance = Vector3DUtil.dotProduct(this.position, this.normal); 24 | }; 25 | PlaneData.prototype.position=null; 26 | PlaneData.prototype.normal=null; 27 | PlaneData.prototype.distance=null; 28 | 29 | 30 | /** 31 | * @function pointPlaneDistance determines the distance between a given point and the plane 32 | * @param {array} pt a 3D vector 33 | * @type number 34 | **/ 35 | PlaneData.prototype.pointPlaneDistance=function(pt){ 36 | return Vector3DUtil.dotProduct(this.normal, pt) - this.distance; 37 | }; 38 | 39 | 40 | PlaneData.prototype.setWithNormal=function(pos, nor){ 41 | this.position = pos.slice(0); 42 | this.normal = nor.slice(0); 43 | this.distance = Vector3DUtil.dotProduct(this.position, this.normal); 44 | }; 45 | 46 | PlaneData.prototype.setWithPoint=function(pos0, pos1, pos2){ 47 | this.position = pos0.slice(0); 48 | 49 | var dr1 = Vector3DUtil.subtract(pos1,pos0); 50 | var dr2 = Vector3DUtil.subtract(pos2,pos0); 51 | this.normal = Vector3DUtil.crossProduct(dr1,dr2); 52 | 53 | var nLen = Vector3DUtil.get_length(this.normal); 54 | if (nLen < JMath3D.NUM_TINY) { 55 | this.normal = new Vector3D(0, 1, 0); 56 | this.distance = 0; 57 | }else { 58 | Vector3DUtil.scaleBy(this.normal,1 / nLen); 59 | this.distance = Vector3DUtil.dotProduct(pos0,this.normal); 60 | } 61 | } 62 | 63 | 64 | jigLib.PlaneData=PlaneData; 65 | 66 | })(jigLib); -------------------------------------------------------------------------------- /data/spandata.js: -------------------------------------------------------------------------------- 1 | 2 | (function(jigLib){ 3 | /** 4 | * @author katopz 5 | * 6 | * @name SpanData 7 | * @class SpanData 8 | * @property {number} min 9 | * @property {number} max 10 | * @property {boolean} flag 11 | * @property {number} depth 12 | * @constructor 13 | **/ 14 | var SpanData=function(){}; 15 | SpanData.prototype.min=null; 16 | SpanData.prototype.max=null; 17 | SpanData.prototype.flag=null; 18 | SpanData.prototype.depth=null; 19 | 20 | jigLib.SpanData=SpanData; 21 | })(jigLib); -------------------------------------------------------------------------------- /data/trianglevertexindices.js: -------------------------------------------------------------------------------- 1 | 2 | (function(jigLib){ 3 | // structure used to set up the mesh 4 | var TriangleVertexIndices=function(_i0, _i1, _i2){ 5 | this.i0 = _i0; 6 | this.i1 = _i1; 7 | this.i2 = _i2; 8 | } 9 | 10 | jigLib.TriangleVertexIndices=TriangleVertexIndices; 11 | 12 | })(jigLib); 13 | -------------------------------------------------------------------------------- /events/JCollisionEvent.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @author Jim Sangwine 4 | * 5 | * @name JCollisionEvent 6 | * @class JCollisionEvent An event representing a collision with another RigidBody (to be dispatched by RigidBody) 7 | * @extends JEvent 8 | * @constant {string} COLLISION 9 | * @constructor 10 | * @param body {RigidBody} The other body involved in the collision 11 | * @param impulse {Array} A 3D vector representing the impulse applied to this RigidBody as a result of the collision 12 | **/ 13 | var JCollisionEvent=function(body, impulse) 14 | { 15 | this.Super(JCollisionEvent.COLLISION); 16 | this.collisionBody=body; 17 | this.collisionImpulse=impulse; 18 | }; 19 | jigLib.extend(JCollisionEvent,jigLib.JEvent); 20 | 21 | JCollisionEvent.prototype.collisionBody=null; 22 | JCollisionEvent.prototype.collisionImpulse=null; 23 | 24 | JCollisionEvent.COLLISION='JigLibJSCollisionEvent'; 25 | 26 | jigLib.JCollisionEvent=JCollisionEvent; 27 | })(jigLib); -------------------------------------------------------------------------------- /events/JEvent.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @author Jim Sangwine 4 | * 5 | * @name JEvent 6 | * @class JEvent Base class for JigLib events 7 | * @constant {string} COLLISION 8 | * @constructor 9 | * @param type {string} 10 | **/ 11 | var JEvent=function(type) 12 | { 13 | this.type=type; 14 | }; 15 | 16 | JEvent.prototype.type=null; 17 | 18 | Event.EVENT='JigLibJSEvent'; 19 | 20 | jigLib.JEvent=JEvent; 21 | })(jigLib); -------------------------------------------------------------------------------- /events/JEventDispatcher.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @author Jim Sangwine 4 | * 5 | * @name JEventDispatcher 6 | * @class JEventDispatcher The base class for event dispatchers 7 | * @constructor 8 | **/ 9 | var JEventDispatcher=function() 10 | { 11 | this._listeners={}; 12 | }; 13 | 14 | JEventDispatcher.prototype._listeners={}; 15 | 16 | /** 17 | * @function addEventListener adds a listener to this dispatcher 18 | * @param type {string} the type of event 19 | * @param listener {function} the event handler 20 | **/ 21 | JEventDispatcher.prototype.addEventListener=function(type,listener) 22 | { 23 | if (typeof listener != 'function') 24 | throw new Error('Invalid argument passed to JEventDispatcher.addEventListener - listener must be a function'); 25 | 26 | if (typeof(this._listeners[type])=='undefined' || !this._listeners[type] instanceof Array) 27 | this._listeners[type]=[]; 28 | 29 | this._listeners[type].push(listener); 30 | }; 31 | 32 | /** 33 | * @function removeEventListener drops a listener from this dispatcher 34 | * @param type {string} the type of event 35 | * @param listener {function} the event handler 36 | **/ 37 | JEventDispatcher.prototype.removeEventListener=function(type, listener) 38 | { 39 | if (!this._listeners[type] instanceof Array) return; 40 | 41 | var listeners = this._listeners[type]; 42 | for (var i=0, num=listeners.length; i max){ 49 | n = max; 50 | } 51 | return n; 52 | }; 53 | 54 | JMath3D.wrap=function(val, min, max){ 55 | var delta = max - min; 56 | if (val > delta){ 57 | val = val / delta; 58 | val = val - Math.floor(val); 59 | val = val * delta; 60 | } 61 | return val; 62 | }; 63 | 64 | /** 65 | * @function unproject 66 | * @param {Matrix3D} matrix3d 67 | * @param {number} focus 68 | * @param {number} zoom 69 | * @param {number} mX 70 | * @param {number} mY 71 | * @type array 72 | **/ 73 | JMath3D.unproject=function(matrix3D, focus, zoom, mX, mY){ 74 | var persp = (focus * zoom) / focus; 75 | var vector = Vector3DUtil.create(mX / persp, -mY / persp, focus, 0); 76 | return matrix3D.transformVector(vector); 77 | }; 78 | jigLib.JMath3D=JMath3D; 79 | 80 | })(jigLib); 81 | -------------------------------------------------------------------------------- /maths/jnumber3d.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | 4 | /** 5 | * @author Muzer(muzerly@gmail.com) 6 | * 7 | * @name JNumber3D 8 | * @class JNumber3D 9 | * @requires Vector3DUtil 10 | * @constant {number} NUM_TINY 11 | * @constant {number} NUM_HUGE 12 | * @constructor 13 | **/ 14 | var JNumber3D={}; 15 | 16 | JNumber3D.NUM_TINY = 0.00001; 17 | JNumber3D.NUM_HUGE = 100000; 18 | 19 | /* this method is redundant since we are already using arrays for 3D Vector storage 20 | JNumber3D.toArray=function(v){ 21 | return v;//[v[0], v[1], v[2]]; 22 | }; 23 | */ 24 | 25 | /** 26 | * @function getScaleVector clones a 3D vector and scales it's elements by s 27 | * @param {array} v a 3D vector 28 | * @param {number} s the scale to apply 29 | * @type array 30 | **/ 31 | JNumber3D.getScaleVector=function(v, s){ 32 | return [v[0]*s,v[1]*s,v[2]*s,v[3]]; 33 | }; 34 | 35 | /** 36 | * @function getScaleVector clones a a 3D vector and divides it's elements by w 37 | * @param {array} v a 3D vector 38 | * @param {number} w the divisor 39 | * @type array 40 | **/ 41 | JNumber3D.getDivideVector=function(v, w){ 42 | return (w) ? [v[0] / w, v[1] / w, v[2] / w, 0] : [0, 0, 0, 0]; 43 | }; 44 | 45 | /** 46 | * @function getNormal 47 | * @param {array} v0 a 3D vector 48 | * @param {array} v1 a 3D vector 49 | * @param {array} v2 a 3D vector 50 | * @type array 51 | **/ 52 | JNumber3D.getNormal=function(v0, v1, v2){ 53 | // Vector3DUtil.subtract is non-destructive so we don't need to clone here... 54 | // var E = v1.slice(0); 55 | // var F = v2.slice(0); 56 | 57 | // replacing with a 1 liner... 58 | // var N = Vector3DUtil.crossProduct(Vector3DUtil.subtract(v1, v0), Vector3DUtil.subtract(v2, v1)); 59 | // Vector3DUtil.normalize(N); 60 | // return N; 61 | 62 | return Vector3DUtil.normalize(Vector3DUtil.crossProduct(Vector3DUtil.subtract(v1, v0), Vector3DUtil.subtract(v2, v1))); 63 | }; 64 | 65 | /** 66 | * @function copyFromArray copies an array into a 3D vector 67 | * @deprecated JigLibJS uses array for 3D vector storage so this method is redundant - use array.slice(0) instead 68 | * @param {array} v a 3D vector 69 | * @param {array} arr the array to copy to v 70 | * @type void 71 | **/ 72 | JNumber3D.copyFromArray=function(v, arr){ 73 | if (arr.length >= 3) v=arr.slice(0); 74 | }; 75 | 76 | /** 77 | * @function getLimiteNumber ensures num falls between min and max 78 | * @param {number} num the number to limit 79 | * @param {number} min the minimum allowable value for num 80 | * @param {number} max the maximum allowable value for num 81 | * @type number 82 | **/ 83 | JNumber3D.getLimiteNumber=function(num, min, max){ 84 | var n = num; 85 | if (n < min) n = min; 86 | else if (n > max) n = max; 87 | 88 | return n; 89 | }; 90 | 91 | jigLib.JNumber3D=JNumber3D; 92 | 93 | })(jigLib); 94 | -------------------------------------------------------------------------------- /official_demos/.gitignore: -------------------------------------------------------------------------------- 1 | /glge.js 2 | /glge_math.js 3 | /grid.png 4 | /index.htm 5 | /test.htm 6 | /test1.htm 7 | /test2.htm 8 | /test3.htm 9 | /test4.htm 10 | /test5.htm 11 | /test6.htm 12 | /test7.htm 13 | /testmatrix.htm 14 | -------------------------------------------------------------------------------- /official_demos/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supereggbert/JigLibJS/31632a44b0c69d6882d01b0cfa0c3a8865b05bbe/official_demos/grid.png -------------------------------------------------------------------------------- /official_demos/index.htm: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | jigLib benchmarking / regression tests 6 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /official_demos/slider/.gitignore: -------------------------------------------------------------------------------- 1 | /range.js 2 | /slider.js 3 | /timer.js 4 | /winclassic.css 5 | -------------------------------------------------------------------------------- /official_demos/slider/timer.js: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------\ 2 | | Timer Class | 3 | |-----------------------------------------------------------------------------| 4 | | Created by Erik Arvidsson | 5 | | (http://webfx.eae.net/contact.html#erik) | 6 | | For WebFX (http://webfx.eae.net/) | 7 | |-----------------------------------------------------------------------------| 8 | | Object Oriented Encapsulation of setTimeout fires ontimer when the timer | 9 | | is triggered. Does not work in IE 5.00 | 10 | |-----------------------------------------------------------------------------| 11 | | Copyright (c) 2002, 2006 Erik Arvidsson | 12 | |-----------------------------------------------------------------------------| 13 | | Licensed under the Apache License, Version 2.0 (the "License"); you may not | 14 | | use this file except in compliance with the License. You may obtain a copy | 15 | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | 16 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 17 | | Unless required by applicable law or agreed to in writing, software | 18 | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 19 | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 20 | | License for the specific language governing permissions and limitations | 21 | | under the License. | 22 | |-----------------------------------------------------------------------------| 23 | | 2002-10-14 | Original version released | 24 | | 2006-05-28 | Changed license to Apache Software License 2.0. | 25 | |-----------------------------------------------------------------------------| 26 | | Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | 27 | \----------------------------------------------------------------------------*/ 28 | 29 | function Timer(nPauseTime) { 30 | this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime; 31 | this._timer = null; 32 | this._isStarted = false; 33 | } 34 | 35 | Timer.prototype.start = function () { 36 | if (this.isStarted()) 37 | this.stop(); 38 | var oThis = this; 39 | this._timer = window.setTimeout(function () { 40 | if (typeof oThis.ontimer == "function") 41 | oThis.ontimer(); 42 | }, this._pauseTime); 43 | this._isStarted = false; 44 | }; 45 | 46 | Timer.prototype.stop = function () { 47 | if (this._timer != null) 48 | window.clearTimeout(this._timer); 49 | this._isStarted = false; 50 | }; 51 | 52 | Timer.prototype.isStarted = function () { 53 | return this._isStarted; 54 | }; 55 | 56 | Timer.prototype.getPauseTime = function () { 57 | return this._pauseTime; 58 | }; 59 | 60 | Timer.prototype.setPauseTime = function (nPauseTime) { 61 | this._pauseTime = nPauseTime; 62 | }; -------------------------------------------------------------------------------- /official_demos/slider/winclassic.css: -------------------------------------------------------------------------------- 1 | .dynamic-slider-control { 2 | position: relative; 3 | background-color: ThreeDFace; 4 | -moz-user-focus: normal; 5 | -moz-user-select: none; 6 | cursor: default; 7 | } 8 | 9 | .horizontal { 10 | width: 200px; 11 | height: 29px; 12 | } 13 | 14 | .vertical { 15 | width: 29px; 16 | height: 200px; 17 | } 18 | 19 | .dynamic-slider-control input { 20 | display: none; 21 | } 22 | 23 | .dynamic-slider-control .handle { 24 | position: absolute; 25 | -moz-user-select: none; 26 | cursor: default; 27 | background: ThreeDFace; 28 | border: 1px solid; 29 | border-color: ThreeDHighlight ThreeDDarkShadow ThreeDDarkShadow 30 | ThreeDHighlight; 31 | } 32 | 33 | /* inner border */ 34 | .dynamic-slider-control .handle div { 35 | font-size: 1px; 36 | border: 1px solid; 37 | border-color: ThreeDLightShadow ThreeDShadow ThreeDShadow 38 | ThreeDLightShadow; 39 | behavior: url("css/boxsizing.htc"); /* ie path bug */ 40 | box-sizing: content-box; 41 | -moz-box-sizing: content-box; 42 | } 43 | 44 | /* inner sets size 45 | .dynamic-slider-control.horizontal .handle { 46 | width: 12px; 47 | height: 22px; 48 | } 49 | */ 50 | .dynamic-slider-control.horizontal .handle div { 51 | width: 8px; 52 | height: 18px; 53 | } 54 | 55 | .dynamic-slider-control.horizontal .handle.hover { 56 | 57 | } 58 | 59 | /* inner sets size 60 | .dynamic-slider-control.vertical .handle { 61 | width: 22px; 62 | height: 12px; 63 | } 64 | */ 65 | .dynamic-slider-control.vertical .handle div { 66 | width: 18px; 67 | height: 8px; 68 | } 69 | 70 | .dynamic-slider-control.vertical .handle.hover { 71 | 72 | } 73 | 74 | .dynamic-slider-control .line { 75 | behavior: url("css/boxsizing.htc"); /* ie path bug */ 76 | box-sizing: content-box; 77 | -moz-box-sizing: content-box; 78 | position: absolute; 79 | font-size: 0.01mm; 80 | overflow: hidden; 81 | border: 1px solid; 82 | border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow; 83 | background: ThreeDDarkShadow; 84 | } 85 | 86 | .dynamic-slider-control.vertical .line { 87 | width: 1px; 88 | } 89 | 90 | .dynamic-slider-control.horizontal .line { 91 | height: 1px; 92 | } 93 | 94 | .dynamic-slider-control .line div { 95 | display: none; 96 | } -------------------------------------------------------------------------------- /physics/bodypair.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | /** 23 | * @author Muzer(muzerly@gmail.com) 24 | * 25 | * @name BodyPair 26 | * @class BodyPair a container for a pair of RigidBody objects 27 | * @property {RigidBody} body0 the first body of the constrained pair 28 | * @property {RigidBody} body1 the second body of the constrained pair 29 | * @property {array} r a 3D vector 30 | * @constructor 31 | * @param {RigidBody} _body0 the first body of the constrained pair 32 | * @param {RigidBody} _body1 the second body of the constrained pair 33 | * @param {array} _r0 a 3D vector 34 | * @param {array} _r1 a 3D vector 35 | **/ 36 | var BodyPair=function(_body0, _body1, r0, r1){ 37 | if (_body0.id > _body1.id){ 38 | this.body0 = _body0; 39 | this.body1 = _body1; 40 | this.r = r0; 41 | }else{ 42 | this.body0 = _body1; 43 | this.body1 = _body0; 44 | this.r = r1; 45 | } 46 | }; 47 | BodyPair.prototype.body0=null; 48 | BodyPair.prototype.body1=null; 49 | BodyPair.prototype.r=null; 50 | 51 | jigLib.BodyPair=BodyPair; 52 | 53 | })(jigLib); -------------------------------------------------------------------------------- /physics/cachedimpluse.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | /** 23 | * @author Muzer(muzerly@gmail.com) 24 | * 25 | * @name CachedImpulse 26 | * @class CachedImpulse 27 | * @property {number} normalImpulse 28 | * @property {number} normalImpulseAux 29 | * @property {array} frictionImpulse a 3D vector 30 | * @constructor 31 | * @param {number} _normalImpulse 32 | * @param {number} _normalImpulseAux 33 | * @param {array} _frictionImpulse a 3D vector 34 | **/ 35 | var CachedImpulse=function(_normalImpulse, _normalImpulseAux, _frictionImpulse){ 36 | this.normalImpulse = _normalImpulse; 37 | this.normalImpulseAux = _normalImpulseAux; 38 | this.frictionImpulse = _frictionImpulse; 39 | }; 40 | CachedImpulse.prototype.normalImpulse=null; 41 | CachedImpulse.prototype.normalImpulseAux=null; 42 | CachedImpulse.prototype.frictionImpulse=null; 43 | 44 | jigLib.CachedImpulse=CachedImpulse; 45 | 46 | })(jigLib); -------------------------------------------------------------------------------- /physics/constraint/jconstraint.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | 23 | /** 24 | * @author Muzer(muzerly@gmail.com) 25 | * 26 | * @name JConstraint 27 | * @class JConstraint the base class for constraints 28 | * @property {boolean} _satisfied flag indicating whether this constraint has been satisfied 29 | * @property {boolean} _constraintEnabled flag indicating whether this constraint is registered with the physics system 30 | * @constructor 31 | **/ 32 | var JConstraint=function(){ 33 | this._constraintEnabled = false; 34 | this.enableConstraint(); 35 | }; 36 | JConstraint.prototype._satisfied=null; 37 | JConstraint.prototype._constraintEnabled=null; 38 | 39 | /** 40 | * @function set_satisfied setter for the _satisfied flag 41 | * @param {boolean} s 42 | * @type void 43 | **/ 44 | JConstraint.prototype.set_satisfied=function(s){ 45 | this._satisfied = s; 46 | }; 47 | 48 | /** 49 | * @function get_satisfied getter for the _satisfied flag 50 | * @type boolean 51 | **/ 52 | JConstraint.prototype.get_satisfied=function(){ 53 | return this._satisfied; 54 | }; 55 | 56 | /** 57 | * @function preApply prepare for applying constraints - subsequent calls to 58 | * apply will all occur with a constant position i.e. precalculate everything possible 59 | * @param {number} dt a UNIX timestamp 60 | * @type void 61 | **/ 62 | JConstraint.prototype.preApply=function(dt){ 63 | this._satisfied = false; 64 | }; 65 | 66 | /** 67 | * @function apply enforces the constraint using impulses. Return value 68 | * indicates if any impulses were applied. If impulses were applied 69 | * the derived class should call SetConstraintsUnsatisfied() on each 70 | * body that is involved. 71 | * @param {number} dt a UNIX timestamp 72 | * @type boolean 73 | **/ 74 | JConstraint.prototype.apply=function(dt){ 75 | return false; 76 | }; 77 | 78 | /** 79 | * @function enableConstraint registers this constraint with the physics system 80 | * @type void 81 | **/ 82 | JConstraint.prototype.enableConstraint=function(){ 83 | if (this._constraintEnabled) 84 | return; 85 | 86 | this._constraintEnabled = true; 87 | jigLib.PhysicsSystem.getInstance().addConstraint(this); 88 | }; 89 | 90 | /** 91 | * @function disableConstraint de-registers this constraint from the physics system 92 | * @type void 93 | **/ 94 | JConstraint.prototype.disableConstraint=function(){ 95 | if (!this._constraintEnabled) 96 | return; 97 | 98 | this._constraintEnabled = false; 99 | jigLib.PhysicsSystem.getInstance().removeConstraint(this); 100 | }; 101 | 102 | /** 103 | * @function get_constraintEnabled determines whether this constraint is registered with the physics system 104 | * @type boolean 105 | **/ 106 | JConstraint.prototype.get_constraintEnabled=function(){ 107 | return this._constraintEnabled; 108 | }; 109 | 110 | jigLib.JConstraint=JConstraint; 111 | 112 | })(jigLib); -------------------------------------------------------------------------------- /physics/effect/gravityField.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | 4 | /** 5 | * @author Jim Sangwine 6 | * 7 | * @name GravityField 8 | * @class GravityField a gravity field effect 9 | * This effect has a radius within which it will either attract or repel bodies depending on the defined force 10 | * (positive values attract, negative repel) and their distance (the closer the object, the stronger the effect). 11 | * This effect will be applied continuously as long as it is enabled 12 | * This effect can either be placed at an arbitrary location in the scene, or it can be attached to a parent object. 13 | * 14 | * @extends JEffect 15 | * @requires Vector3DUtil 16 | * @property {array} location initial location of the effect expressed as a 3D vector 17 | * @property {number} radius radius of effect - the distance at which the effect's influence will drop to zero 18 | * @property {number} force the force of the effect at 0 distance (impulse will be force/distance) 19 | * @property {RigidBody} parent optional - a RigidBody that the gravitational field will follow - excluded from effect 20 | * @constructor 21 | * @param {array} location initial location of the effect expressed as a 3D vector 22 | * @param {number} _radius radius of effect - the distance at which the effect's influence will drop to zero 23 | * @param {number} _force the force of the effect at 0 distance (impulse will be force/distance) 24 | * @param {RigidBody} _parent optional - a RigidBody that the gravitational field will follow - excluded from effect 25 | **/ 26 | var GravityField=function(_location, _radius, _force, _parent) { 27 | this.Super(); 28 | this.location=_location; 29 | this.radius=_radius; 30 | this.force=_force; 31 | if (_parent) this.parent=_parent; 32 | }; 33 | jigLib.extend(GravityField,jigLib.JEffect); 34 | 35 | GravityField.prototype.location = null; 36 | GravityField.prototype.radius = null; 37 | GravityField.prototype.force = null; 38 | GravityField.prototype.parent = null; 39 | 40 | /** 41 | * @function Apply applies the effect to the relevant bodies 42 | * @see JEffect.Apply 43 | * @type void 44 | **/ 45 | GravityField.prototype.Apply = function() { 46 | var system=jigLib.PhysicsSystem.getInstance(); 47 | var bodies=system.get_bodies(); 48 | var i=bodies.length-1; 49 | var curBody, distance, force, forceV; 50 | 51 | if (this.parent) 52 | this.location = this.parent.get_position(); 53 | 54 | this._affectedBodies=[]; 55 | do { 56 | curBody=bodies[i]; 57 | if (!curBody.get_movable() || (this.parent && curBody == this.parent)) continue; 58 | 59 | distance=Vector3DUtil.distance(curBody.get_position(), this.location); 60 | if (distance < this.radius) 61 | { 62 | forceV=Vector3DUtil.subtract(curBody.get_position(), this.location); 63 | force=(1-(distance / this.radius)) * this.force; 64 | Vector3DUtil.scaleBy(forceV, force); 65 | Vector3DUtil.negate(forceV); 66 | system.activateObject(curBody); 67 | curBody.applyWorldImpulse(forceV, this.location); 68 | } 69 | } while(i--); 70 | }; 71 | 72 | jigLib.GravityField=GravityField; 73 | })(jigLib); -------------------------------------------------------------------------------- /physics/effect/jeffect.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | 3 | /** 4 | * @author Jim Sangwine 5 | * 6 | * @name JEffect 7 | * @class JEffect the base class for effects 8 | * @property {boolean} _effectEnabled changing this boolean registers and de-registers the effect with the physics system 9 | * @constructor 10 | **/ 11 | var JEffect=function(){ 12 | this._effectEnabled = true; 13 | }; 14 | 15 | JEffect.prototype._effectEnabled=false; 16 | 17 | JEffect.prototype.__defineGetter__('enabled', 18 | function() { return this._effectEnabled; }); 19 | JEffect.prototype.__defineSetter__('enabled', 20 | function(bool) { 21 | if (bool == this._effectEnabled) return; 22 | this._effectEnabled = bool; 23 | if (bool) jigLib.PhysicsSystem.getInstance().addEffect(this); 24 | else jigLib.PhysicsSystem.getInstance().removeEffect(this); 25 | }); 26 | 27 | /** 28 | * @function Apply this should be implemented by the effect to apply force to bodies in the physics system as appropriate. 29 | * @see PhysicsSystem.handleAllEffects 30 | * 31 | * @type void 32 | */ 33 | JEffect.prototype.Apply=function(){ 34 | return; 35 | }; 36 | 37 | jigLib.JEffect=JEffect; 38 | })(jigLib); -------------------------------------------------------------------------------- /physics/effect/wind.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Vector3DUtil=jigLib.Vector3DUtil; 3 | 4 | /** 5 | * @author Jim Sangwine 6 | * 7 | * @name Wind 8 | * @class Wind a wind effect 9 | * This effect has global influence - All objects that are movable in the scene will be affected, apart from those added to the exclusions array. 10 | * This effect will be applied continuously as long as it is enabled 11 | * 12 | * @extends JEffect 13 | * @requires Vector3DUtil 14 | * @property {array} direction a 3D vector defining the force of the effect in each axis 15 | * @property {array} exclusions optional - a list of bodies to be excluded from the effect 16 | * @constructor 17 | * @param {array} _direction a 3D vector defining the force of the effect in each axis 18 | * @param {array} _exclusions optional - a list of bodies to be excluded from the effect 19 | **/ 20 | var Wind=function(_direction, _exclusions) { 21 | this.Super(); 22 | this.direction=_direction; 23 | if (_exclusions) this.exclusions=_exclusions; 24 | }; 25 | jigLib.extend(Wind,jigLib.JEffect); 26 | 27 | Wind.prototype.direction = null; 28 | Wind.prototype.exclusions = []; 29 | 30 | /** 31 | * @function isExcluded checks if a given body is in the exclusions list 32 | * @param {RigidBody} body the body to check for 33 | * @type boolean 34 | */ 35 | Wind.prototype.isExcluded = function(body) { 36 | var i=this.exclusions.length; 37 | while (i--) { if (this.exclusions[i] == body) return true; } 38 | return false; 39 | }; 40 | 41 | /** 42 | * @function Apply applies the effect to the relevant bodies 43 | * @see JEffect.Apply 44 | * @type void 45 | **/ 46 | Wind.prototype.Apply = function() { 47 | var system=jigLib.PhysicsSystem.getInstance(); 48 | var bodies=system.get_bodies(); 49 | var i=bodies.length; 50 | var curBody; 51 | 52 | this._affectedBodies=[]; 53 | while(i--) { 54 | curBody=bodies[i]; 55 | if (!curBody.get_movable() || this.isExcluded(curBody)) continue; 56 | system.activateObject(curBody); 57 | curBody.applyWorldImpulse(this.direction, curBody.get_position()); 58 | } 59 | }; 60 | 61 | jigLib.Wind=Wind; 62 | })(jigLib); -------------------------------------------------------------------------------- /physics/materialproperties.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | 23 | /** 24 | * @author Muzer(muzerly@gmail.com) 25 | * 26 | * @name MaterialProperties 27 | * @class MaterialProperties 28 | * @property {number} _restitution 29 | * @property {number} _friction 30 | * @constructor 31 | * @param {number} restitution 32 | * @param {number} friction 33 | **/ 34 | var MaterialProperties=function(restitution, friction){ 35 | if(restitution==null) restitution=0.25; 36 | if(friction==null) friction=0.25; 37 | this._restitution = restitution; 38 | this._friction = friction; 39 | }; 40 | 41 | MaterialProperties.prototype._restitution=null; 42 | MaterialProperties.prototype._friction=null; 43 | 44 | /** 45 | * @function get_restitution getter for _restitution 46 | * @type number 47 | **/ 48 | MaterialProperties.prototype.get_restitution=function(){ 49 | return this._restitution; 50 | }; 51 | 52 | /** 53 | * @function set_restitution setter for _restitution 54 | * @param {number} restitution 55 | * @type void 56 | **/ 57 | MaterialProperties.prototype.set_restitution=function(restitution){ 58 | this._restitution = restitution; 59 | }; 60 | 61 | /** 62 | * @function get_restitution getter for _friction 63 | * @type number 64 | **/ 65 | MaterialProperties.prototype.get_friction=function(){ 66 | return this._friction; 67 | }; 68 | 69 | /** 70 | * @function get_restitution setter for _friction 71 | * @param {number} friction 72 | * @type void 73 | **/ 74 | MaterialProperties.prototype.set_friction=function(friction){ 75 | this._friction = friction; 76 | }; 77 | 78 | jigLib.MaterialProperties=MaterialProperties; 79 | 80 | })(jigLib); -------------------------------------------------------------------------------- /physics/physicscontroller.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | 23 | /** 24 | * @author Muzer(muzerly@gmail.com) 25 | * 26 | * @name PhysicsController 27 | * @class PhysicsController 28 | * @property {boolean} _controllerEnabled 29 | * @constructor 30 | **/ 31 | var PhysicsController=function(){ 32 | this._controllerEnabled = false; 33 | }; 34 | 35 | PhysicsController.prototype._controllerEnabled=null; 36 | 37 | 38 | /** 39 | * @function updateController implement this to apply whatever forces are needed to the objects this controls 40 | * @param {number} dt a UNIX timestamp 41 | * @type void 42 | **/ 43 | PhysicsController.prototype.updateController=function(dt){ 44 | }; 45 | 46 | /** 47 | * @function enableController register with the physics system 48 | * @type void 49 | **/ 50 | PhysicsController.prototype.enableController=function(){ 51 | if (this._controllerEnabled){ 52 | return; 53 | } 54 | this._controllerEnabled = true; 55 | jigLib.PhysicsSystem.getInstance().addController(this); 56 | }; 57 | 58 | /** 59 | * @function disableController de-register from the physics system 60 | * @type void 61 | **/ 62 | PhysicsController.prototype.disableController=function(){ 63 | if (!this._controllerEnabled){ 64 | return; 65 | } 66 | this._controllerEnabled = false; 67 | jigLib.PhysicsSystem.getInstance().removeController(this); 68 | }; 69 | 70 | /** 71 | * @function get_controllerEnabled returns true if this controller is registered with the PhysicsSystem 72 | * @type boolean 73 | **/ 74 | PhysicsController.prototype.get_controllerEnabled=function(){ 75 | return this._controllerEnabled; 76 | }; 77 | 78 | jigLib.PhysicsController=PhysicsController; 79 | 80 | })(jigLib); -------------------------------------------------------------------------------- /physics/physicsstate.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var Matrix3D=jigLib.Matrix3D; 3 | var JMatrix3D=jigLib.JMatrix3D; 4 | 5 | /** 6 | * @author katopz 7 | * Devin Reimer (blog.almostlogical.com) 8 | * 9 | * @name PhysicsState 10 | * @class PhysicsState 11 | * @requires Matrix3D 12 | * @requires JMatrix3D 13 | * @property {array} position 14 | * @property {Matrix3D} 15 | * @property {array} linVelocity 16 | * @property {array} rotVelocity 17 | * @property {array} orientationCols 18 | * @constructor 19 | **/ 20 | var PhysicsState=function(){ 21 | this._orientation = new Matrix3D(); 22 | }; 23 | 24 | PhysicsState.prototype.position = [0,0,0,0]; 25 | PhysicsState.prototype._orientation; 26 | PhysicsState.prototype.linVelocity = [0,0,0,0]; 27 | PhysicsState.prototype.rotVelocity = [0,0,0,0]; 28 | PhysicsState.prototype.orientationCols = [[0,0,0,0],[0,0,0,0],[0,0,0,0]]; 29 | 30 | /** 31 | * @function get_orientation getter for _orientation 32 | * @type Matrix3D 33 | **/ 34 | PhysicsState.prototype.get_orientation=function(){ return this._orientation; }; 35 | 36 | /** 37 | * @function set_orientation setter for _orientation 38 | * @param {array} val 39 | **/ 40 | PhysicsState.prototype.set_orientation=function(val){ 41 | this._orientation = val; 42 | var _rawData = this._orientation.glmatrix; 43 | 44 | this.orientationCols[0][0] = _rawData[0]; 45 | this.orientationCols[0][1] = _rawData[1]; 46 | this.orientationCols[0][2] = _rawData[2]; 47 | 48 | this.orientationCols[1][0] = _rawData[4]; 49 | this.orientationCols[1][1] = _rawData[5]; 50 | this.orientationCols[1][2] = _rawData[6]; 51 | 52 | this.orientationCols[2][0] = _rawData[8]; 53 | this.orientationCols[2][1] = _rawData[9]; 54 | this.orientationCols[2][2] = _rawData[10]; 55 | }; 56 | 57 | /** 58 | * @function getOrientationCols here for backwards compatibility should use this.orientationCols unless you need a clone 59 | * @type array 60 | **/ 61 | PhysicsState.prototype.getOrientationCols=function(){ 62 | return JMatrix3D.getCols(this._orientation); 63 | }; 64 | 65 | jigLib.PhysicsState=PhysicsState; 66 | 67 | })(jigLib); -------------------------------------------------------------------------------- /plugins/abstractphysics.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | var PhysicsSystem=jigLib.PhysicsSystem; 3 | 4 | /** 5 | * @author bartekd 6 | * 7 | * @name AbstractPhysics 8 | * @class AbstractPhysics 9 | * @requires PhysicsSystem 10 | * @property {number} speed 11 | * @property {number} inittime 12 | * @property {PhysicsSystem} physicsSystem 13 | * @constructor 14 | * @param {number} speed 15 | **/ 16 | var AbstractPhysics=function(_speed) { 17 | if(_speed) this.speed = _speed; 18 | this.inittime=(new Date()).getTime(); 19 | this.physicsSystem = PhysicsSystem.getInstance(); 20 | }; 21 | 22 | AbstractPhysics.prototype.speed=5; 23 | AbstractPhysics.prototype.inittime=null; 24 | AbstractPhysics.prototype.physicsSystem=null; 25 | 26 | /** 27 | * @function addBody adds a body to the PhysicsSystem 28 | * @param {RigidBody} body 29 | * @type void 30 | **/ 31 | AbstractPhysics.prototype.addBody=function(body){ 32 | this.physicsSystem.addBody(body); 33 | }; 34 | 35 | /** 36 | * @function removeBody removes a body from the PhysicsSystem 37 | * @param {RigidBody} body 38 | * @type void 39 | **/ 40 | AbstractPhysics.prototype.removeBody=function(body){ 41 | physicsSystem.removeBody(body); 42 | }; 43 | 44 | /** 45 | * @function get_engine returns the PhysicsSystem 46 | * @type PhysicsSystem 47 | **/ 48 | AbstractPhysics.prototype.get_engine=function(){ 49 | return this.physicsSystem ; 50 | }; 51 | 52 | /** 53 | * @function step integrates the PhysicsSystem 54 | * @type void 55 | **/ 56 | AbstractPhysics.prototype.step=function(){ 57 | var stepTime = (new Date()).getTime(); 58 | deltaTime = ((stepTime - this.initTime) / 1000) * this.speed; 59 | this.initTime = stepTime; 60 | this.physicsSystem.integrate(deltaTime); 61 | }; 62 | 63 | jigLib.AbstractPhysics=AbstractPhysics; 64 | 65 | })(jigLib); 66 | -------------------------------------------------------------------------------- /plugins/iskin3d.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * Represents a mesh from a 3D engine inside JigLib. 4 | * Its implementation shold allow to get and set a Matrix3D on 5 | * the original object. 6 | * 7 | * In the implementation, JMatrix3D should be translated into 8 | * the type proper for a given engine. 9 | * 10 | * @author bartekd 11 | */ 12 | var Matrix3D=jigLib.Matrix3D; 13 | 14 | /** 15 | * @author bartekd 16 | * 17 | * @name ISkin3D 18 | * @class ISkin3D an interface representing a mesh from a 3D engine inside JigLib. 19 | * Implementations should allow getting and setting a Matrix3D on the original object. 20 | * Matrix3D should be translated into a type compatible with the engine. 21 | * 22 | * @requires Matrix3D 23 | * @property {Matrix3D} matrix 24 | * @constructor 25 | **/ 26 | function ISkin3D(){ 27 | this.matrix=new Matrix3D(); 28 | }; 29 | 30 | ISkin3D.prototype.matrix=null; 31 | 32 | /** 33 | * @function get_transform gets the transform matrix 34 | * @type Matrix3D 35 | **/ 36 | ISkin3D.prototype.get_transform=function(){ 37 | return this.matrix; 38 | }; 39 | 40 | /** 41 | * @function set_transform sets the transform matrix 42 | * @param {Matrix3D} value 43 | * @type void 44 | **/ 45 | ISkin3D.prototype.set_transform=function(value){ 46 | this.matrix=value; 47 | }; 48 | 49 | jigLib.ISkin3D=ISkin3D; 50 | 51 | })(jigLib); -------------------------------------------------------------------------------- /plugins/iterrain.js: -------------------------------------------------------------------------------- 1 | (function(jigLib){ 2 | /** 3 | * @author Muzer(muzerly@gmail.com) 4 | * 5 | * @name ITerrain 6 | * @class ITerrain an interface for Terrain bodies 7 | * @constructor 8 | **/ 9 | var ITerrain=function(){}; 10 | 11 | /** 12 | * @function get_minW minimum horizontal coordinate 13 | * @type number 14 | **/ 15 | ITerrain.prototype.get_minW=function(){}; 16 | 17 | /** 18 | * @function get_minH minimum vertical coordinate 19 | * @type number 20 | **/ 21 | ITerrain.prototype.get_minH=function(){}; 22 | 23 | /** 24 | * @function get_maxW maximum horizontal coordinate 25 | * @type number 26 | **/ 27 | ITerrain.prototype.get_maxW=function(){}; 28 | 29 | /** 30 | * @function get_maxH maximum vertical coordinate 31 | * @type number 32 | **/ 33 | ITerrain.prototype.get_maxH=function(){}; 34 | 35 | /** 36 | * @function get_dw the horizontal length of each segment 37 | * @type number 38 | **/ 39 | ITerrain.prototype.get_dw=function(){}; 40 | 41 | /** 42 | * @function get_dh the vertical length of each segment 43 | * @type number 44 | **/ 45 | ITerrain.prototype.get_dh=function(){}; 46 | 47 | /** 48 | * @function get_sw the number of segments horizontally 49 | * @type number 50 | **/ 51 | ITerrain.prototype.get_sw=function(){}; 52 | 53 | /** 54 | * @function get_sh the number of segments vertically 55 | * @type number 56 | **/ 57 | ITerrain.prototype.get_sh=function(){}; 58 | 59 | /** 60 | * @function get_heights the heights of all vertices 61 | * @type array 62 | **/ 63 | ITerrain.prototype.get_heights=function(){}; 64 | 65 | jigLib.ITerrain=ITerrain; 66 | })(jigLib); -------------------------------------------------------------------------------- /vehicles/jchassis.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007 Danny Chapman 3 | http://www.rowlhouse.co.uk 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | */ 20 | 21 | (function(jigLib){ 22 | 23 | var JBox=jigLib.JBox; 24 | 25 | /** 26 | * @author Muzer(muzerly@gmail.com) 27 | * 28 | * @name JChassis 29 | * @class JChassis represents vehicle chassis 30 | * @extends JBox 31 | * @property {JCar} _car the vehicle this chassis belongs to 32 | * @constructor 33 | * @param {JCar} car the vehicle this chassis belongs to 34 | * @param {ISkin3D} skin the mesh 35 | * @param {number} width the required chassis width 36 | * @param {number} depth the required chassis depth 37 | * @param {number} height the required chassis height 38 | **/ 39 | var JChassis=function(car, skin, width, depth, height){ 40 | if(width==null) width=40; 41 | if(depth==null) depth=70; 42 | if(height==null) height=30; 43 | 44 | this.Super(skin, width, depth, height); 45 | 46 | this._car = car; 47 | }; 48 | jigLib.extend(JChassis, jigLib.JBox); 49 | 50 | JChassis.prototype._car=null; 51 | 52 | /** 53 | * @function addExternalForces applies wheel forces to the vehicle 54 | * @param {number} dt a UNIX timestamp 55 | * @type void 56 | **/ 57 | JChassis.prototype.addExternalForces=function(dt){ 58 | this.clearForces(); 59 | this.addGravity(); 60 | this._car.addExternalForces(dt); 61 | }; 62 | 63 | /** 64 | * @function postPhysics runs after the PhysicsSystem has been applied 65 | * @param {number} dt a UNIX timestamp 66 | * @type void 67 | **/ 68 | JChassis.prototype.postPhysics=function(dt){ 69 | this._car.postPhysics(dt); 70 | }; 71 | 72 | jigLib.JChassis=JChassis; 73 | 74 | })(jigLib); --------------------------------------------------------------------------------