protected Object clone(boolean forceDuplicate) { return super.clone(); }
/** * Get the localToVworld transform for a node */ void getLocalToVworld(Transform3D t, HashKey key) { HashKey newKey = new HashKey(key); computeLocalToVworld(this, this, newKey, t); }
/** * Sets the automatic calcuation of geometric bounds of a node. * @param autoCompute is a boolean value indicating if automatic calcuation * of bounds */ void setBoundsAutoCompute(boolean autoCompute) { if (this.boundsAutoCompute==autoCompute) { return; } this.boundsAutoCompute = autoCompute; dirtyBoundsCache(); }
void setPickable(boolean pickable) { if (this.pickable == pickable) return; this.pickable = pickable; if (source.isLive()) { synchronized(universe.sceneGraphLock) { boolean pick[]; if (!inSharedGroup) { pick = new boolean[1]; } else { pick = new boolean[localToVworldKeys.length]; } findPickableFlags(pick); updatePickable(localToVworldKeys, pick); } } }
void setCollidable(boolean collidable) { if (this.collidable == collidable) return; this.collidable = collidable; if (source.isLive()) { synchronized(universe.sceneGraphLock) { boolean collide[]; if (!inSharedGroup) { collide = new boolean[1]; } else { collide = new boolean[localToVworldKeys.length]; } findCollidableFlags(collide); updateCollidable(localToVworldKeys, collide); } } }
/** * Gets the bounding object of a node. * @return the node's bounding object */ @Override Bounds getBounds() { if ( boundsAutoCompute) { // Issue 514 : NPE in Wonderland : triggered in cached bounds computation if (validCachedBounds) { return (Bounds) cachedBounds.clone(); } // issue 544 Bounds boundingObject = null; if (VirtualUniverse.mc.useBoxForGroupBounds) { boundingObject = new BoundingBox((Bounds) null); } else { boundingObject = new BoundingSphere((Bounds)null); } for (int i = children.size() - 1; i >= 0; i--) { NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(boundingObject); } } return boundingObject; } return super.getBounds(); }
/** * Compute the LocalToVworld of this node even though it is not live. We * assume the graph is attached at the origin of a locale */ void computeNonLiveLocalToVworld(Transform3D t, Node caller) { NodeRetained n = getParent(); if (n==null) t.setIdentity(); else n.computeNonLiveLocalToVworld(t, caller); if (this instanceof TransformGroupRetained && this.source!=caller) { Transform3D trans = new Transform3D(); ((TransformGroupRetained)this).getTransform(trans); t.mul(trans); } }
computeLocalToVworld(caller, sgRetained.parents.get(i), key, l2Vw); return; NodeRetained nodeParentR = nodeR.getParent(); computeLocalToVworld(caller, nodeParentR, key, l2Vw);
((NodeRetained)this.retained).computeNonLiveLocalToVworld(t, this); ((NodeRetained)this.retained).getLocalToVworld(t);
NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(bounds); NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(bounds); NodeRetained child = children.get(whichChild); if (child != null) { child.computeCombineBounds(bounds); NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(cachedBounds); NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(cachedBounds); NodeRetained child = children.get(whichChild); if (child != null) { child.computeCombineBounds(cachedBounds);
@Override void setLive(SetLiveState s) { int oldrefCount = refCount; doSetLive(s); if (oldrefCount <= 0) super.markAsLive(); }
@Override void compile(CompileState compState) { super.compile(compState); mergeFlag = SceneGraphObjectRetained.MERGE; if (!isStatic()) { compState.keepTG = true; mergeFlag = SceneGraphObjectRetained.DONT_MERGE; } if (isRoot || this.usedInScoping() || (parent instanceof SwitchRetained)) { mergeFlag = SceneGraphObjectRetained.DONT_MERGE; } compiledChildrenList = new ArrayList<NodeRetained>(5); for (int i = 0; i < children.size(); i++) { NodeRetained node = children.get(i); if (node != null) { node.compile(compState); } } if (J3dDebug.devPhase && J3dDebug.debug) { compState.numGroups++; } }
NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(boundingObject); NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(boundingObject); child.computeCombineBounds(boundingObject);
void doSetLive(SetLiveState s) { int i, nchildren; super.doSetLive(s); locale = s.locale;
switchInterface = initSwitchStates(s, this, child, linkNode, false); child.clearLive(s);
NodeRetained child = children.get(i); if(child != null) child.computeCombineBounds(bounds); NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(cachedBounds);
/** * Get the localToVworld transform for a node. */ void getLocalToVworld(Transform3D t) { if (inSharedGroup) { throw new IllegalSharingException(J3dI18N.getString("NodeRetained0")); } // Lock the object while writing into t. if (localToVworld == null) { t.setIdentity(); } else { computeLocalToVworld(this, this, null, t); } }
/** * Make the boundsCache of this node and all its parents dirty */ void dirtyBoundsCache() { // Possible optimisation is to not traverse up the tree // if the cachedBounds==null. However this is not the case // if the node is the child of a SharedGroup if (VirtualUniverse.mc.cacheAutoComputedBounds) { // Issue 514 : NPE in Wonderland : triggered in cached bounds computation validCachedBounds = false; if (parent!=null) { parent.dirtyBoundsCache(); } } } }
NodeRetained child = children.get(i); if(child != null) child.computeCombineBounds(boundingObject);