Class VRObject

java.lang.Object
  |
  +--VRObject

public class VRObject
extends java.lang.Object


Field Summary
 double above_ratio
          Magic threshold for above ratio.
static javax.vecmath.Color3f BLUE
           
 javax.vecmath.Color3f current_color
           
protected  double current_scale
           
 double default_scale
           
static javax.vecmath.Color3f GREEN
           
 double large_scale
           
static javax.vecmath.Color3f RED
          Basic colors
 double small_scale
           
 
Constructor Summary
VRObject()
          Default constructor.
VRObject(java.lang.String filename)
          Constructor which takes a 3ds file for geometry Creates a branch group whose geometry is defined in a 3ds file.
VRObject(java.net.URL url)
          Constructor which takes a url of a scene file for geometry.
 
Method Summary
 boolean above(VRObject target)
          Determine if another VRObject is above this current object.
 boolean behind(VRObject target)
          Determine if another VRObject is behind this current object.
 boolean below(VRObject target)
          Determine if another VRObject is below this current object.
protected  void build_BG()
          Builds the BranchGroup from the model.
 javax.media.j3d.BoundingBox get_bounds()
          Get the bounding box around the model
 javax.media.j3d.BranchGroup get_branch()
          Get the branch group for this entire model.
 javax.media.j3d.BranchGroup getCloud()
          Creates a translucent box surrounding this VRObject
 boolean inFrontOf(VRObject target)
          Determine if another VRObject is inFrontOf this current object.
 boolean is_color(javax.vecmath.Color3f query_color)
          Query color of object.
 boolean is_large()
          Determine if the current model is large.
 boolean is_normal()
          Determine if the current model is normal scale.
 boolean is_small()
          Determin if the current model is small.
 boolean leftOf(VRObject target)
          Determine if another VRObject is left of this current object.
 boolean near(VRObject target)
          Determine if another VRObject is nearby this current object.
 boolean rightOf(VRObject target)
          Determine if another VRObject is right of this current object.
 void rotX(double angle)
          Rotate the model around the X axis.
 void rotY(double angle)
          Rotate the model around the Y axis.
 void rotZ(double angle)
          Rotate the model around the Z axis.
 void scale_large()
          Scale the model to be large.
 void scale_normal()
          Scale the model to default size.
 void scale_small()
          Scale the model to be small.
 void set_above(VRObject target)
          Place a VRObject above this current object.
 void set_behind(VRObject target)
          Place a VRObject behind this current object.
 void set_below(VRObject target)
          Place a VRObject below this current object.
 void set_color(javax.vecmath.Color3f color)
          Set the color of the model.
 void set_inFrontOf(VRObject target)
          Place a VRObject in front of this current object.
 void set_leftOf(VRObject target)
          Place a VRObject to the left of this current object.
 void set_near(VRObject target)
          Randomly places the target object within a cube that surrounds the reference object.
 void set_rightOf(VRObject target)
          Place a VRObject to the right of this current object.
 void set_scale(double scale)
          Scale the model.
 void trans_absolute(javax.vecmath.Vector3d vector)
          Tranlate model to absolute position.
 void trans_relative(javax.vecmath.Vector3d vector)
          Translate model relative to current position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

above_ratio

public double above_ratio
Magic threshold for above ratio.

default_scale

public double default_scale

large_scale

public double large_scale

small_scale

public double small_scale

current_scale

protected double current_scale

RED

public static final javax.vecmath.Color3f RED
Basic colors

GREEN

public static final javax.vecmath.Color3f GREEN

BLUE

public static final javax.vecmath.Color3f BLUE

current_color

public javax.vecmath.Color3f current_color
Constructor Detail

VRObject

public VRObject()
Default constructor. Will create a color cube as the object

VRObject

public VRObject(java.lang.String filename)
Constructor which takes a 3ds file for geometry Creates a branch group whose geometry is defined in a 3ds file.
Parameters:
filename - Name of the 3DS input file

VRObject

public VRObject(java.net.URL url)
Constructor which takes a url of a scene file for geometry.
Parameters:
url - Url of the input file.
Method Detail

build_BG

protected void build_BG()
Builds the BranchGroup from the model. Model must be set.

scale_large

public void scale_large()
Scale the model to be large.

scale_small

public void scale_small()
Scale the model to be small.

