Package gaiasky.util
Class MasterManager
java.lang.Object
gaiasky.util.MasterManager
- All Implemented Interfaces:
IObserver
public class MasterManager extends java.lang.Object implements IObserver
Manages a master instance which makes available state information to others
in order to synchronize a session.
-
Field Summary
Fields Modifier and Type Field Description static MasterManagerinstance -
Method Summary
Modifier and Type Method Description voidboardcastCamera(Vector3d pos, Vector3d dir, Vector3d up)Broadcasts the given camera state to all the slavesvoidboardcastCameraAndTime(Vector3d pos, Vector3d dir, Vector3d up, ITimeFrameProvider time)Broadcasts the given camera state and time to all the slavesintgetSlaveIndex(java.lang.String slaveName)java.util.List<java.lang.String>getSlaves()byte[]getSlaveStates()static booleanhasSlaves()static voidinitialize()booleanisSlaveConnected(int index)booleanisSlaveConnected(java.lang.String slaveName)voidnotify(Events event, java.lang.Object... data)voidsetSlaveFov(java.lang.String slave, float fov)voidsetSlavePitch(java.lang.String slave, float pitch)voidsetSlaveRoll(java.lang.String slave, float roll)voidsetSlaveYaw(java.lang.String slave, float yaw)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
instance
-
-
Method Details
-
initialize
public static void initialize() -
hasSlaves
public static boolean hasSlaves() -
isSlaveConnected
public boolean isSlaveConnected(java.lang.String slaveName) -
getSlaveIndex
public int getSlaveIndex(java.lang.String slaveName) -
isSlaveConnected
public boolean isSlaveConnected(int index) -
getSlaveStates
public byte[] getSlaveStates() -
boardcastCameraAndTime
public void boardcastCameraAndTime(Vector3d pos, Vector3d dir, Vector3d up, ITimeFrameProvider time)Broadcasts the given camera state and time to all the slaves- Parameters:
pos- Camera positiondir- Camera directionup- Camera uptime- Current time
-
boardcastCamera
Broadcasts the given camera state to all the slaves- Parameters:
pos- Camera positiondir- Camera directionup- Camera up
-
setSlaveYaw
public void setSlaveYaw(java.lang.String slave, float yaw) -
setSlavePitch
public void setSlavePitch(java.lang.String slave, float pitch) -
setSlaveRoll
public void setSlaveRoll(java.lang.String slave, float roll) -
setSlaveFov
public void setSlaveFov(java.lang.String slave, float fov) -
getSlaves
public java.util.List<java.lang.String> getSlaves() -
notify
-