Michael Ludwig avatar Michael Ludwig committed b49fe9b

Get scene package working more-or-less

Comments (0)

Files changed (54)

ferox-demos/src/main/java/com/ferox/anim/SimpleSkeletonDemo.java

-/*
- * Ferox, a graphics and game library in Java
- *
- * Copyright (c) 2012, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.ferox.anim;
-
-import com.ferox.input.KeyEvent.KeyCode;
-import com.ferox.input.logic.Action;
-import com.ferox.input.logic.InputManager;
-import com.ferox.input.logic.InputState;
-import com.ferox.input.logic.Predicates;
-import com.ferox.math.ColorRGB;
-import com.ferox.math.Matrix4;
-import com.ferox.math.Vector3;
-import com.ferox.math.Vector4;
-import com.ferox.math.bounds.QuadTree;
-import com.ferox.renderer.OnscreenSurface;
-import com.ferox.renderer.geom.Cylinder;
-import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.geom.Sphere;
-import com.ferox.renderer.geom.VertexBufferObject.StorageMode;
-import com.ferox.renderer.impl.lwjgl.LwjglFramework;
-import com.ferox.scene.*;
-import com.ferox.scene.task.BuildVisibilityIndexTask;
-import com.ferox.scene.task.ComputeCameraFrustumTask;
-import com.ferox.scene.task.ComputePVSTask;
-import com.ferox.scene.task.UpdateWorldBoundsTask;
-import com.ferox.scene.task.ffp.FixedFunctionRenderTask;
-import com.ferox.scene.task.light.ComputeLightGroupTask;
-import com.ferox.scene.task.light.ComputeShadowFrustumTask;
-import com.ferox.util.ApplicationStub;
-import com.ferox.util.profile.Profiler;
-import com.lhkbob.entreri.Entity;
-import com.lhkbob.entreri.EntitySystem;
-import com.lhkbob.entreri.task.Job;
-import com.lhkbob.entreri.task.Timers;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class SimpleSkeletonDemo extends ApplicationStub {
-    // positive half-circle
-    private static final double MAX_THETA = Math.PI;
-    private static final double MIN_THETA = 0;
-
-    // positive octant
-    private static final double MAX_PHI = Math.PI / 2.0;
-    private static final double MIN_PHI = Math.PI / 12.0;
-
-    private static final double MIN_ZOOM = 1.0;
-    private static final double MAX_ZOOM = 140;
-
-    private static final double ANGLE_RATE = Math.PI / 4.0;
-    private static final double ZOOM_RATE = 10.0;
-
-    private Job renderJob;
-    private EntitySystem system;
-
-    private Entity camera;
-
-    private double theta; // angle of rotation around global y-axis
-    private double phi; // angle of rotation from xz plane
-    private double zoom; // distance from origin
-
-    public SimpleSkeletonDemo() {
-        super(LwjglFramework.create());
-    }
-
-    @Override
-    protected void installInputHandlers(InputManager io) {
-        io.on(Predicates.keyPress(KeyCode.O)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                Profiler.getDataSnapshot().print(System.out);
-            }
-        });
-
-        // camera controls
-        io.on(Predicates.keyHeld(KeyCode.W)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                phi += ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (phi > MAX_PHI) {
-                    phi = MAX_PHI;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.S)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                phi -= ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (phi < MIN_PHI) {
-                    phi = MIN_PHI;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.D)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                theta -= ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (theta < MIN_THETA) {
-                    theta = MIN_THETA;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.A)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                theta += ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (theta > MAX_THETA) {
-                    theta = MAX_THETA;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.X)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                zoom += ZOOM_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (zoom > MAX_ZOOM) {
-                    zoom = MAX_ZOOM;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.Z)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                zoom -= ZOOM_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (zoom < MIN_ZOOM) {
-                    zoom = MIN_ZOOM;
-                }
-                updateCameraOrientation();
-            }
-        });
-    }
-
-    private void updateCameraOrientation() {
-        Vector3 pos = new Vector3();
-        double r = zoom * Math.cos(phi);
-        pos.x = r * Math.cos(theta);
-        pos.y = zoom * Math.sin(phi);
-        pos.z = r * Math.sin(theta);
-
-        camera.get(Transform.class).getData()
-              .setMatrix(new Matrix4().lookAt(new Vector3(), pos, new Vector3(0, 1, 0)));
-    }
-
-    @Override
-    protected void init(OnscreenSurface surface) {
-        //        surface.setVSyncEnabled(true);
-        system = new EntitySystem();
-
-        renderJob = system.getScheduler()
-                          .createJob("render", Timers.measuredDelta(), new SkeletonAnimationTask(),
-                                     new BoneTransformTask(), new BoneLinkTask(), new UpdateWorldBoundsTask(),
-                                     new ComputeCameraFrustumTask(), new ComputeShadowFrustumTask(),
-                                     new BuildVisibilityIndexTask(new QuadTree<Entity>()),
-                                     new ComputePVSTask(), new ComputeLightGroupTask(),
-                                     new FixedFunctionRenderTask(surface.getFramework(), 1024, false));
-
-        Entity mainSkeleton = system.addEntity();
-        try {
-            AcclaimSkeleton skeleton = new AcclaimSkeleton();
-            InputStream in = new FileInputStream(
-                    "/Users/michaelludwig/Desktop/U of M/Semesters/Spring 2013/Directed Study/cmu_motions/35.asf");
-            skeleton.load(in);
-            skeleton.addSkeleton(mainSkeleton);
-
-            in.close();
-
-            in = new FileInputStream(
-                    "/Users/michaelludwig/Desktop/U of M/Semesters/Spring 2013/Directed Study/cmu_motions/35_22.amc");
-            SkeletonAnimation anim = skeleton.loadAnimation(in, 1 / 120.0);
-
-            mainSkeleton.add(Animated.class).getData().setAnimation(anim).setTimeScale(1);
-        } catch (IOException i) {
-            throw new RuntimeException(i);
-        }
-
-        // visualize skeleton
-        for (Bone b : mainSkeleton.get(Skeleton.class).getData().getBones()) {
-            if (b.getName().equals("root")) {
-                continue;
-            }
-
-            // main bone
-            Entity boneLink = system.addEntity();
-            boneLink.setOwner(mainSkeleton);
-
-            boneLink.add(BoneLink.class).getData().setLinkedBone(b);
-
-            Matrix4 r = b.getRelativeBoneTransform();
-            Matrix4 ri = new Matrix4().inverse(r);
-            Vector3 offset = new Vector3(ri.m03, ri.m13, ri.m23).scale(.5);
-            //            Geometry g = Cylinder.create(offset, new Vector3().scale(offset, -.5), .1,
-            //                                         offset.length(), 16, StorageMode.GPU_STATIC);
-            System.out.println(b.getName() + " " + r);
-            Geometry g = Cylinder.create(offset, offset, .1, offset.length() * 2, 16, StorageMode.GPU_STATIC);
-
-            boneLink.add(Renderable.class).getData().setVertices(g.getVertices())
-                    .setIndices(g.getPolygonType(), g.getIndices(), g.getIndexOffset(), g.getIndexCount())
-                    .setLocalBounds(g.getBounds());
-
-            boneLink.add(BlinnPhongMaterial.class).getData().setNormals(g.getNormals());
-            boneLink.add(DiffuseColor.class).getData().setColor(new ColorRGB(1, 1, 1));
-
-            // origin link
-            boneLink = system.addEntity();
-            boneLink.setOwner(mainSkeleton);
-
-            boneLink.add(BoneLink.class).getData().setLinkedBone(b);
-
-            g = Sphere.create(.3, 16, StorageMode.GPU_STATIC);
-
-            boneLink.add(Renderable.class).getData().setVertices(g.getVertices())
-                    .setIndices(g.getPolygonType(), g.getIndices(), g.getIndexOffset(), g.getIndexCount())
-                    .setLocalBounds(g.getBounds());
-
-            boneLink.add(BlinnPhongMaterial.class).getData().setNormals(g.getNormals());
-            boneLink.add(DiffuseColor.class).getData().setColor(new ColorRGB(1, 0, 0));
-        }
-
-        // a point light
-        Entity point = system.addEntity();
-        point.add(PointLight.class).getData().setColor(new ColorRGB(1, 1, 1));
-        point.get(Transform.class).getData()
-             .setMatrix(new Matrix4().setIdentity().setCol(3, new Vector4(10, 10, 10, 1)));
-
-        Entity ambient = system.addEntity();
-        ambient.add(AmbientLight.class).getData().setColor(new ColorRGB(.7, .7, .7));
-
-        // camera
-        theta = (MAX_THETA + MIN_THETA) / 2.0;
-        phi = (MAX_PHI + MIN_PHI) / 2.0;
-        zoom = (MAX_ZOOM + MIN_ZOOM) / 2.0;
-
-        camera = system.addEntity();
-        camera.add(Camera.class).getData().setSurface(surface).setZDistances(1.0, 500);
-        updateCameraOrientation();
-    }
-
-    @Override
-    protected void renderFrame(OnscreenSurface surface) {
-        system.getScheduler().runOnCurrentThread(renderJob);
-    }
-
-    public static void main(String[] args) throws IOException {
-        new SimpleSkeletonDemo().run();
-    }
-}

ferox-demos/src/main/java/com/ferox/physics/GravityTest.java

 import com.ferox.physics.dynamics.RigidBody;
 import com.ferox.renderer.OnscreenSurface;
 import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.geom.VertexBufferObject.StorageMode;
 import com.ferox.scene.*;
 import com.lhkbob.entreri.Entity;
 
 public class GravityTest extends PhysicsApplicationStub {
-    private static final StorageMode COMPILE_TYPE = StorageMode.GPU_STATIC;
-
     @Override
     protected void init(OnscreenSurface surface) {
         super.init(surface);
 
         // camera
         Entity camera = system.addEntity();
-        camera.add(Camera.class).getData().setSurface(surface).setZDistances(1.0, 6 * BOUNDS);
-        camera.add(Transform.class).getData()
+        camera.add(Camera.class).setSurface(surface).setZDistances(1.0, 6 * BOUNDS);
+        camera.add(Transform.class)
               .setMatrix(new Matrix4().set(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, .75 * BOUNDS, 0, 0, 0, 1));
 
         // shapes
-        Geometry geomShape1 = com.ferox.renderer.geom.Box.create(2 + 2 * MARGIN, COMPILE_TYPE);
+        Geometry geomShape1 = com.ferox.renderer.geom.Box.create(getFramework(), 2 + 2 * MARGIN);
         com.ferox.physics.collision.Shape physShape1 = new com.ferox.physics.collision.shape.Box(2, 2, 2);
 
-        Geometry geomShape2 = com.ferox.renderer.geom.Box.create(2 + 2 * MARGIN, COMPILE_TYPE);
+        Geometry geomShape2 = com.ferox.renderer.geom.Box.create(getFramework(), 2 + 2 * MARGIN);
         com.ferox.physics.collision.Shape physShape2 = new com.ferox.physics.collision.shape.Box(2, 2, 2);
 
-        //        Geometry geomShape1 = new com.ferox.util.geom.Sphere(1 + MARGIN, 16, COMPILE_TYPE);
-        //        com.ferox.physics.collision.Shape physShape1 = new com.ferox.physics.collision.shape.Sphere(1);
-
         physShape1.setMargin(MARGIN);
         physShape2.setMargin(MARGIN);
 
         // falling down entity
         Entity e = system.addEntity();
-        e.add(Renderable.class).getData().setVertices(geomShape1.getVertices())
-         .setLocalBounds(geomShape1.getBounds())
-         .setIndices(geomShape1.getPolygonType(), geomShape1.getIndices(), geomShape1.getIndexOffset(),
-                     geomShape1.getIndexCount());
-        e.add(BlinnPhongMaterial.class).getData().setNormals(geomShape1.getNormals());
-        e.add(DiffuseColor.class).getData().setColor(new ColorRGB(1.0, 0.0, 0.0));
-        e.add(Transform.class);
+        e.add(Renderable.class).setGeometry(geomShape1);
+        e.add(LambertianDiffuseModel.class).setColor(new ColorRGB(1.0, 0.0, 0.0));
 
-        e.add(CollisionBody.class).getData().setShape(physShape1)
+        e.add(CollisionBody.class).setShape(physShape1)
          .setTransform(new Matrix4().set(1, 0, 0, 0, 0, 1, 0, BOUNDS / 2, 0, 0, 1, 0, 0, 0, 0, 1));
-        e.add(RigidBody.class).getData().setMass(1.0);
-        e.add(Gravity.class).getData().setGravity(new Vector3(0, -10, 0));
+        e.add(RigidBody.class).setMass(1.0);
+        e.add(Gravity.class).setGravity(new Vector3(0, -10, 0));
 
         // falling up entity
         e = system.addEntity();
-        e.add(Renderable.class).getData().setVertices(geomShape2.getVertices())
-         .setLocalBounds(geomShape2.getBounds())
-         .setIndices(geomShape2.getPolygonType(), geomShape2.getIndices(), geomShape2.getIndexOffset(),
-                     geomShape2.getIndexCount());
-        e.add(BlinnPhongMaterial.class).getData().setNormals(geomShape2.getNormals());
-        e.add(DiffuseColor.class).getData().setColor(new ColorRGB(0.0, 1.0, 0.0));
-        e.add(Transform.class);
+        e.add(Renderable.class).setGeometry(geomShape2);
+        e.add(LambertianDiffuseModel.class).setColor(new ColorRGB(0.0, 1.0, 0.0));
 
-        e.add(CollisionBody.class).getData().setShape(physShape2)
+        e.add(CollisionBody.class).setShape(physShape2)
          .setTransform(new Matrix4().set(1, 0, 0, 0, 0, 1, 0, -BOUNDS / 2, 0, 0, 1, 0, 0, 0, 0, 1));
-        e.add(RigidBody.class).getData().setMass(1.0);
-        e.add(Gravity.class).getData().setGravity(new Vector3(0, 10, 0));
+        e.add(RigidBody.class).setMass(1.0);
+        e.add(Gravity.class).setGravity(new Vector3(0, 10, 0));
 
         // ambient light
-        system.addEntity().add(AmbientLight.class).getData().setColor(new ColorRGB(0.2, 0.2, 0.2));
+        system.addEntity().add(AmbientLight.class).setColor(new ColorRGB(0.2, 0.2, 0.2));
 
         // a point light
         Entity point = system.addEntity();
-        point.add(PointLight.class).getData().setColor(new ColorRGB(0.5, 0.5, 0.5));
-        point.add(Transform.class).getData().setMatrix(
+        point.add(Light.class).setColor(new ColorRGB(0.5, 0.5, 0.5)).setCutoffAngle(180.0);
+        point.add(Transform.class).setMatrix(
                 new Matrix4().set(1, 0, 0, BOUNDS / 2, 0, 1, 0, BOUNDS / 2, 0, 0, 1, BOUNDS / 2, 0, 0, 0, 1));
     }
 

ferox-demos/src/main/java/com/ferox/physics/PhysicsApplicationStub.java

 import com.ferox.physics.collision.CollisionBody;
 import com.ferox.physics.collision.DefaultCollisionAlgorithmProvider;
 import com.ferox.physics.task.ConstraintSolvingTask;
-import com.ferox.physics.task.ForcesTask;
-import com.ferox.physics.task.MotionTask;
-import com.ferox.physics.task.TemporalSAPCollisionTask;
+import com.ferox.physics.task.IntegrationTask;
+import com.ferox.physics.task.SpatialIndexCollisionTask;
+import com.ferox.renderer.Framework;
 import com.ferox.renderer.OnscreenSurface;
-import com.ferox.renderer.impl.lwjgl.LwjglFramework;
 import com.ferox.scene.Camera;
 import com.ferox.scene.Transform;
 import com.ferox.scene.task.BuildVisibilityIndexTask;
     private Job renderJob;
 
     public PhysicsApplicationStub() {
-        super(LwjglFramework.create());
-        system = new EntitySystem();
+        super(Framework.Factory.create());
+        system = EntitySystem.Factory.create();
     }
 
     @Override
         pos.y = zoom * Math.sin(phi);
         pos.z = r * Math.sin(theta);
 
-        camera.get(Transform.class).getData()
-              .setMatrix(new Matrix4().lookAt(new Vector3(), pos, new Vector3(0, 1, 0)));
+        camera.get(Transform.class).setMatrix(new Matrix4().lookAt(new Vector3(), pos, new Vector3(0, 1, 0)));
     }
 
     @Override
     protected void init(OnscreenSurface surface) {
         // physics handling
-        physicsJob = system.getScheduler().createJob("physics", Timers.fixedDelta(1 / 60.0), new ForcesTask(),
-                                                     //                                      new SpatialIndexCollisionController(new QuadTree<Entity>(worldBounds,
-                                                     //                                                                                               6),
-                                                     //                                                                          new DefaultCollisionAlgorithmProvider()),
-                                                     //                                      new SingleAxisSAPCollisionController(new DefaultCollisionAlgorithmProvider()),
-                                                     new TemporalSAPCollisionTask(
-                                                             new DefaultCollisionAlgorithmProvider()),
-                                                     new ConstraintSolvingTask(), new MotionTask(),
-                                                     new TransformController());
+        physicsJob = system.getScheduler()
+                           .createJob("physics", Timers.fixedDelta(1 / 60.0), new IntegrationTask(),
+                                      new SpatialIndexCollisionTask(new QuadTree<Entity>(worldBounds, 6),
+                                                                    new DefaultCollisionAlgorithmProvider()),
+                                      //                                      new SingleAxisSAPCollisionController(new DefaultCollisionAlgorithmProvider()),
+                                      //                                      new TemporalSAPCollisionTask(new DefaultCollisionAlgorithmProvider()),
+                                      new ConstraintSolvingTask(), new TransformController());
 
         // rendering
         renderJob = system.getScheduler()
         zoom = (MAX_ZOOM + MIN_ZOOM) / 2.0;
 
         camera = system.addEntity();
-        camera.add(Camera.class).getData().setSurface(surface).setZDistances(1.0, BOUNDS);
+        camera.add(Camera.class).setSurface(surface).setZDistances(1.0, BOUNDS);
         updateCameraOrientation();
     }
 
     private static class TransformController implements Task {
         @Override
         public Task process(EntitySystem system, Job job) {
-            CollisionBody cb = system.createDataInstance(CollisionBody.class);
-            Transform t = system.createDataInstance(Transform.class);
-
-            ComponentIterator it = new ComponentIterator(system);
-            it.addRequired(cb);
-            it.addRequired(t);
+            ComponentIterator it = system.fastIterator();
+            CollisionBody cb = it.addRequired(CollisionBody.class);
+            Transform t = it.addRequired(Transform.class);
 
             while (it.next()) {
                 t.setMatrix(cb.getTransform());

ferox-demos/src/main/java/com/ferox/physics/PhysicsTest.java

 import com.ferox.renderer.OnscreenSurface;
 import com.ferox.renderer.geom.Box;
 import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.geom.VertexBufferObject.StorageMode;
 import com.ferox.scene.*;
 import com.ferox.scene.AtmosphericFog.Falloff;
 import com.lhkbob.entreri.Entity;
 
 public class PhysicsTest extends PhysicsApplicationStub {
-    private static final StorageMode COMPILE_TYPE = StorageMode.GPU_STATIC;
-
     private static final int NUM_X = 5;
     private static final int NUM_Y = 5;
     private static final int NUM_Z = 5;
         super.init(surface);
 
         // shapes
-        Geometry box = Box.create(2 + 2 * MARGIN, COMPILE_TYPE);
+        Geometry box = Box.create(getFramework(), 2 + 2 * MARGIN);
         //        Geometry sphere = Sphere.create(1 + MARGIN, 32, COMPILE_TYPE);
 
         com.ferox.physics.collision.Shape boxShape = new com.ferox.physics.collision.shape.Box(2, 2, 2);
                     double rz = (Math.random() * randZLim - randZLim / 2);
 
                     Entity e = system.addEntity();
-                    e.add(Renderable.class).getData().setVertices(geomShape.getVertices())
-                     .setLocalBounds(geomShape.getBounds())
-                     .setIndices(geomShape.getPolygonType(), geomShape.getIndices(),
-                                 geomShape.getIndexOffset(), geomShape.getIndexCount());
-                    e.add(BlinnPhongMaterial.class).getData().setNormals(geomShape.getNormals());
-                    e.add(DiffuseColor.class).getData().setColor(color);
+                    e.add(Renderable.class).setGeometry(geomShape);
+                    e.add(LambertianDiffuseModel.class).setColor(color);
 
-                    e.add(CollisionBody.class).getData().setShape(physShape).setTransform(
-                            new Matrix4().setIdentity().setCol(3, new Vector4(
-                                    (SCALE_X + 2 * MARGIN) * x + rx + startX,
-                                    (SCALE_Y + 2 * MARGIN) * y + ry + startY,
-                                    (SCALE_Z + 2 * MARGIN) * z + rz + startZ, 1)));
-                    e.add(RigidBody.class).getData().setMass(1.0);
+                    e.add(CollisionBody.class).setShape(physShape).setTransform(
+                            new Matrix4().setIdentity().setCol(3, new Vector4((SCALE_X + 2 * MARGIN) * x +
+                                                                              rx +
+                                                                              startX,
+                                                                              (SCALE_Y + 2 * MARGIN) * y +
+                                                                              ry +
+                                                                              startY,
+                                                                              (SCALE_Z + 2 * MARGIN) * z +
+                                                                              rz +
+                                                                              startZ, 1)));
+                    e.add(RigidBody.class).setMass(1.0);
                 }
             }
         }
 
         // some walls
-        Geometry bottomWall = Box.create(BOUNDS + 2 * MARGIN, 1, BOUNDS + 2 * MARGIN, COMPILE_TYPE);
+        Geometry bottomWall = Box.create(getFramework(), BOUNDS + 2 * MARGIN, 1, BOUNDS + 2 * MARGIN);
         Entity wall = system.addEntity();
-        wall.add(Renderable.class).getData().setVertices(bottomWall.getVertices())
-            .setLocalBounds(bottomWall.getBounds())
-            .setIndices(bottomWall.getPolygonType(), bottomWall.getIndices(), bottomWall.getIndexOffset(),
-                        bottomWall.getIndexCount());
-        wall.add(BlinnPhongMaterial.class).getData().setNormals(bottomWall.getNormals());
-        wall.add(DiffuseColor.class).getData().setColor(new ColorRGB(0.5, 0.5, 0.5));
+        wall.add(Renderable.class).setGeometry(bottomWall);
+        wall.add(LambertianDiffuseModel.class).setColor(new ColorRGB(0.5, 0.5, 0.5));
 
-        wall.add(CollisionBody.class).getData()
-            .setShape(new com.ferox.physics.collision.shape.Box(BOUNDS, 1, BOUNDS))
+        wall.add(CollisionBody.class).setShape(new com.ferox.physics.collision.shape.Box(BOUNDS, 1, BOUNDS))
             .setTransform(new Matrix4().setIdentity().setCol(3, new Vector4(0, -.5, 0, 1)));
 
         // fog
-        system.addEntity().add(AtmosphericFog.class).getData().setOpaqueDistance(2 * BOUNDS)
+        system.addEntity().add(AtmosphericFog.class).setOpaqueDistance(2 * BOUNDS)
               .setFalloff(Falloff.EXPONENTIAL_SQUARED).setColor(new ColorRGB());
 
         // ambient light
-        system.addEntity().add(AmbientLight.class).getData().setColor(new ColorRGB(.2, .2, .2));
+        system.addEntity().add(AmbientLight.class).setColor(new ColorRGB(.2, .2, .2));
 
         // a point light
         Entity point = system.addEntity();
-        point.add(PointLight.class).getData().setColor(new ColorRGB(0.5, 0.5, 0.5));
-        point.get(Transform.class).getData().setMatrix(
+        point.add(Light.class).setColor(new ColorRGB(0.5, 0.5, 0.5)).setCutoffAngle(180.0);
+        point.get(Transform.class).setMatrix(
                 new Matrix4().setIdentity().setCol(3, new Vector4(BOUNDS / 2, BOUNDS / 2, BOUNDS / 2, 1)));
 
         // a directed light, which casts shadows
         Entity inf = system.addEntity();
-        inf.add(DirectionLight.class).getData().setColor(new ColorRGB(1, 1, 1)).setShadowCaster(true);
-        inf.get(Transform.class).getData()
+        inf.add(Light.class).setColor(new ColorRGB(1, 1, 1)).setShadowCaster(true).setCutoffAngle(Double.NaN);
+        inf.get(Transform.class)
            .setMatrix(new Matrix4().lookAt(new Vector3(), new Vector3(15, 15, 15), new Vector3(0, 1, 0)));
     }
 

ferox-demos/src/main/java/com/ferox/renderer/impl/jogl/FixedFunctionRenderTest.java

-/*
- * Ferox, a graphics and game library in Java
- *
- * Copyright (c) 2012, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.ferox.renderer.impl.jogl;
-
-import com.ferox.input.logic.InputManager;
-import com.ferox.math.Matrix4;
-import com.ferox.math.Vector3;
-import com.ferox.math.Vector4;
-import com.ferox.math.bounds.Frustum;
-import com.ferox.renderer.FixedFunctionRenderer.TexCoord;
-import com.ferox.renderer.FixedFunctionRenderer.TexCoordSource;
-import com.ferox.renderer.Renderer.DrawStyle;
-import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.geom.Sphere;
-import com.ferox.renderer.geom.VertexBufferObject.StorageMode;
-import com.ferox.renderer.texture.Texture.Filter;
-import com.ferox.renderer.texture.Texture.Target;
-import com.ferox.renderer.texture.TextureFormat;
-import com.ferox.resource.BufferData;
-import com.ferox.resource.Mipmap;
-import com.ferox.util.ApplicationStub;
-
-public class FixedFunctionRenderTest extends ApplicationStub {
-    private FixedFunctionPass pass;
-
-    public FixedFunctionRenderTest() {
-        super(JoglFramework.create());
-    }
-
-    @Override
-    protected void installInputHandlers(InputManager io) {
-    }
-
-    @Override
-    protected void init(OnscreenSurface surface) {
-        pass = new FixedFunctionPass(surface);
-    }
-
-    @Override
-    protected void renderFrame(OnscreenSurface surface) {
-        surface.getFramework().queue(pass);
-    }
-
-    private static class FixedFunctionPass implements Task<Void> {
-        final Geometry shape;
-
-        final Texture volume;
-
-        final Frustum f;
-
-        boolean statusChecked;
-        final Surface surface;
-
-        public FixedFunctionPass(Surface surface) {
-            this.surface = surface;
-
-            shape = Sphere.create(2f, 32, StorageMode.GPU_STATIC);
-
-            f = new Frustum(60f, surface.getWidth() / (float) surface.getHeight(), 1f, 100f);
-            f.setOrientation(new Vector3(0f, 3f, 10f), new Vector3(0f, 0f, -1f), new Vector3(0f, 1f, 0f));
-
-            int width = 256;
-            int height = 256;
-            int depth = 256;
-
-            byte[] volumeBuffer = new byte[width * height * depth * 4];
-            for (int z = 0; z < depth; z++) {
-                for (int y = 0; y < height; y++) {
-                    for (int x = 0; x < width; x++) {
-                        int index = z * width * height * 4 + y * width * 4 + x * 4;
-
-                        volumeBuffer[index] = (byte) (z / (float) depth * 256);
-                        volumeBuffer[index + 1] = (byte) (y / (float) height * 256);
-                        volumeBuffer[index + 2] = (byte) (x / (float) width * 256);
-                        volumeBuffer[index + 3] = (byte) 127;
-                    }
-                }
-            }
-
-            Mipmap data = new Mipmap(new BufferData(volumeBuffer), width, height, depth, TextureFormat.RGBA);
-            volume = new Texture(Target.T_3D, data);
-            volume.setFilter(Filter.NEAREST);
-        }
-
-        @Override
-        public Void run(HardwareAccessLayer access) {
-            Context context = access.setActiveSurface(surface);
-            if (context == null) {
-                return null;
-            }
-
-            FixedFunctionRenderer g = context.getFixedFunctionRenderer();
-            if (g != null) {
-                g.clear(true, true, true, new Vector4(.2f, .2f, .2f, 1f), 1, 0);
-
-                g.setDrawStyle(DrawStyle.SOLID);
-
-                g.setVertices(shape.getVertices());
-                g.setNormals(shape.getNormals());
-                g.setTextureCoordinates(0, shape.getTextureCoordinates());
-
-                g.setTexture(0, volume);
-                g.setTextureCoordGeneration(0, TexCoord.R, TexCoordSource.OBJECT);
-
-                g.setProjectionMatrix(f.getProjectionMatrix());
-
-                Matrix4 t = new Matrix4();
-                int rendered = 0;
-                for (int i = 0; i < 10000; i++) {
-                    t.setIdentity();
-                    t.set(0, 3, (float) Math.random() * 100 - 50);
-                    t.set(1, 3, (float) Math.random() * 100 - 50);
-                    t.set(2, 3, (float) Math.random() * 100 - 50);
-
-                    g.setModelViewMatrix(f.getViewMatrix().mul(t, t));
-
-                    g.setIndices(shape.getIndices());
-                    rendered += g
-                            .render(shape.getPolygonType(), shape.getIndexOffset(), shape.getIndexCount());
-                }
-
-                if (!statusChecked) {
-                    statusChecked = true;
-
-                    System.out.println("Rendered count: " + rendered);
-
-                    System.out.println("\nvertices status: " +
-                                       surface.getFramework().getStatus(shape.getVertices().getVBO()));
-                    System.out.println("\nnormals status: " +
-                                       surface.getFramework().getStatus(shape.getNormals().getVBO()));
-                    System.out.println("\ntexcoords status: " + surface.getFramework().getStatus(
-                            shape.getTextureCoordinates().getVBO()));
-
-                    System.out.println("\ntexture status: " +
-                                       surface.getFramework().getStatus(volume) + " " +
-                                       surface.getFramework().getStatusMessage(volume));
-                }
-            }
-
-            return null;
-        }
-    }
-
-    public static void main(String[] args) {
-        new FixedFunctionRenderTest().run();
-    }
-}

ferox-demos/src/main/java/com/ferox/renderer/impl/jogl/GlslRenderTest.java

-/*
- * Ferox, a graphics and game library in Java
- *
- * Copyright (c) 2012, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.ferox.renderer.impl.jogl;
-
-import com.ferox.input.logic.InputManager;
-import com.ferox.math.Vector3;
-import com.ferox.math.Vector4;
-import com.ferox.math.bounds.Frustum;
-import com.ferox.renderer.Resource.Status;
-import com.ferox.renderer.geom.Box;
-import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.texture.Texture.Filter;
-import com.ferox.renderer.texture.Texture.Target;
-import com.ferox.renderer.texture.TextureFormat;
-import com.ferox.resource.GlslShader.ShaderType;
-import com.ferox.util.ApplicationStub;
-
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class GlslRenderTest extends ApplicationStub {
-    private static final String VERTEX_SHADER = "uniform mat4 projection;" + "uniform mat4 modelview;" +
-                                                "uniform vec2 transform;" +
-
-                                                "attribute vec3 vertex;" + "varying vec3 tcs;" +
-
-                                                "void main() {" +
-                                                "   tcs = vec3((vertex.x + transform.x) * transform.y, (vertex.y + transform.x) * transform.y, (vertex.z + transform.x) * transform.y);" +
-                                                "   gl_Position = projection * modelview * vec4(vertex, 1.0);" +
-                                                "}";
-    private static final String FRAGMENT_SHADER = "uniform vec4 color;" + "uniform sampler3D texture;" +
-
-                                                  "varying vec3 tcs;" +
-
-                                                  "void main() {" +
-                                                  "   gl_FragColor = texture3D(texture, tcs) * color;" + "}";
-
-    private GlslPass pass;
-
-    public GlslRenderTest() {
-        super(JoglFramework.create());
-    }
-
-    @Override
-    protected void installInputHandlers(InputManager io) {
-    }
-
-    @Override
-    protected void init(OnscreenSurface surface) {
-        Framework framework = surface.getFramework();
-        pass = new GlslPass(surface);
-        Status status = framework.update(pass.shader);
-        if (status != Status.READY) {
-            System.out.println("Shader: " + status + " " + framework.getStatusMessage(pass.shader));
-            framework.destroy();
-            System.exit(0);
-        }
-    }
-
-    @Override
-    protected void renderFrame(OnscreenSurface surface) {
-        surface.getFramework().queue(pass);
-    }
-
-    public static void main(String[] args) throws Exception {
-        new GlslRenderTest().run();
-    }
-
-    private static class GlslPass implements Task<Void> {
-        final GlslShader shader;
-        final Geometry shape;
-
-        final Texture volume;
-
-        final Frustum f;
-
-        boolean statusChecked;
-        final Surface surface;
-
-        public GlslPass(Surface surface) {
-            this.surface = surface;
-
-            shape = Box.create(4.0);
-            shader = new GlslShader();
-
-            shader.setShader(ShaderType.VERTEX, VERTEX_SHADER);
-            shader.setShader(ShaderType.FRAGMENT, FRAGMENT_SHADER);
-
-            f = new Frustum(60f, surface.getWidth() / (float) surface.getHeight(), 1f, 100f);
-            f.setOrientation(new Vector3(0f, 3f, 10f), new Vector3(0f, 0f, -1f), new Vector3(0f, 1f, 0f));
-
-            int width = 256;
-            int height = 256;
-            int depth = 256;
-
-            byte[] volumeBuffer = new byte[width * height * depth * 4];
-            for (int z = 0; z < depth; z++) {
-                for (int y = 0; y < height; y++) {
-                    for (int x = 0; x < width; x++) {
-                        int index = z * width * height * 4 + y * width * 4 + x * 4;
-
-                        volumeBuffer[index] = (byte) (z / (float) depth * 256);
-                        volumeBuffer[index + 1] = (byte) (y / (float) height * 256);
-                        volumeBuffer[index + 2] = (byte) (x / (float) width * 256);
-                        volumeBuffer[index + 3] = (byte) 127;
-                    }
-                }
-            }
-
-            Mipmap data = new Mipmap(new BufferData(volumeBuffer), width, height, depth, TextureFormat.RGBA);
-            volume = new Texture(Target.T_3D, data);
-            volume.setFilter(Filter.NEAREST);
-        }
-
-        @Override
-        public Void run(HardwareAccessLayer access) {
-            Context context = access.setActiveSurface(surface);
-            if (context == null) {
-                return null;
-            }
-
-            GlslRenderer g = context.getGlslRenderer();
-            if (g != null) {
-                g.clear(true, true, true, new Vector4(.2f, .2f, .2f, 1f), 1, 0);
-
-                g.setShader(shader);
-                g.bindAttribute("vertex", shape.getVertices());
-
-                g.setUniform("projection", f.getProjectionMatrix());
-                g.setUniform("modelview", f.getViewMatrix());
-
-                g.setUniform("color", new Vector4(1f, 1f, 1f, 1f));
-                g.setUniform("texture", volume);
-
-                g.setUniform("transform", 2f, .25f);
-
-                g.setIndices(null);
-                int rendered = g
-                        .render(shape.getPolygonType(), shape.getIndexOffset(), shape.getIndexCount());
-
-                if (!statusChecked) {
-                    statusChecked = true;
-
-                    System.out.println("Rendered count: " + rendered);
-
-                    Status shaderStatus = surface.getFramework().getStatus(shader);
-                    String shaderMsg = surface.getFramework().getStatusMessage(shader);
-
-                    System.out.println(shaderStatus + " " + shaderMsg);
-
-                    System.out.println("uniforms:");
-                    Map<String, Uniform> uniforms = g.getUniforms();
-                    for (Entry<String, Uniform> u : uniforms.entrySet()) {
-                        Uniform uniform = u.getValue();
-                        System.out.println(uniform.getName() + " " + uniform.getType() + " " +
-                                           uniform.getLength());
-                    }
-
-                    System.out.println("\nattributes:");
-                    System.out.println(g.getAttributes());
-
-                    System.out.println("\ntexture status: " +
-                                       surface.getFramework().getStatus(volume) + " " +
-                                       surface.getFramework().getStatusMessage(volume));
-                }
-            }
-
-            return null;
-        }
-    }
-}

ferox-demos/src/main/java/com/ferox/renderer/impl/jogl/SelfDestructTest.java

-/*
- * Ferox, a graphics and game library in Java
- *
- * Copyright (c) 2012, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.ferox.renderer.impl.jogl;
-
-public class SelfDestructTest {
-    public static void main(String[] args) throws Exception {
-        final Framework f = JoglFramework.create();
-        System.out.println("framework created");
-        final OnscreenSurface surface = f.createSurface(new OnscreenSurfaceOptions()
-                                                                //            .setFullscreenMode(new DisplayMode(1024, 768, PixelFormat.RGB_24BIT))
-                                                                .setUndecorated(true).setResizable(false)
-                                                                .setWidth(500).setHeight(500));
-
-        System.out.println("surface created");
-        Thread.sleep(5000);
-
-        String result = f.queue(new Task<String>() {
-            @Override
-            public String run(HardwareAccessLayer access) {
-                System.out.println("activating surface");
-                access.setActiveSurface(surface);
-                System.out.println("destroying framework");
-                f.destroy();
-                return "finished";
-            }
-        }).get();
-
-        System.out.println(result);
-    }
-}

ferox-demos/src/main/java/com/ferox/scene/controller/ffp/Animation.java

+package com.ferox.scene.controller.ffp;
+
+import com.ferox.math.Const;
+import com.ferox.math.Vector3;
+import com.ferox.math.entreri.Vector3Property;
+import com.lhkbob.entreri.Component;
+import com.lhkbob.entreri.property.DoubleProperty;
+import com.lhkbob.entreri.property.SharedInstance;
+
+/**
+ *
+ */
+public interface Animation extends Component {
+    @DoubleProperty.DefaultDouble(1)
+    public double getLifetime();
+
+    public void setLifetime(double lt);
+
+    @Const
+    @SharedInstance
+    @Vector3Property.DefaultVector3(x = 0, y = 0, z = 0)
+    public Vector3 getDirection();
+
+    public void setDirection(@Const Vector3 dir);
+}

ferox-demos/src/main/java/com/ferox/scene/controller/ffp/SimpleTest.java

  */
 package com.ferox.scene.controller.ffp;
 
-import com.ferox.math.*;
+import com.ferox.math.AxisAlignedBox;
+import com.ferox.math.ColorRGB;
+import com.ferox.math.Matrix4;
+import com.ferox.math.Vector3;
 import com.ferox.math.bounds.QuadTree;
-import com.ferox.math.entreri.Vector3Property;
-import com.ferox.math.entreri.Vector3Property.DefaultVector3;
-import com.ferox.renderer.DisplayMode;
-import com.ferox.renderer.DisplayMode.PixelFormat;
 import com.ferox.renderer.Framework;
 import com.ferox.renderer.OnscreenSurface;
 import com.ferox.renderer.OnscreenSurfaceOptions;
 import com.ferox.renderer.geom.Geometry;
 import com.ferox.renderer.geom.Sphere;
 import com.ferox.renderer.geom.Teapot;
-import com.ferox.renderer.geom.VertexBufferObject.StorageMode;
-import com.ferox.renderer.impl.jogl.JoglFramework;
-import com.ferox.renderer.impl.lwjgl.LwjglFramework;
 import com.ferox.scene.*;
 import com.ferox.scene.task.BuildVisibilityIndexTask;
 import com.ferox.scene.task.ComputeCameraFrustumTask;
 import com.ferox.scene.task.light.ComputeLightGroupTask;
 import com.ferox.scene.task.light.ComputeShadowFrustumTask;
 import com.ferox.util.profile.Profiler;
