- All Implemented Interfaces:
Volume
- Author:
- Ole Kniemeyer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanboxContainsBoundary(BoundingBox box, Tuple3d center, double radius, Variables temp) Returnstrueif the specifiedboxcontains (part of) the boundary surface of this volume.booleancomputeIntersections(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd) Computes intersections between the boundary surface of this object and the specifiedline.voidcomputeNormal(Intersection is, Vector3d normal) This method computes the unit normal vector of an intersectioniswhich has been computed previously by the invocation ofVolume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection)on this volume.voidcomputeTangents(Intersection is, Vector3d dpdu, Vector3d dpdv) This method computes the derivatives of the surface point (as function of the uv-coordinates, seeVolume.computeUV(de.grogra.vecmath.geom.Intersection, javax.vecmath.Vector2d)) with respect to u and v at the intersection point.voidcomputeUV(Intersection is, Vector2d uv) This method computes the uv-coordinates of an intersection pointiswhich has been computed previously by the invocation ofVolume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection)on this volume.booleanDetermines if the givenpointlies within this object.voidComputes the extent of this volume, i.e., an axis-aligned bounding box betweenminandmax.Methods inherited from class de.grogra.vecmath.geom.VolumeBase
addConvexIntersections, getId, operator$and, operator$com, operator$or, operator$sub, setId
-
Constructor Details
-
EmptyVolume
public EmptyVolume()
-
-
Method Details
-
computeIntersections
public boolean computeIntersections(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd) Description copied from interface:VolumeComputes intersections between the boundary surface of this object and the specifiedline. The intersections are added tolistin ascending order of distance (i.e., ofIntersection.parameter), where theparameterhas to lie betweenline.startandline.end. Implementations of this method must not clear or modify the existing intersections inlist.The parameter
whichhas to be one ofIntersection.ALL,Intersection.CLOSEST,Intersection.ANY. It determines if all intersections have to be added to the list, only the closest (minimal value ofIntersection.parameter), or an arbitrary of the set of all intersections. Only in case ofALL, the return value of this method is precise.If specific intersection points should be excluded from the list of computed intersections, they have to be specified in
excludeStartandexcludeEnd. The intersection point ofexcludeStarthas to be the starting point ofline, the intersection point ofexcludeEndhas to be the end point ofline. The exclusion of intersections is a useful feature for ray-tracing, e.g., when a ray is re-emitted at an intersection point in another direction.- Parameters:
line- a linewhich- one ofIntersection.ALL,Intersection.CLOSEST,Intersection.ANY, this determines which intersections have to be added tolistlist- the intersections are added to this listexcludeStart- intersection at start point which shall be excluded, ornullexcludeEnd- intersection at end point which shall be excluded, ornull- Returns:
trueiff the beginning of the line lies within the volume (i.e., if the line starts within the volume or enters the volume at the starting point); however note that the returned value is valid only ifwhich == Intersection.ALL
-
contains
Description copied from interface:VolumeDetermines if the givenpointlies within this object. Ifopenistrue, the interior of the volume is considered (the largest open set contained in the volume, i.e., excluding the boundary), otherwise the closure of the volume.- Parameters:
point- a point in global world coordinatesopen- consider open or closed set- Returns:
trueiffpointis an element of the set
-
getExtent
Description copied from interface:VolumeComputes the extent of this volume, i.e., an axis-aligned bounding box betweenminandmax.- Parameters:
min- minimum coordinates of bounding box are placed in heremax- maximum coordinates of bounding box are placed in heretemp- has to be provided by the invoker, may be used in implementations
-
boxContainsBoundary
Description copied from interface:VolumeReturnstrueif the specifiedboxcontains (part of) the boundary surface of this volume. Otherwise, if box and boundary do not overlap, this method should returnfalse, but may also returntrueif an exact computation would be too expensive or complicated.Note that a box contains the boundary of a closed set S iff both have a non-empty intersection and the box is not contained in the open set of S.
- Parameters:
box- bounding boxcenter- center coordinates of boxradius- radius of enclosing spheretemp- has to be provided by the invoker, may be used in implementations- Returns:
trueif box contains (part of) the boundary of this volume
-
computeNormal
Description copied from interface:VolumeThis method computes the unit normal vector of an intersectioniswhich has been computed previously by the invocation ofVolume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection)on this volume.- Parameters:
is- a previously computed intersectionnormal- resulting unit vector is placed in here
-
computeUV
Description copied from interface:VolumeThis method computes the uv-coordinates of an intersection pointiswhich has been computed previously by the invocation ofVolume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection)on this volume.- Parameters:
is- a previously computed intersectionuv- resulting uv-coordinates are placed in here
-
computeTangents
Description copied from interface:VolumeThis method computes the derivatives of the surface point (as function of the uv-coordinates, seeVolume.computeUV(de.grogra.vecmath.geom.Intersection, javax.vecmath.Vector2d)) with respect to u and v at the intersection point.- Parameters:
is- a previously computed intersectiondpdu- resulting derivative with respect to udpdv- resulting derivative with respect to v
-