|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectShape
Box
public class Box
Represents a 6-sided box.
A Box
is defined by a single point that represents the origin of the box
and three vectors defining the length, width, and height of the box.
Constructor Summary | |
---|---|
Box()
Constructs a unit cube at the origin. |
|
Box(javax.vecmath.Point3d origin,
javax.vecmath.Vector3d length,
javax.vecmath.Vector3d width,
javax.vecmath.Vector3d height,
SurfaceProperties surfaceProperties)
Constructs a box with the specified parameters. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a copy of the object. |
javax.vecmath.Vector3d |
getHeight()
Returns the height vector. |
javax.vecmath.Vector3d |
getLength()
Returns the length vector. |
javax.vecmath.Point3d |
getOrigin()
Returns the origin point. |
javax.vecmath.Vector3d |
getWidth()
Returns the width vector. |
void |
load(DataParser dataParser)
Loads data using the DataParser object. |
double |
nearestIntersectionTime(Ray3d ray)
Gets the nearest intersection time between the specified ray and the shape. |
void |
setHeight(javax.vecmath.Vector3d height)
Sets the height vector. |
void |
setLength(javax.vecmath.Vector3d length)
Sets the length vector. |
void |
setOrigin(javax.vecmath.Point3d origin)
Sets the origin point. |
void |
setWidth(javax.vecmath.Vector3d width)
Sets the width vector. |
javax.vecmath.Vector3d |
surfaceNormal(javax.vecmath.Point3d point)
Gets the surface normal at the specified point on the shape. |
Methods inherited from class Shape |
---|
getSurfaceProperties, setSurfaceProperties |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Box()
public Box(javax.vecmath.Point3d origin, javax.vecmath.Vector3d length, javax.vecmath.Vector3d width, javax.vecmath.Vector3d height, SurfaceProperties surfaceProperties)
origin
- The origin point.length
- The length vector.width
- The width vector.height
- The height vector.surfaceProperties
- The surface properties of the box.Method Detail |
---|
public java.lang.Object clone()
CloneableEx
clone
in interface CloneableEx
clone
in class Shape
public double nearestIntersectionTime(Ray3d ray)
Shape
nearestIntersectionTime
in class Shape
ray
- The ray to intersect with the shape.
public javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
Shape
surfaceNormal
in class Shape
point
- The point on the surface of the shape.
public void load(DataParser dataParser)
Persistent
DataParser
object.
A class overrides this function to load data that has been parsed.
load
in interface Persistent
load
in class Shape
dataParser
- The DataParser
to load data from.public void setOrigin(javax.vecmath.Point3d origin)
origin
- The origin to set.public javax.vecmath.Point3d getOrigin()
public void setLength(javax.vecmath.Vector3d length)
length
- The length to set.public javax.vecmath.Vector3d getLength()
public void setWidth(javax.vecmath.Vector3d width)
width
- The width to set.public javax.vecmath.Vector3d getWidth()
public void setHeight(javax.vecmath.Vector3d height)
height
- The height to set.public javax.vecmath.Vector3d getHeight()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |