Package org.vrspace.server.core
Class Scene
java.lang.Object
org.vrspace.server.core.Scene
This keeps track of objects visible to the Client. This scene uses
 coordinates to determine which objects are in range. Scene is updated when
 client moves more than resolution meters, or when timeout occurs.
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScene()Scene(WorldManager world, Client client) Creates new Scene for Client client - 
Method Summary
Modifier and TypeMethodDescriptionvoiddirty()Ensure the scene will be updated on next update() call.Retrieve an object in the scenegetClosest(double x, double y, double z) Returns the closest Transform to the specified pointprotected booleanTest Transform against set of filters.voidvoidlogout()Logout this client - notifies all clients in the range that it has logged out.voidNotification that a client has logged out - removes it from the scene and sends Remove message.voidoffer(Collection<VRObject> objects) Offer object(s) to the scene.voidOffer an object to the scene.voidPublish an object - notify all clients in rangevoidpublishAll(Collection<VRObject> objects) Offer some object(s) to scenes of all listeners.voidRemove all objects from the scene, and stop listening to changes.voidremoveFilter(String name) intsize()voidunpublish(Collection<VRObject> objects) Remove objects from all scenes and notify all clients they are removed.voidUnpublish an object: remove it from own scene, and scenes of all clients in the scene.voidupdate()Update the scene current client's coordinates. 
- 
Field Details
- 
permanents
 - 
props
 
 - 
 - 
Constructor Details
- 
Scene
protected Scene() - 
Scene
Creates new Scene for Client client 
 - 
 - 
Method Details
- 
size
public int size() - 
loadPermanents
public void loadPermanents() - 
update
public void update()Update the scene current client's coordinates. - 
offer
Offer an object to the scene. Accepted new objects in range and visible (passing all filters). Objects without positions, or with zero positions are also accepted, so that new objects become immediately visible. If accepted, sends Add command to the client.- Parameters:
 o-
 - 
offer
Offer object(s) to the scene. Sends out only one Add command with accepted objects.- Parameters:
 objects-- See Also:
 
 - 
publishAll
Offer some object(s) to scenes of all listeners. E.g. a new object just added to the space, or client just logged in (starting the session), or entering a new space.- Parameters:
 objects-- See Also:
 
 - 
publish
Publish an object - notify all clients in range- Parameters:
 obj-- See Also:
 
 - 
unpublish
Remove objects from all scenes and notify all clients they are removed.- Parameters:
 objects-
 - 
unpublish
Unpublish an object: remove it from own scene, and scenes of all clients in the scene. WorldManager deletes all temporary owned objects when guest client exits, but they also need to be removed from all scenes.- Parameters:
 obj-
 - 
logout
Notification that a client has logged out - removes it from the scene and sends Remove message.- Parameters:
 c-
 - 
logout
public void logout()Logout this client - notifies all clients in the range that it has logged out.- See Also:
 
 - 
dirty
Ensure the scene will be updated on next update() call. - 
removeAll
public void removeAll()Remove all objects from the scene, and stop listening to changes. Next call to update() will reestablish the event model, and may cause sending removal messages to the client. Also stops listening to changes of permanent objects - 
isVisible
Test Transform against set of filters. Client's transform don't pass the test. - 
get
Retrieve an object in the scene - 
getClosest
Returns the closest Transform to the specified point- Throws:
 NoSuchElementException- if scene is empty
 - 
addFilter
 - 
removeFilter
 
 -