org.vrspace.server
Class Transform

java.lang.Object
  extended byjava.util.Observable
      extended byorg.vrspace.server.VRObject
          extended byorg.vrspace.server.DBObject
              extended byorg.vrspace.server.PublicDBObject
                  extended byorg.vrspace.server.OwnedDBObject
                      extended byorg.vrspace.server.Transform
All Implemented Interfaces:
java.lang.Cloneable, Owned

public class Transform
extends OwnedDBObject

Transform is basic object used to build the scene. This is a point in space containing other objects, and transformations applied to them. Concept taken from VRML97
NOTE: all fields are public, to enable the database storage. What are security implications?

See Also:
Scene

Field Summary
 boolean active
          Transform is active by default.
 double angle
           
 double[] bBoxCenter
          bounding box center.
 double[] bBoxSize
          object's max size, starting from the bBoxCenter
 ID[] members
          list of objects on this point in space
 java.lang.String name
          name
 boolean permanent
          hint to scene manager: permanent Transform members are always displayed.
 double rotx
           
 double roty
           
 double rotz
           
 double[] scale
           
 double x
           
 double y
           
 double z
           
 
Fields inherited from class org.vrspace.server.DBObject
db
 
Fields inherited from class org.vrspace.server.VRObject
db_id, primitiveMap, primitives
 
Constructor Summary
Transform()
           
Transform(double x, double y, double z)
          New transoform at x,y,z coordinates
 
Method Summary
 void addMember(VRObject obj)
          Adds obj to this Transform.
 VRObjectComparator comparator()
          Returns a comparator
 boolean contains(VRObject obj)
          True if obj is member of this Transform
 VRObject[] getChildren()
          returns all members of this transform
 double getDistance(double x, double y, double z)
          calculates distance to the specified point
 double getDistance(Transform t)
          calculates distance to the specified transform
 void removeMember(VRObject obj)
          Removes obj from this Transform.
 void set_bBoxCenter(double x, double y, double z)
          sets bounding box center
 void set_bBoxSize(double x, double y, double z)
          sets bounding box size
 void set_rotation(Request req, java.lang.String args)
           
 void set_scale(Request req, java.lang.String args)
           
 void set_translation(Request req, java.lang.String args)
           
 
Methods inherited from class org.vrspace.server.OwnedDBObject
addOwner, isOwned, notifyOwners, ownershipRequired, processEvent, removeOwner, sendEvent
 
Methods inherited from class org.vrspace.server.PublicDBObject
setValue
 
Methods inherited from class org.vrspace.server.DBObject
delete, get, put, put
 
Methods inherited from class org.vrspace.server.VRObject
arrayToString, canRead, canWrite, clone, equals, fieldToText, fromString, fromText, getClassName, getField, getFields, getId, getID, getMemebers, hasField, hasMethod, isNew, newInstance, sendResponse, setField, setField, setField, setFields, setFields, stringToArray, toString, toText, toText, toText
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
name


permanent

public boolean permanent
hint to scene manager: permanent Transform members are always displayed. Permanent by default.


active

public boolean active
Transform is active by default. Inactive Transforms are not added to the scene by scene manager


x

public double x

y

public double y

z

public double z

members

public ID[] members
list of objects on this point in space


rotx

public double rotx

roty

public double roty

rotz

public double rotz

angle

public double angle

scale

public double[] scale

bBoxCenter

public double[] bBoxCenter
bounding box center. Approximately object's center


bBoxSize

public double[] bBoxSize
object's max size, starting from the bBoxCenter

Constructor Detail

Transform

public Transform()

Transform

public Transform(double x,
                 double y,
                 double z)
New transoform at x,y,z coordinates

Method Detail

set_translation

public void set_translation(Request req,
                            java.lang.String args)
                     throws java.lang.Exception
Throws:
java.lang.Exception

set_rotation

public void set_rotation(Request req,
                         java.lang.String args)
                  throws java.lang.Exception
Throws:
java.lang.Exception

set_scale

public void set_scale(Request req,
                      java.lang.String args)
               throws java.lang.Exception
Throws:
java.lang.Exception

comparator

public VRObjectComparator comparator()
Returns a comparator

See Also:
TransformComparator

addMember

public void addMember(VRObject obj)
Adds obj to this Transform.


removeMember

public void removeMember(VRObject obj)
Removes obj from this Transform.


contains

public boolean contains(VRObject obj)
True if obj is member of this Transform


set_bBoxCenter

public void set_bBoxCenter(double x,
                           double y,
                           double z)
sets bounding box center


set_bBoxSize

public void set_bBoxSize(double x,
                         double y,
                         double z)
sets bounding box size


getChildren

public VRObject[] getChildren()
returns all members of this transform


getDistance

public double getDistance(double x,
                          double y,
                          double z)
calculates distance to the specified point


getDistance

public double getDistance(Transform t)
calculates distance to the specified transform