java.lang.Object
com.marginallyclever.convenience.Plane
Plane and intersection functions. A plane is defined by a point and a normal.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
javax.vecmath.Vector3d
javax.vecmath.Tuple3d
getPoint()
boolean
double
intersectDistance
(Ray ray) finds the intersection of a ray and this plane.boolean
intersects
(javax.vecmath.Point3d point) boolean
intersects
(javax.vecmath.Point3d point, double epsilon) void
set this plane to the same values as arg0
-
Field Details
-
distance
public double distance -
normal
public javax.vecmath.Vector3d normal
-
-
Constructor Details
-
Plane
public Plane() -
Plane
public Plane(javax.vecmath.Tuple3d point, javax.vecmath.Vector3d normal) -
Plane
public Plane(javax.vecmath.Point3d p0, javax.vecmath.Point3d p1, javax.vecmath.Point3d p2) -
Plane
public Plane(javax.vecmath.Vector3d normal, double distance)
-
-
Method Details
-
intersects
public boolean intersects(javax.vecmath.Point3d point, double epsilon) - Parameters:
point
- the point to testepsilon
- how close to the plane is close enough- Returns:
- true if the point is on the plane
-
intersects
public boolean intersects(javax.vecmath.Point3d point) - Parameters:
point
- the point to test- Returns:
- true if the point is within 0.0001 of the plane.
-
intersectDistance
finds the intersection of a ray and this plane.- Parameters:
ray
- the ray to intersect.- Returns:
- the distance along the ray to the intersection point. NaN if no intersection.
-
intersect
-
set
set this plane to the same values as arg0- Parameters:
arg0
-
-
getNormal
public javax.vecmath.Vector3d getNormal() -
getDistance
public double getDistance() -
getPoint
public javax.vecmath.Tuple3d getPoint()
-