-import com.lhkbob.entreri.ComponentData;
+import com.lhkbob.entreri.Component;
+import com.lhkbob.entreri.ComponentIterator;
 import com.lhkbob.entreri.Entity;
 import com.lhkbob.entreri.EntitySystem;
-import com.lhkbob.entreri.Unmanaged;
-import com.lhkbob.entreri.property.DoubleProperty;
-import com.lhkbob.entreri.property.DoubleProperty.DefaultDouble;
 import com.lhkbob.entreri.task.*;
 
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 public class SimpleTest {
-    public static final boolean LWJGL = true;
-
     public static final double BOUNDS = 200;
 
     public static void main(String[] args) {
-        Framework framework = (LWJGL ? LwjglFramework.create() : JoglFramework.create());
-        OnscreenSurface surface = framework.createSurface(
-                new OnscreenSurfaceOptions().setWidth(800).setHeight(600).setFullscreenMode(
-                        new DisplayMode(1440, 900, PixelFormat.RGB_24BIT)).setResizable(false));
+        Framework framework = Framework.Factory.create();
+        OnscreenSurface surface = framework
+                .createSurface(new OnscreenSurfaceOptions().windowed(800, 600).fixedSize());
         //        surface.setVSyncEnabled(true);
 
-        EntitySystem system = new EntitySystem();
+        EntitySystem system = EntitySystem.Factory.create();
 
         Entity camera = system.addEntity();
-        camera.add(Transform.class).getData()
+        camera.add(Transform.class)
               .setMatrix(new Matrix4().set(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, .9 * BOUNDS, 0, 0, 0, 1));
-        camera.add(Camera.class).getData().setSurface(surface).setZDistances(0.1, 1200).setFieldOfView(75);
+        camera.add(Camera.class).setSurface(surface).setZDistances(0.1, 1200).setFieldOfView(75);
 
-        Geometry b1 = Sphere.create(2f, 16, StorageMode.GPU_STATIC);
-        Geometry b2 = Box.create(2f, StorageMode.GPU_STATIC);
-        Geometry b3 = Teapot.create(1f, StorageMode.GPU_STATIC);
+        Geometry b1 = Sphere.create(framework, 2f, 16);
+        Geometry b2 = Box.create(framework, 2f);
+        Geometry b3 = Teapot.create(framework, 1f);
 
         ColorRGB c1 = new ColorRGB(Math.random() + 0.2, Math.random() + 0.2, Math.random() + 0.2);
         ColorRGB c2 = new ColorRGB(Math.random() + 0.2, Math.random() + 0.2, Math.random() + 0.2);
             int polycount = b.getPolygonType().getPolygonCount(b.getIndexCount() - b.getIndexOffset());
 
             Entity e = system.addEntity();
-            e.add(Renderable.class).getData().setVertices(b.getVertices()).setLocalBounds(b.getBounds())
-             .setIndices(b.getPolygonType(), b.getIndices(), b.getIndexOffset(), b.getIndexCount());
-            //            if (Math.random() < .9) {
-            e.add(BlinnPhongMaterial.class).getData().setNormals(b.getNormals());
-            //            }
-            e.add(DiffuseColor.class).getData().setColor(c);
-            e.add(Transform.class).getData().setMatrix(new Matrix4().set(1, 0, 0,
-                                                                         Math.random() * BOUNDS - BOUNDS / 2,
-                                                                         0, 1, 0,
-                                                                         Math.random() * BOUNDS - BOUNDS / 2,
-                                                                         0, 0, 1,
-                                                                         Math.random() * BOUNDS - BOUNDS / 2,
-                                                                         0, 0, 0, 1));
+            e.add(Renderable.class).setGeometry(b);
+            e.add(LambertianDiffuseModel.class).setColor(c);
+            e.add(Transform.class).setMatrix(new Matrix4()
+                                                     .set(1, 0, 0, Math.random() * BOUNDS - BOUNDS / 2, 0, 1,
+                                                          0, Math.random() * BOUNDS - BOUNDS / 2, 0, 0, 1,
+                                                          Math.random() * BOUNDS - BOUNDS / 2, 0, 0, 0, 1));
             e.add(Animation.class);
             totalpolys += polycount;
         }
             double falloff = 100.0 + Math.random() * 40;
 
             Entity light = system.addEntity();
-            light.add(PointLight.class).getData().setFalloffDistance(falloff)
+            light.add(Light.class).setFalloffDistance(falloff).setCutoffAngle(180.0)
                  .setColor(new ColorRGB(Math.random(), Math.random(), Math.random()));
 
-            if (falloff > 0) {
-                light.add(InfluenceRegion.class).getData().setBounds(
-                        new AxisAlignedBox(new Vector3(-falloff, -falloff, -falloff),
-                                           new Vector3(falloff, falloff, falloff)));
-            }
-            light.add(Transform.class).getData().setMatrix(new Matrix4().set(1, 0, 0, Math.random() * BOUNDS -
-                                                                                      BOUNDS / 2, 0, 1, 0,
-                                                                             Math.random() * BOUNDS -
-                                                                             BOUNDS / 2, 0, 0, 1,
-                                                                             Math.random() * BOUNDS -
-                                                                             BOUNDS / 2, 0, 0, 0, 1));
+            light.add(Transform.class).setMatrix(new Matrix4()
+                                                         .set(1, 0, 0, Math.random() * BOUNDS - BOUNDS / 2, 0,
+                                                              1, 0, Math.random() * BOUNDS - BOUNDS / 2, 0, 0,
+                                                              1, Math.random() * BOUNDS - BOUNDS / 2, 0, 0, 0,
+                                                              1));
         }
