Permalink
Browse files

updated for publish

  • Loading branch information...
1 parent 580ad62 commit bd04b21271cfdd37007044f1882520a78d2da5f4 @ChristophPacher committed Nov 3, 2010
Showing with 1,203 additions and 15 deletions.
  1. BIN Documentation.docx
  2. BIN Documentation.pdf
  3. +16 −15 index.html
  4. +1,129 −0 scriptaculous/effects.js
  5. +58 −0 scriptaculous/scriptaculous.js
View
Binary file not shown.
View
Binary file not shown.
View
@@ -2,13 +2,14 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>JavaScript Physics Libary Test by Christoph Pacher </title>
+ <title>JavaScript Physics Library Test by Christoph Pacher </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>
- <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js'></script>
<script src="jQuery/jquery.batchImageLoad.js" type="text/javascript"></script>
+ <script src="scriptaculous/scriptaculous.js" type="text/javascript"></script>
+ <script src="scriptaculous/effects.js" type="text/javascript"></script>
<script src="physics/Vector.js" type="text/javascript"></script>
<script src="physics/PhysicsWorld.js" type="text/javascript"></script>
<script src="physics/PhysicsForce.js" type="text/javascript"></script>
@@ -25,7 +26,7 @@
</script>
<body style="background-color:black;user-select: none; -khtml-user-select: none; -moz-user-select: none;">
-<h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javascript physics libary test</h1>
+<h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javascript physics library test</h1>
<div id="rahmen" style="position:absolute; top:50px; left:50px; bottom:50px; right:50px;background-color:white;">
<div id="start" class="button"> start/stop </div>
@@ -54,7 +55,7 @@ <h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javasc
viewportPadding = [50, 50];
viewportOrigin = [viewportPadding[0], viewportPadding[1]];
-viewportDim = [windowDim.width - 2*this.viewportPadding[0], windowDim.height - 2*viewportPadding[1]];
+viewportDim = [windowDim.width - 2*viewportPadding[0], windowDim.height - 2*viewportPadding[1]];
// tell the renderer the dimensions of the browser window,
@@ -63,31 +64,31 @@ <h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javasc
var myWorld = new Physics.World3D(myRenderer);
// the bounds inside the particle world in meters
-this.myWorld.mBoundsMinV3D = [0, 0, 0];
+myWorld.mBoundsMinV3D = [0, 0, 0];
// let the world end with the sides of the viewport
// this requires the camera to be positioned like i do it in the next step
-this.myWorld.mBoundsMaxV3D = [this.viewportDim[0] * this.myRenderer.px2m, this.viewportDim[1] * 2 * this.myRenderer.px2m, 10];
+myWorld.mBoundsMaxV3D = [viewportDim[0] * myRenderer.px2m, viewportDim[1] * 2 * myRenderer.px2m, 10];
// if you use the line drawing feature, tell the renderer where the line images are
Renderer.mLineImgPathS = "images/";
// Position the camera so that the worldspace coords [0,0,0] are in the lower left corner
// of the viewport.
-this.myRenderer.mCameraPosV3D = [this.viewportDim[0] / 2 * this.myRenderer.px2m, this.viewportDim[1] / 2 * this.myRenderer.px2m, 0];
+myRenderer.mCameraPosV3D = [viewportDim[0] / 2 * myRenderer.px2m, viewportDim[1] / 2 * myRenderer.px2m, 0];
var pyramidLevels = 8;
var boxwidthPX = 40;
-buildPyramid( 4, [this.viewportDim[0] / 2 * this.myRenderer.px2m -5, 1, 1], boxwidthPX );
-buildPyramid( 4, [this.viewportDim[0] / 2 * this.myRenderer.px2m -5, 1, 2.2], boxwidthPX );
-buildPyramid( 4, [this.viewportDim[0] / 2 * this.myRenderer.px2m -5, 1, 3.2], boxwidthPX );
+buildPyramid( 4, [viewportDim[0] / 2 * myRenderer.px2m -5, 1, 1], boxwidthPX );
+buildPyramid( 4, [viewportDim[0] / 2 * myRenderer.px2m -5, 1, 3], boxwidthPX );
+buildPyramid( 4, [viewportDim[0] / 2 * myRenderer.px2m -5, 1, 5], boxwidthPX );
-this.sp = new Physics.Spring('sp1', this.myWorld, this.myWorld.mParticlesA[8], this.myWorld.mParticlesA[9], true, 50, 2, 0.2, true);
-this.myWorld.addParticleLine(this.myWorld.mParticlesA[8], this.myWorld.mParticlesA[9]);
+var sp = new Physics.Spring('sp1', myWorld, myWorld.mParticlesA[8], myWorld.mParticlesA[9], true, 50, 2, 0.2, true);
+myWorld.addParticleLine(myWorld.mParticlesA[8], myWorld.mParticlesA[9]);
@@ -106,7 +107,7 @@ <h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javasc
var mousePos = [0,0];
var mouseDt = 0.05;
var mouseIDt = 1.0/mouseDt;
-var mousePeriodical = new PeriodicalExecuter(this.mouseUpdater.bind(this), mouseDt);
+var mousePeriodical = new PeriodicalExecuter(mouseUpdater.bind(this), mouseDt);
var wakeUpPeriodical = null;
var toWakeUpPA = [];
var isThisIE = document.all?true:false;
@@ -179,7 +180,7 @@ <h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javasc
element.scaleContent = true;
// we need to save all the css dimensions in their 100% scale state
- this.myRenderer.saveStartDimensions(element, 0, element);
+ myRenderer.saveStartDimensions(element, 0, element);
//position in meters, box extensions from pos in m, mass in kg, start velocity in m/s2, the representing DOM element
element.particle = myWorld.addParticle([posx, posy, posz], [BoxWidth * myRenderer.px2m /2, BoxWidth * myRenderer.px2m /2, BoxWidth * myRenderer.px2m /2], 1, [0,0,0], element);
@@ -471,7 +472,7 @@ <h1 style="position:absolute;left:0px;top:0px;z-index:2000;color:silver;">javasc
}
}
}
- wakeUpPeriodical = new PeriodicalExecuter(this.wakeUpHandler.bind(window), 1);
+ wakeUpPeriodical = new PeriodicalExecuter(wakeUpHandler.bind(window), 1);
}
}
}
Oops, something went wrong.

0 comments on commit bd04b21

Please sign in to comment.