@Override public void render(final Renderer renderer, final InteractManager manager) { final Spatial spat = manager.getSpatialTarget(); if (spat == null) { return; } _handle.setTranslation(spat.getWorldTranslation()); _handle.updateGeometricState(0); renderer.draw(_handle); }
@Override public void render(final Renderer renderer, final InteractManager manager) { final Spatial spat = manager.getSpatialTarget(); if (spat == null) { return; } _handle.setTranslation(spat.getWorldTranslation()); _handle.updateGeometricState(0); renderer.draw(_handle); }
@Override public void render(final Renderer renderer, final InteractManager manager) { final Spatial spat = manager.getSpatialTarget(); if (spat == null) { return; } _handle.setTranslation(spat.getWorldTranslation()); _handle.updateGeometricState(0); renderer.draw(_handle); }
@Override public void render(final Renderer renderer, final InteractManager manager) { final Spatial spat = manager.getSpatialTarget(); if (spat == null) { return; } _handle.setTranslation(spat.getWorldTranslation()); _handle.updateGeometricState(0); renderer.draw(_handle); }
@Override public void render(final Renderer renderer, final InteractManager manager) { final Spatial spat = manager.getSpatialTarget(); if (spat == null) { return; } _handle.setTranslation(spat.getWorldTranslation()); _handle.updateGeometricState(0); renderer.draw(_handle); }
protected double calculateHandleScale(final InteractManager manager) { final Spatial target = manager.getSpatialTarget(); if (target != null && target.getWorldBound() != null) { final BoundingVolume bound = target.getWorldBound(); final ReadOnlyVector3 trans = target.getWorldTranslation(); return Math.max(AbstractInteractWidget.MIN_SCALE, bound.getRadius() + trans.subtract(bound.getCenter(), _calcVec3A).length()); } return 1.0; }
/** * Calculates the distance from a spatial to the camera. Distance is a squared distance. * * @param spat * Spatial to check distance. * @return Distance from Spatial to current context's camera. */ protected double distanceToCam(final Spatial spat) { if (spat._queueDistance != Double.NEGATIVE_INFINITY) { return spat._queueDistance; } final Camera cam = Camera.getCurrentCamera(); if (spat.getWorldBound() != null && Vector3.isValid(spat.getWorldBound().getCenter())) { spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation()); } else { final ReadOnlyVector3 spatPosition = spat.getWorldTranslation(); if (!Vector3.isValid(spatPosition)) { spat._queueDistance = Double.POSITIVE_INFINITY; } else { spat._queueDistance = cam.getLocation().distance(spatPosition); } } return spat._queueDistance; }
/** * Calculates the distance from a spatial to the camera. Distance is a squared distance. * * @param spat * Spatial to check distance. * @return Distance from Spatial to current context's camera. */ protected double distanceToCam(final Spatial spat) { if (spat._queueDistance != Double.NEGATIVE_INFINITY) { return spat._queueDistance; } final Camera cam = Camera.getCurrentCamera(); if (spat.getWorldBound() != null && Vector3.isValid(spat.getWorldBound().getCenter())) { spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation()); } else { final ReadOnlyVector3 spatPosition = spat.getWorldTranslation(); if (!Vector3.isValid(spatPosition)) { spat._queueDistance = Double.POSITIVE_INFINITY; } else { spat._queueDistance = cam.getLocation().distance(spatPosition); } } return spat._queueDistance; }
rods.setScale(rSize); } else { rods.setTranslation(spat.getWorldTranslation()); rods.setScale(spat.getWorldScale());
rods.setScale(rSize); } else { rods.setTranslation(spat.getWorldTranslation()); rods.setScale(spat.getWorldScale());