Permalink
Browse files

Merge branch 't152' of git://github.com/dperit/c3dl into review

  • Loading branch information...
cathyatseneca committed May 25, 2011
2 parents 3e5e13e + 0492c42 commit 2777aaa6f0ec49cfc9b4b03c060018b59709b438
View
@@ -1 +1,3 @@
.DS_Store
+.dist
+*~
View
137 Makefile
@@ -0,0 +1,137 @@
+# NOTES:
+#
+# Requires: java
+#
+# make - builds c3dl-DEV-VERSION.js and c3dl-DEV-VERSION.min.js in dist/
+#
+# make VERSION=1.2 -builds c3dl-1.2.js and c3dl-1.2.min.js in dist/
+#
+# make clean - delete dist/
+
+VERSION ?= DEV-VERSION
+NULL :=
+SRC_DIR := .
+C3DL := c3dl
+C3DL_DIR := $(SRC_DIR)/$(C3DL)
+TOOLS_DIR := $(SRC_DIR)/tools
+DIST_DIR := $(SRC_DIR)/dist
+
+C3DL_DIST := $(DIST_DIR)/$(C3DL)-$(VERSION).js
+C3DL_MIN := $(DIST_DIR)/$(C3DL)-$(VERSION).min.js
+
+# Add any c3dl JS files below
+JS_SOURCES := $(C3DL_DIR)/c3dlnamespace.js \
+ $(C3DL_DIR)/constants.js \
+ $(C3DL_DIR)/effects/effect_docs.js \
+ $(C3DL_DIR)/debug.js \
+ $(C3DL_DIR)/renderer/renderer.js \
+ $(C3DL_DIR)/renderer/rendererwebgl.js \
+ $(C3DL_DIR)/renderer/programobject.js \
+ $(C3DL_DIR)/math/mjs.js \
+ $(C3DL_DIR)/math/mathutils.js \
+ $(C3DL_DIR)/math/vector.js \
+ $(C3DL_DIR)/math/matrix.js \
+ $(C3DL_DIR)/math/quaternion.js \
+ $(C3DL_DIR)/matrixstack.js \
+ $(C3DL_DIR)/camera/camera.js \
+ $(C3DL_DIR)/camera/freecamera.js \
+ $(C3DL_DIR)/camera/orbitcamera.js \
+ $(C3DL_DIR)/enclosure/boundingsphere.js \
+ $(C3DL_DIR)/enclosure/boundingvolume.js \
+ $(C3DL_DIR)/enclosure/visualboundingsphere.js \
+ $(C3DL_DIR)/enclosure/obb.js \
+ $(C3DL_DIR)/enclosure/aabb.js \
+ $(C3DL_DIR)/actors/actor.js \
+ $(C3DL_DIR)/actors/primitive.js \
+ $(C3DL_DIR)/actors/point.js \
+ $(C3DL_DIR)/actors/line.js \
+ $(C3DL_DIR)/shapes/shape.js \
+ $(C3DL_DIR)/shapes/cube.js \
+ $(C3DL_DIR)/shapes/plane.js \
+ $(C3DL_DIR)/shapes/sphere.js \
+ $(C3DL_DIR)/shapes/custom.js \
+ $(C3DL_DIR)/shapes/customplane.js \
+ $(C3DL_DIR)/frustum_culling/frustum.js \
+ $(C3DL_DIR)/frustum_culling/plane.js \
+ $(C3DL_DIR)/scene.js \
+ $(C3DL_DIR)/texture/texture.js \
+ $(C3DL_DIR)/texture/texturemanager.js \
+ $(C3DL_DIR)/texture/textureutils.js \
+ $(C3DL_DIR)/collada/colladamanager.js \
+ $(C3DL_DIR)/collada/colladaloader.js \
+ $(C3DL_DIR)/collada/colladaqueue.js \
+ $(C3DL_DIR)/collada/geometry.js \
+ $(C3DL_DIR)/collada/primitiveset.js \
+ $(C3DL_DIR)/light/light.js \
+ $(C3DL_DIR)/light/positionallight.js \
+ $(C3DL_DIR)/light/directionallight.js \
+ $(C3DL_DIR)/light/spotlight.js \
+ $(C3DL_DIR)/material.js \
+ $(C3DL_DIR)/collada/collada.js \
+ $(C3DL_DIR)/scenegraph/scenenode.js \
+ $(C3DL_DIR)/utilities/utilities.js \
+ $(C3DL_DIR)/shaders/model/light/light_vs.js \
+ $(C3DL_DIR)/shaders/model/material/material.js \
+ $(C3DL_DIR)/shaders/model/standard/model_fs.js \
+ $(C3DL_DIR)/shaders/model/standard/model_vs.js \
+ $(C3DL_DIR)/shaders/model/standard/std_callback.js \
+ $(C3DL_DIR)/shaders/particle_system/psys_vs.js \
+ $(C3DL_DIR)/shaders/particle_system/psys_fs.js \
+ $(C3DL_DIR)/shaders/point/point/point_vs.js \
+ $(C3DL_DIR)/shaders/point/point/point_fs.js \
+ $(C3DL_DIR)/shaders/point/sphere/point_sphere_vs.js \
+ $(C3DL_DIR)/shaders/point/sphere/point_sphere_fs.js \
+ $(C3DL_DIR)/shaders/line/line_vs.js \
+ $(C3DL_DIR)/shaders/line/line_fs.js \
+ $(C3DL_DIR)/shaders/bounding_sphere/bounding_sphere_vs.js \
+ $(C3DL_DIR)/shaders/bounding_sphere/bounding_sphere_fs.js \
+ $(C3DL_DIR)/shaders/model/greyscale/greyscale_vs.js \
+ $(C3DL_DIR)/shaders/model/greyscale/greyscale_fs.js \
+ $(C3DL_DIR)/shaders/model/greyscale/greyscale_callback.js \
+ $(C3DL_DIR)/shaders/model/sepia/sepia_vs.js \
+ $(C3DL_DIR)/shaders/model/sepia/sepia_fs.js \
+ $(C3DL_DIR)/shaders/model/sepia/sepia_callback.js \
+ $(C3DL_DIR)/shaders/model/cartoon/cartoon_vs.js \
+ $(C3DL_DIR)/shaders/model/cartoon/cartoon_fs.js \
+ $(C3DL_DIR)/shaders/model/cartoon/cartoon_callback.js \
+ $(C3DL_DIR)/shaders/model/gooch/gooch_vs.js \
+ $(C3DL_DIR)/shaders/model/gooch/gooch_fs.js \
+ $(C3DL_DIR)/shaders/model/gooch/gooch_callback.js \
+ $(C3DL_DIR)/shaders/model/solid_color/solid_color_vs.js \
+ $(C3DL_DIR)/shaders/model/solid_color/solid_color_fs.js \
+ $(C3DL_DIR)/shaders/model/solid_color/solid_color_callback.js \
+ $(C3DL_DIR)/effects/effecttemplate.js \
+ $(C3DL_DIR)/effects/effect.js \
+ $(C3DL_DIR)/particle_system/particlesystem.js \
+ $(C3DL_DIR)/particle_system/particle.js \
+ $(C3DL_DIR)/init.js \
+ $(C3DL_DIR)/interaction/collision.js \
+ $(C3DL_DIR)/interaction/picking.js \
+ $(C3DL_DIR)/interaction/pickingresult.js \
+ $(NULL)
+
+CLOSURE := java -jar $(TOOLS_DIR)/closure/compiler.jar
+
+c3dl: $(DIST_DIR) $(C3DL_DIST) $(C3DL_MIN)
+ @@echo "Finishied. See $(DIST_DIR)"
+
+$(DIST_DIR):
+ @@mkdir -p $(DIST_DIR)
+
+$(C3DL_DIST): $(DIST_DIR)
+ @@echo "Building $(C3DL_DIST)"
+ @@cat $(JS_SOURCES) > $(C3DL_DIST)
+
+$(C3DL_MIN): $(DIST_DIR)
+ @@echo "Building $(C3DL_MIN)"
+ @@$(CLOSURE) $(shell for js in $(JS_SOURCES) ; do echo --js $$js ; done) \
+ --compilation_level SIMPLE_OPTIMIZATIONS \
+ --js_output_file $(C3DL_MIN)
+
+advanced: $(DIST_DIR)
+ @@echo "Building $(C3DL_MIN) with advanced optimizations"
+ @@$(CLOSURE) $(shell for js in $(JS_SOURCES) ; do echo --js $$js ; done) \
+ --compilation_level ADVANCED_OPTIMIZATIONS \
+ --js_output_file $(C3DL_MIN)
+clean:
+ @@rm -fr $(DIST_DIR)
@@ -2,7 +2,7 @@
<head>
<title>Cavas3D test environment</title>
<!--Our directory structure is 2 above. If you download the entire repository as is, this will run-->
- <script language="javascript" src="../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="J3DXplorer.js"></script>
</head>
@@ -3,7 +3,7 @@
<title></title>
<!-- Set the path to the c3dl library and load the script -->
<link rel="stylesheet" href="style.css"/>
- <script type="application/javascript" src="../../c3dl/c3dlapi.js" ></script>
+ <script type="application/javascript" src="../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="asteroids.js"></script>
</head>
@@ -2,7 +2,7 @@
<head>
<title>C3DL test environment: particle system</title>
- <script language="javascript" src="../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="psys.js"></script>
<link rel="stylesheet" href="style.css" type = "text/css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>AABB Test</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -5,7 +5,7 @@
<html>
<head>
<title>C3DL Picking Back-Bearing test</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
<style>
@@ -5,7 +5,7 @@
<html>
<head>
<title>C3DL Collada Loading Tests</title>
- <script language="javascript" src="../../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
<style>
@@ -5,7 +5,7 @@
<html>
<head>
<title>C3DL Collada Loading Tests</title>
- <script language="javascript" src="../../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
<style>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Collision</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="collision.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -5,7 +5,7 @@
<html>
<head>
<title>C3DL Effect Tests</title>
- <script language="javascript" src="../../../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../../style.css"/>
<style>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Frustum Culling</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="fc.js"></script>
</head>
<body>
@@ -5,7 +5,7 @@
<html>
<head>
<title>C3DL Line Test</title>
- <script language="javascript" src="../../../c3dl/c3dapi.js"></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script language="javascript" src="lines.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css"/>
</head>
@@ -9,7 +9,7 @@
<!-- Set the path to the c3dl library and load the script -->
<script type="application/javascript"> var SCRIPT_PATH = '../../../canvas3dapi/'</script>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="mocap.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Scene Pause</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="scenepause.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Shape Test</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="shapes.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Set Size Test</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Speed</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="speed.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Static Test</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="static.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Texture</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="texture.js"></script>
<script type="application/javascript" src="canvasclock.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
@@ -1,7 +1,7 @@
<html>
<head>
<title>BoundingBox</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="updatetexture.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Angular Velocity</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="angvelocity.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
@@ -1,7 +1,7 @@
<html>
<head>
<title>Velocity</title>
- <script type="application/javascript" src="../../../c3dl/c3dapi.js" ></script>
+ <script type="application/javascript" src="../../../dist/c3dl-DEV-VERSION.js" ></script>
<script type="application/javascript" src="velocity.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
View
@@ -173,15 +173,3 @@ c3dl_require('interaction/collision.js');
c3dl_require('interaction/picking.js');
c3dl_require('interaction/pickingresult.js');
-//Function to call the various versions of requestAnimationFrame
-//To be updated when this is properly standardized.
-window.requestAnimFrame = (function(callback){
- return window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function(/* function */ callback, /* DOMElement */ element){
- window.setTimeout(callback, 1000 / 60);
- };
- })();
View
@@ -105,5 +105,5 @@ var c3dl =
}
tmpparent.prototype.constructor.apply(o);
delete o.__parent;
- },
+ }
};
View
@@ -413,8 +413,8 @@ try{
Float32Array = WebGLFloatArray;
}
-const C3DL_FLOAT_ARRAY = Float32Array;
-const C3DL_UINT_ARRAY = Uint8Array;
+var C3DL_FLOAT_ARRAY = Float32Array;
+var C3DL_UINT_ARRAY = Uint8Array;
//Used to for temp vectors and matrixs needed in update loops
c3dl.mat1 = new C3DL_FLOAT_ARRAY(16);
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -24,14 +24,14 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
-const MJS_VERSION = 0x000000;
-const MJS_DO_ASSERT = true;
+var MJS_VERSION = 0x000000;
+var MJS_DO_ASSERT = true;
try {
WebGLFloatArray;
} catch (x) {
WebGLFloatArray = Float32Array;
}
-const MJS_FLOAT_ARRAY_TYPE = WebGLFloatArray;
+var MJS_FLOAT_ARRAY_TYPE = WebGLFloatArray;
if (MJS_DO_ASSERT) {
function MathUtils_assert(cond, msg) {
if (!cond) throw "Assertion failed: " + msg;
@@ -171,7 +171,7 @@ c3dl.ParticleSystem = function ()
c3dl.getRandom(this.minColor[0], this.maxColor[0]),
c3dl.getRandom(this.minColor[1], this.maxColor[1]),
c3dl.getRandom(this.minColor[2], this.maxColor[2]),
- c3dl.getRandom(this.minColor[3], this.maxColor[3]),
+ c3dl.getRandom(this.minColor[3], this.maxColor[3])
]);
this.particles[index].setSize(c3dl.getRandom(this.minSize, this.maxSize));
Oops, something went wrong.

0 comments on commit 2777aaa

Please sign in to comment.