scale_normal

public void scale_normal()
Scale the model to default size.

is_large

public boolean is_large()
Determine if the current model is large.

is_small

public boolean is_small()
Determin if the current model is small.

is_normal

public boolean is_normal()
Determine if the current model is normal scale.

set_color

public void set_color(javax.vecmath.Color3f color)
Set the color of the model.
Parameters:
color - The color to set the model to.

is_color

public boolean is_color(javax.vecmath.Color3f query_color)
Query color of object.
Parameters:
query_color - The color to test against. Returns true if the current object is the color query_color.

set_scale

public void set_scale(double scale)
Scale the model.
Parameters:
scale - The new scale to be set for the model.

rotX

public void rotX(double angle)
Rotate the model around the X axis.
Parameters:
angle - Angle in radians.

rotY

public void rotY(double angle)
Rotate the model around the Y axis.
Parameters:
angle - Angle in radians.

rotZ

public void rotZ(double angle)
Rotate the model around the Z axis.
Parameters:
angle - Angle in radians.

get_bounds

public javax.media.j3d.BoundingBox get_bounds()
Get the bounding box around the model
Returns:
The bounding box.

get_branch

public javax.media.j3d.BranchGroup get_branch()
Get the branch group for this entire model.
Returns:
A reference to the branch group for this model.

trans_relative

public void trans_relative(javax.vecmath.Vector3d vector)
Translate model relative to current position.
Parameters:
vector - The tranlation vector.

trans_absolute

public void trans_absolute(javax.vecmath.Vector3d vector)
Tranlate model to absolute position.
Parameters:
vector - The absolute translation vector.

above

public boolean above(VRObject target)
Determine if another VRObject is above this current object. Note: Currently we are using world coordinates to determine this since we assume the viewer's position is static at the nominal view. This implemenation assumes that 'above' starts at the ceneter of the object.
Parameters:
target - The target VRObject which we wish to query.

below

public boolean below(VRObject target)
Determine if another VRObject is below this current object. Note: Currently we are using world coordinates to determine this since we assume the viewer's position is static at the nominal view. This implemenation assumes that 'above' starts at the ceneter of the object.
Parameters:
target - The target VRObject which we wish to query.

leftOf

public boolean leftOf(VRObject target)
Determine if another VRObject is left of this current object.
Parameters:
target - The target VRObject which we wish to query.

rightOf

public boolean rightOf(VRObject target)
Determine if another VRObject is right of this current object.
Parameters:
target - The target VRObject which we wish to query.

inFrontOf

public boolean inFrontOf(VRObject target)
Determine if another VRObject is inFrontOf this current object.
Parameters:
target - The target VRObject which we wish to query.

behind

public boolean behind(VRObject target)
Determine if another VRObject is behind this current object.
Parameters:
target - The target VRObject which we wish to query.

near

public boolean near(VRObject target)
Determine if another VRObject is nearby this current object.
Parameters:
target - The target VRObject which we wish to query.

set_above

public void set_above(VRObject target)
Place a VRObject above this current object. Note: Currently we are using world coordinates to determine this since we assume the viewer's position is static at the nominal view. This implemenation assumes that 'above' at the upper bounds of the current object.
Parameters:
target - The target VRObject to translate.

set_below

public void set_below(VRObject target)
Place a VRObject below this current object.
Parameters:
target - The target VRObject to translate.

set_leftOf

public void set_leftOf(VRObject target)
Place a VRObject to the left of this current object.
Parameters:
target - The target VRObject to translate.

set_rightOf

public void set_rightOf(VRObject target)
Place a VRObject to the right of this current object.
Parameters:
target - The target VRObject to translate.

set_inFrontOf

public void set_inFrontOf(VRObject target)
Place a VRObject in front of this current object.
Parameters:
target - The target VRObject to translate.

set_behind

public void set_behind(VRObject target)
Place a VRObject behind this current object.
Parameters:
target - The target VRObject to translate.

set_near

public void set_near(VRObject target)
Randomly places the target object within a cube that surrounds the reference object.
Parameters:
target - The target VRObject which we wish to move.

getCloud

public javax.media.j3d.BranchGroup getCloud()
Creates a translucent box surrounding this VRObject
Parameters:
none -  
Returns:
A BranchGroup containing the visible bounding box