Closed qq1053831109 closed 3 years ago
i need this in joml: /**
@return true if the ray collides with the given Plane */ public boolean intersectsWherePlane(Plane p, Vector3f loc) { float denominator = p.getNormal().dot(direction);
if (denominator > -FastMath.FLT_EPSILON && denominator < FastMath.FLT_EPSILON) {
return false; // coplanar
}
float numerator = -(p.getNormal().dot(origin) - p.getConstant());
float ratio = numerator / denominator;
if (ratio < FastMath.FLT_EPSILON) {
return false; // intersects behind origin
}
loc.set(direction).multLocal(ratio).addLocal(origin);
return true;
}
this is ray
how can use ray intersect plane?