Package barsuift.simLife.j3d

Examples of barsuift.simLife.j3d.Tuple3dState


        return state;
    }

    @Override
    public void synchronize() {
        state.setLeafAttachPoint(new Tuple3dState(leafAttachPoint));
        state.setInitialEndPoint1(new Tuple3dState(initialEndPoint1));
        state.setInitialEndPoint2(new Tuple3dState(initialEndPoint2));
        state.setEndPoint1(new Tuple3dState(endPoint1));
        state.setEndPoint2(new Tuple3dState(endPoint2));
        state.setRotation(rotation);
    }
View Full Code Here


     * <li>end point 2 : 10 * initial end point 2</li>
     * <li>rotation : a random number between 0 and 2 PI</li>
     * </ul>
     */
    public TreeLeaf3DState createRandomTreeLeaf3DState(Point3d leafAttachPoint) {
        Tuple3dState leafAttachPointState = new Tuple3dState(leafAttachPoint);
        Tuple3dState initialEndPoint1 = new Tuple3dState(-0.02 + Randomizer.random1() / 10, -0.04
                + Randomizer.random1() / 10, 0);
        Tuple3dState initialEndPoint2 = new Tuple3dState(0.02 + Randomizer.random1() / 10, -0.04 + Randomizer.random1()
                / 10, 0);
        Tuple3dState endPoint1 = new Tuple3dState(initialEndPoint1.getX() * 10, initialEndPoint1.getY() * 10,
                initialEndPoint1.getZ() * 10);
        Tuple3dState endPoint2 = new Tuple3dState(initialEndPoint2.getX() * 10, initialEndPoint2.getY() * 10,
                initialEndPoint2.getZ() * 10);
        double rotation = Randomizer.randomRotation();
        return new TreeLeaf3DState(leafAttachPointState, initialEndPoint1, initialEndPoint2, endPoint1, endPoint2,
                rotation);
    }
View Full Code Here

     * <li>end point 2 : initial end point 2</li>
     * <li>rotation : a random number between 0 and 2 PI</li>
     * </ul>
     */
    public TreeLeaf3DState createNewTreeLeaf3DState(Point3d leafAttachPoint) {
        Tuple3dState leafAttachPointState = new Tuple3dState(leafAttachPoint);

        double x1 = -0.02 + Randomizer.random1() / 10;
        double y1 = -0.04 + Randomizer.random1() / 10;
        int z1 = 0;
        Tuple3dState initialEndPoint1 = new Tuple3dState(x1, y1, z1);

        double x2 = 0.02 + Randomizer.random1() / 10;
        double y2 = -0.04 + Randomizer.random1() / 10;
        int z2 = 0;
        Tuple3dState initialEndPoint2 = new Tuple3dState(x2, y2, z2);

        Tuple3dState endPoint1 = new Tuple3dState(x1, y1, z1);
        Tuple3dState endPoint2 = new Tuple3dState(x2, y2, z2);

        double rotation = Randomizer.randomRotation();
        return new TreeLeaf3DState(leafAttachPointState, initialEndPoint1, initialEndPoint2, endPoint1, endPoint2,
                rotation);
    }
View Full Code Here

        return state;
    }

    @Override
    public void synchronize() {
        state.setTranslationVector(new Tuple3dState(translationVector));
    }
View Full Code Here

        return state;
    }

    @Override
    public void synchronize() {
        state.setEndPoint(new Tuple3dState(endPoint));
    }
View Full Code Here

import barsuift.simLife.j3d.Tuple3dState;

public class TreeBranch3DStateFactory {

    public TreeBranch3DState createRandomTreeBranch3DState(Vector3d translationVector) {
        Tuple3dState translationVectorState = new Tuple3dState(new Point3d(translationVector));
        return new TreeBranch3DState(translationVectorState);
    }
View Full Code Here

TOP

Related Classes of barsuift.simLife.j3d.Tuple3dState

Copyright © 2018 www.massapicom. 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.