java.lang.Object
com.marginallyclever.convenience.Plane
Plane and intersection functions. A plane is defined by a point and a normal.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublejavax.vecmath.Vector3djavax.vecmath.Tuple3dgetPoint()booleandoubleintersectDistance(Ray ray) finds the intersection of a ray and this plane.booleanintersects(javax.vecmath.Point3d point) booleanintersects(javax.vecmath.Point3d point, double epsilon) voidset 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
-
getNormal
public javax.vecmath.Vector3d getNormal() -
getDistance
public double getDistance() -
getPoint
public javax.vecmath.Tuple3d getPoint()
-