use of gaiasky.scenegraph.SceneGraphNode in project gaiasky by langurmonkey.
the class AbstractOctreeWrapper method updateLocal.
public void updateLocal(ITimeFrameProvider time, ICamera camera) {
super.updateLocal(time, camera);
// Fade node visibility applies here
if (this.isVisible()) {
// Update octants
if (!copy) {
// Compute observed octants and fill roulette list
OctreeNode.nOctantsObserved = 0;
OctreeNode.nObjectsObserved = 0;
root.update(translation, camera, roulette, opacity);
if (OctreeNode.nObjectsObserved != lastNumberObjects) {
// Need to update the points in renderer
EventManager.publish(Event.STAR_POINT_UPDATE_FLAG, this, true);
lastNumberObjects = OctreeNode.nObjectsObserved;
}
// Call the update method of all entities in the roulette list. This
// is implemented in the subclass.
updateOctreeObjects(time, translation, camera);
addToRenderLists(camera, root);
// Reset mask
roulette.clear();
// Update focus, just in case
IFocus focus = camera.getFocus();
if (focus != null) {
SceneGraphNode star = focus.getFirstStarAncestor();
OctreeNode parent = parenthood.get(star);
if (parent != null && !parent.isObserved()) {
star.update(time, star.parent.translation, camera);
}
}
} else {
// Just update children
for (SceneGraphNode node : children) {
node.update(time, translation, camera);
}
}
}
}
use of gaiasky.scenegraph.SceneGraphNode in project gaiasky by langurmonkey.
the class AbstractOctreeWrapper method highlight.
@Override
public void highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible) {
super.highlight(hl, cmi, cma, cmmin, cmmax, allVisible);
Array<SceneGraphNode> l = new Array<>();
getChildrenByType(StarGroup.class, l);
for (SceneGraphNode n : l) {
((StarGroup) n).highlight(hl, cmi, cma, cmmin, cmmax, allVisible);
}
}
use of gaiasky.scenegraph.SceneGraphNode in project gaiasky by langurmonkey.
the class AbstractOctreeWrapper method highlight.
@Override
public void highlight(boolean hl, float[] color, boolean allVisible) {
super.highlight(hl, color, allVisible);
Array<SceneGraphNode> l = new Array<>();
getChildrenByType(StarGroup.class, l);
for (SceneGraphNode n : l) {
((StarGroup) n).highlight(hl, color, allVisible);
}
}
use of gaiasky.scenegraph.SceneGraphNode in project gaiasky by langurmonkey.
the class OctreeWrapper method updateOctreeObjects.
@Override
protected void updateOctreeObjects(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera) {
int size = roulette.size();
for (int i = 0; i < size; i++) {
SceneGraphNode sgn = roulette.get(i);
sgn.update(time, parentTransform, camera, this.opacity * sgn.octant.opacity);
}
}
use of gaiasky.scenegraph.SceneGraphNode in project gaiasky by langurmonkey.
the class AbstractOrbitCoordinates method doneLoading.
@Override
public void doneLoading(Object... params) {
if (params.length == 0) {
logger.error(new RuntimeException("OrbitLintCoordinates need the scene graph"));
} else {
if (orbitname != null && !orbitname.isEmpty()) {
SceneGraphNode sgn = ((ISceneGraph) params[0]).getNode(orbitname);
orbit = (Orbit) sgn;
if (params[1] instanceof CelestialBody)
orbit.setBody((CelestialBody) params[1]);
}
}
}
Aggregations