Package javax.media.j3d

Examples of javax.media.j3d.Node


/*      */
/*  582 */     if (this.pickedSceneGraphPath == null) {
/*  583 */       return null;
/*      */     }
/*  585 */     for (int j = this.pickedSceneGraphPath.nodeCount() - 1; j >= 0; j--) {
/*  586 */       Node pNode = this.pickedSceneGraphPath.getNode(j);
/*  587 */       if (debug) System.out.println("looking at node " + pNode);
/*      */
/*  589 */       if (((pNode instanceof Primitive)) && ((flags & 0x4) != 0))
/*      */       {
/*  591 */         if (debug) System.out.println("Primitive found");
View Full Code Here


/*  742 */     return npr;
/*      */   }
/*      */
/*      */   private PickResult pickGeomAny(PickShape pickShape)
/*      */   {
/*  747 */     Node obj = null;
/*      */
/*  749 */     SceneGraphPath[] sgpa = null;
/*      */
/*  751 */     if (this.pickRootBG != null)
/*  752 */       sgpa = this.pickRootBG.pickAll(pickShape);
View Full Code Here

/*      */     }
/*  930 */     return pr[0];
/*      */   }
/*      */
/*      */   private PickResult pickGeomAnyIntersect(PickShape pickShape) {
/*  934 */     Node obj = null;
/*      */
/*  936 */     SceneGraphPath[] sgpa = null;
/*      */
/*  938 */     if (this.pickRootBG != null)
/*  939 */       sgpa = this.pickRootBG.pickAll(pickShape);
View Full Code Here

/* 484 */       return null;
/*     */     }
/* 486 */     boolean[] found = new boolean[this.sceneGraphPathArr.length];
/*     */
/* 488 */     for (int i = 0; i < this.sceneGraphPathArr.length; i++) {
/* 489 */       Node obj = this.sceneGraphPathArr[i].getObject();
/* 490 */       if ((obj instanceof Shape3D)) {
/* 491 */         found[i] = ((Shape3D)obj).intersect(this.sceneGraphPathArr[i], this.pickRay);
/*     */       }
/* 493 */       else if ((obj instanceof Morph)) {
/* 494 */         found[i] = ((Morph)obj).intersect(this.sceneGraphPathArr[i], this.pickRay);
View Full Code Here

/*     */     }
/* 530 */     boolean[] found = new boolean[this.sceneGraphPathArr.length];
/* 531 */     double[] distArr = new double[this.sceneGraphPathArr.length];
/*     */
/* 533 */     for (int i = 0; i < this.sceneGraphPathArr.length; i++) {
/* 534 */       Node obj = this.sceneGraphPathArr[i].getObject();
/* 535 */       if ((obj instanceof Shape3D)) {
/* 536 */         found[i] = ((Shape3D)obj).intersect(this.sceneGraphPathArr[i], this.pickRay, dist);
/*     */
/* 538 */         distArr[i] = dist[0];
/* 539 */       } else if ((obj instanceof Morph)) {
View Full Code Here

/*     */   private SceneGraphPath pickGeomAny(int xpos, int ypos)
/*     */   {
/* 582 */     this.pickRay = ((PickRay)generatePickRay(xpos, ypos));
/* 583 */     this.sceneGraphPathArr = this.pickRoot.pickAll(this.pickRay);
/* 584 */     for (int i = 0; i < this.sceneGraphPathArr.length; i++) {
/* 585 */       Node obj = this.sceneGraphPathArr[i].getObject();
/* 586 */       if ((obj instanceof Shape3D)) {
/* 587 */         if (((Shape3D)obj).intersect(this.sceneGraphPathArr[i], this.pickRay))
/* 588 */           return this.sceneGraphPathArr[i];
/* 589 */       } else if (((obj instanceof Morph)) &&
/* 590 */         (((Morph)obj).intersect(this.sceneGraphPathArr[i], this.pickRay))) {
View Full Code Here

/*     */   }
/*     */
/*     */   public Node pickNode(SceneGraphPath sgPath, int flags)
/*     */   {
/* 696 */     if (sgPath != null) {
/* 697 */       Node pickedNode = sgPath.getObject();
/*     */
/* 699 */       if (((pickedNode instanceof Shape3D)) && ((flags & 0x1) != 0))
/*     */       {
/* 701 */         return pickedNode;
/*     */       }
View Full Code Here

/*     */   public Node pickNode(SceneGraphPath sgPath, int flags, int occurrence)
/*     */   {
/* 771 */     int curCnt = 0;
/*     */
/* 773 */     if (sgPath != null) {
/* 774 */       Node pickedNode = sgPath.getObject();
/*     */
/* 778 */       if (((pickedNode instanceof Shape3D)) && ((flags & 0x1) != 0))
/*     */       {
/* 780 */         return pickedNode;
/* 781 */       }if (((pickedNode instanceof Morph)) && ((flags & 0x2) != 0))
View Full Code Here

        observerHelper = new ObservableTestHelper();
        attachLeaf3DIn3dStructure();
    }

    private void attachLeaf3DIn3dStructure() {
        Node leafNode = leaf.getTreeLeaf3D().getNode();
        bg = new BranchGroup();
        TransformGroup tg = new TransformGroup();
        bg.addChild(tg);
        tg.addChild(leafNode);
    }
View Full Code Here

        BasicTreeBranch3D branch3D = new BasicTreeBranch3D(mockUniverse3D, branch3DState, mockBranch);
        CompilerHelper.compile(branch3D.getGroup());
        assertEquals(nbParts, branch3D.getBranchParts().size());
        List<TreeBranchPart> parts = mockBranch.getParts();
        assertEquals(parts.get(parts.size() - 1).getBranchPart3D().getEndPoint(), branch3D.getEndPoint());
        Node firstChild = branch3D.getGroup().getChild(0);
        assertTrue(firstChild instanceof BranchGroup);
        BranchGroup branchGroup = (BranchGroup) firstChild;
        int nbPartsFound = 0;
        Structure3DHelper.assertExactlyOneTransformGroup(branchGroup);
        TransformGroup firstTransformGroup = (TransformGroup) branchGroup.getChild(0);
View Full Code Here

TOP

Related Classes of javax.media.j3d.Node

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.