Examples of addController()


Examples of com.ardor3d.scenegraph.shape.Box.addController()

        // Add to root.
        _root.attachChild(box);

        // set it to rotate:
        box.addController(new SpatialController<Spatial>() {
            private final Vector3 _axis = new Vector3(1, 1, 0.5f).normalizeLocal();
            private final Matrix3 _rotate = new Matrix3();
            private double _angle = 0;

            public void update(final double time, final Spatial caller) {
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Box.addController()

        // Add a spinning 3D box to show behind UI.
        final Box box = new Box("Box", new Vector3(0, 0, 0), 5, 5, 5);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, 0, -15));
        box.addController(new SpatialController<Box>() {
            private final Matrix3 rotate = new Matrix3();
            private double angle = 0;
            private final Vector3 axis = new Vector3(1, 1, 0.5f).normalizeLocal();

            public void update(final double time, final Box caller) {
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Box.addController()

     */
    private void setupTerrain() {
        final Box box = new Box("box", new Vector3(), 10000, 10, 10000);
        box.setModelBound(new BoundingBox());

        box.addController(new SpatialController<Box>() {
            double timer = 0;

            public void update(final double time, final Box caller) {
                timer += time;
                caller.setTranslation(Math.sin(timer) * 20.0, 0, Math.cos(timer) * 20.0);
 
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Pyramid.addController()

        sp.setRenderState(ts);

        // add some scenery
        final Pyramid b = new Pyramid("box", 2, 3);
        b.setRotation(new Quaternion().fromAngleNormalAxis(MathUtils.PI, Vector3.UNIT_X));
        b.addController(new SpatialController<Spatial>() {
            public void update(final double time, final Spatial caller) {
                b.setTranslation(-3, 6 * MathUtils.sin(_timer.getTimeInSeconds()), 0);
            };
        });
        _root.attachChild(b);
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Sphere.addController()

        // Create a new sphere that rotates
        final Sphere sphere = new Sphere("Sphere", new Vector3(0, 0, 0), 32, 32, 5);
        sphere.setModelBound(new BoundingBox());
        sphere.setTranslation(new Vector3(0, 0, -15));
        sphere.addController(new SpatialController<Spatial>() {
            private final Vector3 _axis = new Vector3(1, 1, 0.5f).normalizeLocal();
            private final Matrix3 _rotate = new Matrix3();
            private double _angle = 0;

            public void update(final double time, final Spatial caller) {
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Sphere.addController()

        pointLight.setDiffuse(lightColor);
        pointLight.setAmbient(new ColorRGBA(.1f, .1f, .1f, .1f));

        _lightState.attach(pointLight);

        lightSphere.addController(new SpatialController<Spatial>() {

            double timeX = rand.nextDouble() * Math.PI * 8;
            double timeY = rand.nextDouble() * Math.PI * 8;
            double timeZ = rand.nextDouble() * Math.PI * 8;
            double speed = MathUtils.nextRandomDouble();
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Torus.addController()

        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 50, 50, 8, 17);
        torus.setTranslation(new Vector3(50, -5, 20));
        TextureState ts = new TextureState();
        torus.addController(new SpatialController<Torus>() {
            private double timer = 0;
            private final Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time * 0.5;
 
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Torus.addController()

        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 30, 20, 8, 17);
        torus.setTranslation(new Vector3(50, -5, 20));
        TextureState ts = new TextureState();
        torus.addController(new SpatialController<Torus>() {
            private double timer = 0;
            private final Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time * 0.5;
 
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Torus.addController()

        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 50, 50, 8, 17);
        torus.setTranslation(new Vector3(50, -5, 20));
        TextureState ts = new TextureState();
        torus.addController(new SpatialController<Torus>() {
            private double timer = 0;
            private final Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time * 0.5;
 
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Torus.addController()

        occluders.attachChild(torusWithoutShadows);

        final Torus torus = new Torus("torus", 64, 12, 10.0f, 15.0f);
        torus.setModelBound(new BoundingBox());
        occluders.attachChild(torus);
        torus.addController(new SpatialController<Torus>() {
            double timer = 0;
            Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.