Package barsuift.simLife.tree

Examples of barsuift.simLife.tree.TreeLeaf


    }

    @Override
    public void update(Observable observable, Object arg) {
        if (arg == LeafUpdateCode.efficiency) {
            TreeLeaf leaf = (TreeLeaf) observable;
            setColor(leaf.getEfficiency());
        }
        if (arg == LeafUpdateCode.fall) {
            fall();
        }
    }
View Full Code Here


    }

    @Override
    public void update(Publisher publisher, Object arg) {
        if (arg == LeafEvent.EFFICIENCY) {
            TreeLeaf leaf = (TreeLeaf) publisher;
            setColor(leaf.getEfficiency());
        }
        if (arg == MobileEvent.FALLING) {
            fall();
        }
    }
View Full Code Here

    }

    @Override
    public void update(Publisher publisher, Object arg) {
        if (arg == MobileEvent.FALLEN) {
            TreeLeaf leaf = (TreeLeaf) publisher;
            fallingLeaves.remove(leaf);
            gravity3D.isFallen(leaf.getTreeLeaf3D());
            universe.addFallenLeaf(leaf);
        }
    }
View Full Code Here

                transformGroup.getTransform(transform3D);
                Matrix3d rotationMatrix = new Matrix3d();
                Vector3d translationVector = new Vector3d();
                transform3D.get(rotationMatrix, translationVector);
                Matrix3d expectedRotationMatrix = new Matrix3d();
                TreeLeaf treeLeaf = mockBranchPart.getLeaves().get(nbLeavesFound);
                double rotation = treeLeaf.getTreeLeaf3D().getState().getRotation();
                expectedRotationMatrix.rotY(rotation);
                MatrixTestHelper.assertMatrixEquals(expectedRotationMatrix, rotationMatrix);
                Point3d leafAttachPoint = treeLeaf.getTreeLeaf3D().getState().getLeafAttachPoint().toPointValue();
                Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

                // test one leaf found
                Structure3DHelper.assertExactlyOneBranchGroup(transformGroup);
View Full Code Here

                transformGroup.getTransform(transform3D);
                Matrix3d rotationMatrix = new Matrix3d();
                Vector3d translationVector = new Vector3d();
                transform3D.get(rotationMatrix, translationVector);
                Matrix3d expectedRotationMatrix = new Matrix3d();
                TreeLeaf treeLeaf = mockBranchPart.getLeaves().get(nbLeavesFound);
                double rotation = treeLeaf.getTreeLeaf3D().getState().getRotation();
                expectedRotationMatrix.rotY(rotation);
                MatrixTestHelper.assertMatrixEquals(expectedRotationMatrix, rotationMatrix);
                Point3d leafAttachPoint = treeLeaf.getTreeLeaf3D().getState().getLeafAttachPoint().toPointValue();
                Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

                // test one leaf found
                Structure3DHelper.assertExactlyOneShape3D(transformGroup);
View Full Code Here

    }

    @Override
    public void update(Observable observable, Object arg) {
        if (LeafUpdateMask.isFieldSet((Integer) arg, LeafUpdateMask.EFFICIENCY_MASK)) {
            TreeLeaf leaf = (TreeLeaf) observable;
            setColor(leaf.getEfficiency());
        }
        if (LeafUpdateMask.isFieldSet((Integer) arg, LeafUpdateMask.FALL_MASK)) {
            fall();
        }
    }
View Full Code Here

TOP

Related Classes of barsuift.simLife.tree.TreeLeaf

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.