java.lang.Object
de.grogra.vecmath.geom.Line
This class represents the geometry of a line.
- Author:
- Ole Kniemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionSpecifies the direction of the line.float
The probability density of direction for this ray.double
The line ends atorigin + end * direction
.Origin of the line.float
The probability density of origin for this ray.boolean
The spectrum of the ray.double
The line starts atorigin + start * direction
.boolean
float
float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeepCopy()
double
Computes the distance betweenpoint
and this line.double
distanceSquared
(Tuple3d point) Computes the square of the distance betweenpoint
and this line.double
length()
Returns the length of this line.double
Returns the square of the length of this line.void
setLineAttributes
(double start, double end) toString()
-
Field Details
-
origin
Origin of the line. -
direction
Specifies the direction of the line. This vector is not necessarily normalized. -
start
public double startThe line starts atorigin + start * direction
. -
end
public double endThe line ends atorigin + end * direction
. The conditionstart <= end
has to be satisfied. -
directionDensity
public float directionDensityThe probability density of direction for this ray. This field is set byShader.generateRandomRays
andLight.generateRandomRays
. If pω+ is the probability density that has been used for generating the random ray direction (measured with respect to projected solid angle ω+, i.e., dω+ = cos θ dω), then this field is set to pω+(direction
). It is not defined for rays emanating from a directional light source. It may beFloat.POSITIVE_INFINITY
as a result ofShader.generateRandomRays
, namely for ideal specular reflection or transmission. -
originDensity
public float originDensityThe probability density of origin for this ray. This field is set byLight.generateRandomRays
. If px is the probability density that has been used for generating the random ray origin, then this field is set to px(origin
). It is not defined for rays emanating from a point light source. -
spectrum
The spectrum of the ray. Depending on context, this may represent the ray's spectral radiant power or other properties. -
reflected
public boolean reflected -
x
public float x -
y
public float y -
valid
public boolean valid
-
-
Constructor Details
-
Line
public Line() -
Line
-
-
Method Details
-
setLineAttributes
public void setLineAttributes(double start, double end) -
lengthSquared
public double lengthSquared()Returns the square of the length of this line.- Returns:
- squared length of this line
-
length
public double length()Returns the length of this line.- Returns:
- length of this line
-
distanceSquared
Computes the square of the distance betweenpoint
and this line. The distance is defined to be the distance betweenpoint
and the closest point of this line.- Parameters:
point
- a point- Returns:
- squared distance to
point
-
distance
Computes the distance betweenpoint
and this line. The distance is defined to be the distance betweenpoint
and the closest point of this line.- Parameters:
point
- a point- Returns:
- distance to
point
-
deepCopy
-
toString
-