|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vrspace.server.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.
It also has some basic filtering capabilities - not tested.
Constructor Summary | |
Scene(Client client)
Creates new Scene for Client client |
Method Summary | |
void |
addFilter(ObjectFilter filter)
Add TransformFilter or VRObjectFilter |
void |
addTransform(Transform t)
Add Transform and it's members to the scene. |
void |
clear()
Clears the scene |
boolean |
contains(java.lang.Object o)
Does the scene contain o? |
boolean |
contains(Transform t)
True if the transform is permanent or is non-permanent and in the members list. |
VRObject[] |
get(java.lang.Class cl)
Returns all class instances within the scene |
Transform[] |
get(double x,
double y,
double z,
double range)
Returns transforms within the range Does not return permanent objects TODO: check bounding boxes |
VRObject |
get(java.lang.String className,
long id)
Retreives a VRObject from the scene or null if it's not in the scene. TODO: implement! |
Transform[] |
getAll()
Retreive all the Transforms in the scene |
VRObject |
getClosest(double x,
double y,
double z,
java.lang.Class cl,
boolean exact)
Returns the closest object of some class to the specified point |
Transform |
getClosestTransform(double x,
double y,
double z)
Returns the closest Transform to the specified point |
double |
getRange()
returns scene range (meters) |
int |
getSize()
return the scene size |
void |
init()
Initialize the scene. |
void |
remove(Transform t)
Removes an object from the scene. |
void |
remove(Transform t,
boolean removeReference)
|
void |
remove(VRObject obj)
Removes an object from the scene. |
void |
removeAll()
Remove all objects from the scene. |
void |
removeFilter(ObjectFilter filter)
Remove a TransformFilter/VRObjectFilter |
void |
setDirty()
Ensure the scene will be updated on next update() call. |
void |
setRange(double range)
set scene size, in meters |
void |
setResolution(double resolution)
set scene update resolution, in meters |
void |
setSize(int size)
set scene size, in number of transforms |
void |
setTimeout(long timeout)
set scene timeout, in milliseconds |
protected VRObject |
testObject(VRObject o)
Test an object against set of filters. |
protected boolean |
testTransform(Transform t)
Test Transform against set of filters. |
void |
update()
Update the scene with old coordinates. |
void |
update(boolean forceUpdate)
Update the scene with old coordinates. |
void |
update(double x,
double y,
double z)
Update the scene with coordinates xyz |
void |
update(double x,
double y,
double z,
boolean forceUpdate)
Update the scene with coordinates xyz |
void |
update(Transform t)
Update the scene with coordinates of t |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Scene(Client client)
Method Detail |
public void init()
clear()
public void addTransform(Transform t) throws java.lang.Exception
java.lang.Exception
public VRObject get(java.lang.String className, long id) throws java.lang.Exception
java.lang.Exception
public VRObject getClosest(double x, double y, double z, java.lang.Class cl, boolean exact)
exact
- true - return specified class only, false - return subclasses topublic Transform getClosestTransform(double x, double y, double z)
public VRObject[] get(java.lang.Class cl)
public Transform[] get(double x, double y, double z, double range)
public void update() throws java.lang.Exception
java.lang.Exception
public void update(boolean forceUpdate) throws java.lang.Exception
java.lang.Exception
public void update(Transform t) throws java.lang.Exception
java.lang.Exception
public void update(double x, double y, double z) throws java.lang.Exception
java.lang.Exception
public void update(double x, double y, double z, boolean forceUpdate) throws java.lang.Exception
java.lang.Exception
public void setDirty()
public Transform[] getAll()
Transform
public void remove(VRObject obj) throws java.lang.Exception
java.lang.Exception
public void remove(Transform t) throws java.lang.Exception
java.lang.Exception
public void remove(Transform t, boolean removeReference) throws java.lang.Exception
java.lang.Exception
public boolean contains(Transform t)
public void removeAll()
public void clear()
public boolean contains(java.lang.Object o)
public void setRange(double range)
public double getRange()
public void setSize(int size)
public int getSize()
public void setResolution(double resolution)
public void setTimeout(long timeout)
public void addFilter(ObjectFilter filter)
TransformFilter
,
VRObjectFilter
public void removeFilter(ObjectFilter filter)
TransformFilter
,
VRObjectFilter
protected boolean testTransform(Transform t)
TransformFilter
protected VRObject testObject(VRObject o)
VRObjectFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |