Package javax.media.j3d

Examples of javax.media.j3d.Group


            throw new IllegalArgumentException("Null tree branch");
        }
        this.treeBranch = treeBranch;
        this.translationVector = state.getTranslationVector().toPointValue();
        BranchGroup parts = createParts();
        this.group = new Group();
        group.addChild(parts);
    }
View Full Code Here


        Point3d currentPartStartPoint = new Point3d(0, 0, 0);
        TransformGroup previousTransformGroup = new TransformGroup();
        branchGroup.addChild(previousTransformGroup);
        for (TreeBranchPart branchPart : treeBranch.getParts()) {
            TreeBranchPart3D branchPart3D = branchPart.getBranchPart3D();
            Group branchPartGroup = branchPart3D.getGroup();
            BranchGroup currentBranchGroup = new BranchGroup();
            Vector3d translationVector = new Vector3d(currentPartStartPoint);
            TransformGroup currentTransformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
            currentBranchGroup.addChild(currentTransformGroup);
            currentTransformGroup.addChild(branchPartGroup);
View Full Code Here

            throw new IllegalArgumentException("Null tree branch part");
        }
        this.state = state;
        this.endPoint = state.getEndPoint().toPointValue();
        this.branchPart = branchPart;
        this.group = new Group();
        group.setCapability(Group.ALLOW_CHILDREN_WRITE);
        group.setCapability(Group.ALLOW_CHILDREN_EXTEND);
        createFullTreeBranch(branchPart);
    }
View Full Code Here

    public void reset() {
        state = new Physics3DState();
        synchronizeCalled = 0;
        gravity3D = new MockGravity3D();
        group = new Group();
    }
View Full Code Here

    public void reset() {
        state = new Gravity3DState();
        synchronizeCalled = 0;
        fallingMobiles = new ArrayList<Mobile>();
        fallenMobiles = new ArrayList<Mobile>();
        group = new Group();
    }
View Full Code Here

    public void testTreeBranchPart3D() {
        BasicTreeBranchPart3D part3D = new BasicTreeBranchPart3D(mockUniverse3D, part3DState, mockBranchPart);
        CompilerHelper.compile(part3D.getGroup());
        assertEquals(nbLeaves, part3D.getLeaves().size());
        assertEquals(part3DState.getEndPoint().toPointValue(), part3D.getEndPoint());
        Group partGroup = part3D.getGroup();
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_WRITE));
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_EXTEND));
        int nbTimesNoLeafShapeIsFound = 0;
        int nbLeavesFound = 0;
        for (Enumeration enumeration = partGroup.getAllChildren(); enumeration.hasMoreElements();) {
            Object child = enumeration.nextElement();
            if (child instanceof BranchGroup) {
                nbLeavesFound++;
            } else {
                if (child instanceof Shape3D) {
View Full Code Here

/* 226 */         createSwitchBehavior(s);
/*     */       }
/* 228 */       this.geometryGroup = s;
/*     */     }
/*     */     else {
/* 231 */       this.geometryGroup = new Group();
/* 232 */       if (storedRefList.get(this.fileName) != null)
/*     */       {
/* 234 */         SharedGroup storedGroup = (SharedGroup)storedRefList.get(this.fileName);
/*     */
/* 236 */         Link newLink = new Link(storedGroup);
View Full Code Here

/* 445 */         SequenceReader sr = new SequenceReader(seqFilename, this.motion.totalTime, this.motion.totalFrames);
/*     */
/* 449 */         sr.printLines();
/* 450 */         sr.createJava3dObjects(this.debugPrinter.getValidOutput(), loadBehaviors);
/*     */
/* 452 */         Group g = sr.getObjectNode();
/* 453 */         if (g != null) {
/* 454 */           this.objectTransform.addChild(g);
/*     */         }
/*     */
/* 457 */         this.objectBehavior = sr.getObjectBehaviors();
View Full Code Here

/* 128 */     this.groupChildren = null;
/* 129 */     super.cleanup();
/*     */   }
/*     */
/*     */   protected SceneGraphObject createNode() {
/* 133 */     return new Group();
/*     */   }
View Full Code Here

                Vector3d expectedTranslationVector = new Vector3d(branchTranslationPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

                // test one branch found
                Structure3DHelper.assertExactlyOneGroup(transformGroup);
                Group specificGroupForTheBranch = (Group) transformGroup.getChild(0);
                assertNotNull(specificGroupForTheBranch);
                nbBranchesFound++;
            } else {
                if (child instanceof Group) {
                    nbTimesTrunkGroupIsFound++;
View Full Code Here

TOP

Related Classes of javax.media.j3d.Group

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.