-        system.addEntity().add(AmbientLight.class).getData().setColor(new ColorRGB(0.2, 0.2, 0.2));
+        system.addEntity().add(AmbientLight.class).setColor(new ColorRGB(0.2, 0.2, 0.2));
 
         Entity inf = system.addEntity();
-        inf.add(DirectionLight.class).getData().setColor(new ColorRGB(1, 1, 1)).setShadowCaster(false);
-        inf.add(Transform.class).getData().setMatrix(new Matrix4().lookAt(new Vector3(),
-                                                                          new Vector3(.3 * BOUNDS,
-                                                                                      .3 * BOUNDS,
-                                                                                      .3 * BOUNDS),
-                                                                          new Vector3(0, 1, 0)));
+        inf.add(Light.class).setColor(new ColorRGB(1, 1, 1)).setCutoffAngle(Double.NaN)
+           .setShadowCaster(false);
+        inf.add(Transform.class).setMatrix(new Matrix4().lookAt(new Vector3(),
+                                                                new Vector3(.3 * BOUNDS, .3 * BOUNDS,
+                                                                            .3 * BOUNDS),
+                                                                new Vector3(0, 1, 0)));
 
         AxisAlignedBox worldBounds = new AxisAlignedBox(
                 new Vector3(-1.5 * BOUNDS / 2, -1.5 * BOUNDS / 2, -1.5 * BOUNDS / 2),
             Runtime r = Runtime.getRuntime();
             printMemory("total", r.totalMemory());
             printMemory("used", r.totalMemory() - r.freeMemory());
-            for (Class<? extends ComponentData<?>> t : system.getComponentTypes()) {
-                printMemory(t.toString(), system.estimateMemory(t));
-            }
         }
     }
 
 
         @Override
         public Task process(EntitySystem system, Job job) {
-            Transform t = system.createDataInstance(Transform.class);
-            Iterator<Animation> it = system.iterator(Animation.class);
-            while (it.hasNext()) {
-                Animation anim = it.next();
+            ComponentIterator it = system.fastIterator();
+            Transform t = it.addRequired(Transform.class);
+            Animation anim = it.addRequired(Animation.class);
+
+            while (it.next()) {
                 Vector3 d = anim.getDirection();
 
-                if (anim.getEntity().get(t) && anim.getDirection().lengthSquared() > 0.00001) {
+                if (anim.getDirection().lengthSquared() > 0.00001) {
                     // have a direction, assume its normalized
                     Matrix4 m = t.getMatrix();
 
 
         @Override
         @SuppressWarnings("unchecked")
-        public Set<Class<? extends ComponentData<?>>> getAccessedComponents() {
-            return new HashSet<Class<? extends ComponentData<?>>>(
-                    Arrays.asList(Animation.class, Transform.class));
+        public Set<Class<? extends Component>> getAccessedComponents() {
+            return new HashSet<>(Arrays.asList(Animation.class, Transform.class));
         }
 
         @Override
         }
     }
 
-    public static class Animation extends ComponentData<Animation> {
-        @DefaultDouble(1)
-        private DoubleProperty life;
-
-        @DefaultVector3(x = 0, y = 0, z = 0)
-        private Vector3Property direction;
-
-        @Unmanaged
-        private final Vector3 cache = new Vector3();
-
-        private Animation() {
-        }
-
-        public double getLifetime() {
-            return life.get(getIndex());
-        }
-
-        public void setLifetime(double lt) {
-            life.set(lt, getIndex());
-        }
-
-        public
-        @Const
-        Vector3 getDirection() {
-            return cache;
-        }
-
-        public void setDirection(@Const Vector3 dir) {
-            cache.set(dir);
-            direction.set(dir, getIndex());
-        }
-
-        @Override
-        protected void onSet(int index) {
-            direction.get(getIndex(), cache);
-        }
-    }
 }

ferox-demos/src/main/java/com/ferox/scene/controller/ffp/TransparentDemo.java

-/*
- * Ferox, a graphics and game library in Java
- *
- * Copyright (c) 2012, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.ferox.scene.controller.ffp;
-
-import com.ferox.input.KeyEvent.KeyCode;
-import com.ferox.input.logic.Action;
-import com.ferox.input.logic.InputManager;
-import com.ferox.input.logic.InputState;
-import com.ferox.input.logic.Predicates;
-import com.ferox.math.*;
-import com.ferox.math.bounds.QuadTree;
-import com.ferox.renderer.OnscreenSurface;
-import com.ferox.renderer.Renderer.DrawStyle;
-import com.ferox.renderer.geom.Box;
-import com.ferox.renderer.geom.Geometry;
-import com.ferox.renderer.impl.lwjgl.LwjglFramework;
-import com.ferox.scene.*;
-import com.ferox.scene.task.BuildVisibilityIndexTask;
-import com.ferox.scene.task.ComputeCameraFrustumTask;
-import com.ferox.scene.task.ComputePVSTask;
-import com.ferox.scene.task.UpdateWorldBoundsTask;
-import com.ferox.scene.task.ffp.FixedFunctionRenderTask;
-import com.ferox.scene.task.light.ComputeLightGroupTask;
-import com.ferox.scene.task.light.ComputeShadowFrustumTask;
-import com.ferox.util.ApplicationStub;
-import com.ferox.util.profile.Profiler;
-import com.lhkbob.entreri.Entity;
-import com.lhkbob.entreri.EntitySystem;
-import com.lhkbob.entreri.task.Job;
-
-public class TransparentDemo extends ApplicationStub {
-    protected static final int BOUNDS = 50;
-    protected static final double BOX_SIZE = 1.5;
-    protected static final int NUM_X = 5;
-    protected static final int NUM_Y = 5;
-    protected static final int NUM_Z = 5;
-    protected static final double GAP_X = 1;
-    protected static final double GAP_Y = 1;
-    protected static final double GAP_Z = 1;
-
-    protected static final AxisAlignedBox worldBounds = new AxisAlignedBox(
-            new Vector3(-2 * BOUNDS - 1, -2 * BOUNDS - 1, -2 * BOUNDS - 1),
-            new Vector3(2 * BOUNDS + 1, 2 * BOUNDS + 1, 2 * BOUNDS + 1));
-
-    // positive half-circle
-    private static final double MAX_THETA = Math.PI;
-    private static final double MIN_THETA = 0;
-
-    // positive octant
-    private static final double MAX_PHI = Math.PI / 2.0;
-    private static final double MIN_PHI = Math.PI / 12.0;
-
-    private static final double MIN_ZOOM = 1.0;
-    private static final double MAX_ZOOM = BOUNDS;
-
-    private static final double ANGLE_RATE = Math.PI / 4.0;
-    private static final double ZOOM_RATE = 10.0;
-
-    private Entity camera;
-
-    private double theta; // angle of rotation around global y-axis
-    private double phi; // angle of rotation from xz plane
-    private double zoom; // distance from origin
-
-    protected final EntitySystem system;
-    private Job renderJob;
-
-    public TransparentDemo() {
-        super(LwjglFramework.create());
-        system = new EntitySystem();
-    }
-
-    @Override
-    protected void installInputHandlers(InputManager io) {
-        io.on(Predicates.keyPress(KeyCode.O)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                Profiler.getDataSnapshot().print(System.out);
-            }
-        });
-
-        // camera controls
-        io.on(Predicates.keyHeld(KeyCode.W)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                phi += ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (phi > MAX_PHI) {
-                    phi = MAX_PHI;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.S)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                phi -= ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (phi < MIN_PHI) {
-                    phi = MIN_PHI;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.D)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                theta -= ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (theta < MIN_THETA) {
-                    theta = MIN_THETA;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.A)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                theta += ANGLE_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (theta > MAX_THETA) {
-                    theta = MAX_THETA;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.X)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                zoom += ZOOM_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (zoom > MAX_ZOOM) {
-                    zoom = MAX_ZOOM;
-                }
-                updateCameraOrientation();
-            }
-        });
-        io.on(Predicates.keyHeld(KeyCode.Z)).trigger(new Action() {
-            @Override
-            public void perform(InputState prev, InputState next) {
-                zoom -= ZOOM_RATE * ((next.getTimestamp() - prev.getTimestamp()) / 1e9);
-                if (zoom < MIN_ZOOM) {
-                    zoom = MIN_ZOOM;
-                }
-                updateCameraOrientation();
-            }
-        });
-    }
-
-    private void updateCameraOrientation() {
-        Vector3 pos = new Vector3();
-        double r = zoom * Math.cos(phi);
-        pos.x = r * Math.cos(theta);
-        pos.y = zoom * Math.sin(phi);
-        pos.z = r * Math.sin(theta);
-
-        camera.get(Transform.class).getData()
-              .setMatrix(new Matrix4().lookAt(new Vector3(), pos, new Vector3(0, 1, 0)));
-    }
-
-    @Override
-    protected void init(OnscreenSurface surface) {
-        // rendering
-        renderJob = system.getScheduler()
-                          .createJob("render", new UpdateWorldBoundsTask(), new ComputeCameraFrustumTask(),
-                                     new ComputeShadowFrustumTask(),
-                                     new BuildVisibilityIndexTask(new QuadTree<Entity>(worldBounds, 6)),
-                                     new ComputePVSTask(), new ComputeLightGroupTask(),
-                                     new FixedFunctionRenderTask(surface.getFramework(), 1024, false));
-
-        surface.setVSyncEnabled(true);
-
-        // camera
-        theta = (MAX_THETA + MIN_THETA) / 2.0;
-        phi = (MAX_PHI + MIN_PHI) / 2.0;
-        zoom = (MAX_ZOOM + MIN_ZOOM) / 2.0;
-
-        camera = system.addEntity();
-        camera.add(Camera.class).getData().setSurface(surface).setZDistances(1.0, BOUNDS);
-        updateCameraOrientation();
-
-        // boxes
-        Geometry boxGeom = Box.create(BOX_SIZE);
-        for (int x = 0; x < NUM_X; x++) {
-            for (int y = 0; y < NUM_Y; y++) {
-                for (int z = 0; z < NUM_Z; z++) {
-                    Vector4 pos = new Vector4();
-                    pos.x = (x - NUM_X / 2.0) * (BOX_SIZE + GAP_X);
-                    pos.y = (y - NUM_Y / 2.0) * (BOX_SIZE + GAP_Y);
-                    pos.z = (z - NUM_Z / 2.0) * (BOX_SIZE + GAP_Z);
-                    pos.w = 1;
-
-                    Entity box = system.addEntity();
-
-                    box.add(Renderable.class).getData().setVertices(boxGeom.getVertices())
-                       .setDrawStyle(DrawStyle.SOLID, DrawStyle.SOLID)
-                       .setIndices(boxGeom.getPolygonType(), boxGeom.getIndices(), boxGeom.getIndexOffset(),
-                                   boxGeom.getIndexCount()).setLocalBounds(boxGeom.getBounds());
-                    box.add(BlinnPhongMaterial.class).getData().setNormals(boxGeom.getNormals());
-                    box.add(DiffuseColor.class).getData()
-                       .setColor(new ColorRGB(x / (double) NUM_X, y / (double) NUM_Y, z / (double) NUM_Z));
-                    double rand = Math.random();
-                    if (rand < .3) {
-                        box.add(Transparent.class).getData().setOpacity(.5).setAdditive(true);
-                    } else if (rand < .6) {
-                        box.add(Transparent.class).getData().setOpacity(.5).setAdditive(false);
-                    }
-
-                    box.get(Transform.class).getData().setMatrix(new Matrix4().setIdentity().setCol(3, pos));
-                }
-            }
-        }
-
-        // ambient light
-        system.addEntity().add(AmbientLight.class).getData().setColor(new ColorRGB(.2, .2, .2));
-
-        // a point light
-        Entity point = system.addEntity();
-        point.add(PointLight.class).getData().setColor(new ColorRGB(0.8, 0.8, 0.8));
-        point.get(Transform.class).getData()
-             .setMatrix(new Matrix4().setIdentity().setCol(3, new Vector4(100, 100, 100, 1)));
-
-        // a directed light, which casts shadows
-        Entity inf = system.addEntity();
-        inf.add(DirectionLight.class).getData().setColor(new ColorRGB(1, 1, 1)).setShadowCaster(true);
-        inf.get(Transform.class).getData()
-           .setMatrix(new Matrix4().lookAt(new Vector3(), new Vector3(15, 15, 15), new Vector3(0, 1, 0)));
-    }
-
-    @Override
-    protected void renderFrame(OnscreenSurface surface) {
-        system.getScheduler().runOnCurrentThread(renderJob);
-    }
-
-    public static void main(String[] args) {
-        new TransparentDemo().run();
-    }
-}

ferox-demos/src/main/java/com/ferox/util/ApplicationStub.java

     private boolean showProfiling;
 
     public ApplicationStub(Framework framework) {
-        this(framework, new OnscreenSurfaceOptions().setWidth(800).setHeight(600).setResizable(false));
+        this(framework, new OnscreenSurfaceOptions().windowed(800, 800).fixedSize());
     }
 
     public ApplicationStub(Framework framework, OnscreenSurfaceOptions opts) {
         io.attach(surface);
 
         Runtime r = Runtime.getRuntime();
-        CharacterSet charSet = new CharacterSet(true, false);
+        CharacterSet charSet = new CharacterSet(framework, true, false);
         TextRenderer fps = null;
         TextRenderer profile = null;
 

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.AxisAlignedBox

+com.ferox.math.entreri.AxisAlignedBoxProperty

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.ColorRGB

+com.ferox.math.entreri.ColorRGBProperty

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.Matrix3

+com.ferox.math.entreri.Matrix3Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.Matrix4

+com.ferox.math.entreri.Matrix4Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.Quat4

+com.ferox.math.entreri.Quat4Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.Vector3

+com.ferox.math.entreri.Vector3Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.ferox.math.Vector4

+com.ferox.math.entreri.Vector4Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.AxisAlignedBox

-com.lhkbob.ferox.math.entreri.AxisAlignedBoxProperty

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.ColorRGB

-com.lhkbob.ferox.math.entreri.ColorRGBProperty

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.Matrix3

-com.lhkbob.ferox.math.entreri.Matrix3Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.Matrix4

-com.lhkbob.ferox.math.entreri.Matrix4Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.Quat4

-com.lhkbob.ferox.math.entreri.Quat4Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.Vector3

-com.lhkbob.ferox.math.entreri.Vector3Property

ferox-math/src/main/resources/META-INF/entreri/mapping/com.lhkbob.ferox.math.Vector4

-com.lhkbob.ferox.math.entreri.Vector4Property

ferox-physics/src/main/java/com/ferox/physics/dynamics/ContactManifoldPool.java

                             if (!mfFrictionComputed[index]) {
                                 // compute lateral friction direction
                                 Vector3 velA, velB;
-                                if (rbA.isAlive()) {
+                                if (rbA != null) {
                                     velA = t1.cross(rbA.getAngularVelocity(), relPosA).add(rbA.getVelocity());
                                 } else {
                                     velA = t1.set(0, 0, 0);
                                 }
 
-                                if (rbB.isAlive()) {
+                                if (rbB != null) {
                                     velB = t2.cross(rbB.getAngularVelocity(), relPosB).add(rbB.getVelocity());
                                 } else {
                                     velB = t2.set(0, 0, 0);

ferox-renderer-jogl/src/main/java/com/ferox/renderer/impl/jogl/JoglDepthCubeMapBuilder.java

         implements DepthCubeMapBuilder {
     public JoglDepthCubeMapBuilder(FrameworkImpl framework) {
         super(DepthCubeMapBuilder.class, DepthCubeMap.class, TextureImpl.Target.TEX_CUBEMAP, framework);
+        // preconfigure abstract builder for this type of texture
+        depth(1);
+        imageCount(6);
     }
 
     @Override

ferox-renderer-jogl/src/main/java/com/ferox/renderer/impl/jogl/JoglDepthMap2DBuilder.java

         implements DepthMap2DBuilder {
     public JoglDepthMap2DBuilder(FrameworkImpl framework) {
         super(DepthMap2DBuilder.class, DepthMap2D.class, TextureImpl.Target.TEX_2D, framework);
+        // preconfigure abstract builder for this type of texture
+        depth(1);
+        imageCount(1);
     }
 
     @Override

ferox-renderer-lwjgl/src/main/java/com/ferox/renderer/impl/lwjgl/LwjglDepthCubeMapBuilder.java

         implements DepthCubeMapBuilder {
     public LwjglDepthCubeMapBuilder(FrameworkImpl framework) {
         super(DepthCubeMapBuilder.class, DepthCubeMap.class, TextureImpl.Target.TEX_CUBEMAP, framework);
+        // preconfigure abstract builder for this type of texture
+        depth(1);
+        imageCount(6);
     }
 
     @Override

ferox-renderer-lwjgl/src/main/java/com/ferox/renderer/impl/lwjgl/LwjglDepthMap2DBuilder.java

         implements DepthMap2DBuilder {
     public LwjglDepthMap2DBuilder(FrameworkImpl framework) {
         super(DepthMap2DBuilder.class, DepthMap2D.class, TextureImpl.Target.TEX_2D, framework);
+        // preconfigure abstract builder for this type of texture
+        depth(1);
+        imageCount(1);
     }
 
     @Override

ferox-renderer/src/main/java/com/ferox/renderer/impl/AbstractFixedFunctionRenderer.java

 
     @Override
     public void setTextureEyePlanes(int tex, @Const Matrix4 planes) {
-        setTextureEyePlane(tex, TexCoord.S, planes.getCol(0));
-        setTextureEyePlane(tex, TexCoord.T, planes.getCol(1));
-        setTextureEyePlane(tex, TexCoord.R, planes.getCol(2));
-        setTextureEyePlane(tex, TexCoord.Q, planes.getCol(3));
+        setTextureEyePlane(tex, TexCoord.S, planes.getRow(0));
+        setTextureEyePlane(tex, TexCoord.T, planes.getRow(1));
+        setTextureEyePlane(tex, TexCoord.R, planes.getRow(2));
+        setTextureEyePlane(tex, TexCoord.Q, planes.getRow(3));
     }
 
     /**
 
     @Override
     public void setTextureObjectPlanes(int tex, @Const Matrix4 planes) {
-        setTextureObjectPlane(tex, TexCoord.S, planes.getCol(0));
-        setTextureObjectPlane(tex, TexCoord.T, planes.getCol(1));
-        setTextureObjectPlane(tex, TexCoord.R, planes.getCol(2));
-        setTextureObjectPlane(tex, TexCoord.Q, planes.getCol(3));
+        setTextureObjectPlane(tex, TexCoord.S, planes.getRow(0));
+        setTextureObjectPlane(tex, TexCoord.T, planes.getRow(1));
+        setTextureObjectPlane(tex, TexCoord.R, planes.getRow(2));
+        setTextureObjectPlane(tex, TexCoord.Q, planes.getRow(3));
     }
 
     /**

ferox-renderer/src/main/java/com/ferox/renderer/impl/AbstractTextureSurface.java

         for (int i = 0; i < array.length; i++) {
             array[i] = options.getColorBuffer(i);
         }
-        setRenderTargets(array, options.getDepthBuffer());
+        setRenderTargetsInternal(array, options.getDepthBuffer());
     }
 
     @Override
      * @throws IllegalArgumentException if the targets are misconfigured for the surface
      */
     public void setRenderTargets(Sampler.RenderTarget[] colorTargets, Sampler.RenderTarget depthTarget) {
+        setRenderTargetsInternal(colorTargets, depthTarget);
+    }
+
+    private void setRenderTargetsInternal(Sampler.RenderTarget[] colorTargets,
+                                          Sampler.RenderTarget depthTarget) {
         // first validate new targets, before delegating to the subclass to perform the OpenGL
         // operations necessary
         if (depthRenderBuffer != null && depthTarget != null) {

ferox-scene/src/main/java/com/ferox/scene/AmbientLight.java

      *
      * @return This light for chaining purposes
      */
-    public Light setColor(@Const ColorRGB color);