/** Constructs a new plane out of the three given points that are considered to be on the plane. The normal is calculated via a * cross product between (point1-point2)x(point2-point3) * * @param point1 The first point * @param point2 The second point * @param point3 The third point */ public Plane (Vector3 point1, Vector3 point2, Vector3 point3) { set(point1, point2, point3); }
/** Constructs a new plane out of the three given points that are considered to be on the plane. The normal is calculated via a * cross product between (point1-point2)x(point2-point3) * * @param point1 The first point * @param point2 The second point * @param point3 The third point */ public Plane (Vector3 point1, Vector3 point2, Vector3 point3) { set(point1, point2, point3); }
/** Updates the clipping plane's based on the given inverse combined projection and view matrix, e.g. from an * {@link OrthographicCamera} or {@link PerspectiveCamera}. * @param inverseProjectionView the combined projection and view matrices. */ public void update (Matrix4 inverseProjectionView) { System.arraycopy(clipSpacePlanePointsArray, 0, planePointsArray, 0, clipSpacePlanePointsArray.length); Matrix4.prj(inverseProjectionView.val, planePointsArray, 0, 8, 3); for (int i = 0, j = 0; i < 8; i++) { Vector3 v = planePoints[i]; v.x = planePointsArray[j++]; v.y = planePointsArray[j++]; v.z = planePointsArray[j++]; } planes[0].set(planePoints[1], planePoints[0], planePoints[2]); planes[1].set(planePoints[4], planePoints[5], planePoints[7]); planes[2].set(planePoints[0], planePoints[4], planePoints[3]); planes[3].set(planePoints[5], planePoints[1], planePoints[6]); planes[4].set(planePoints[2], planePoints[3], planePoints[6]); planes[5].set(planePoints[4], planePoints[0], planePoints[1]); }
/** Updates the clipping plane's based on the given inverse combined projection and view matrix, e.g. from an * {@link OrthographicCamera} or {@link PerspectiveCamera}. * @param inverseProjectionView the combined projection and view matrices. */ public void update (Matrix4 inverseProjectionView) { System.arraycopy(clipSpacePlanePointsArray, 0, planePointsArray, 0, clipSpacePlanePointsArray.length); Matrix4.prj(inverseProjectionView.val, planePointsArray, 0, 8, 3); for (int i = 0, j = 0; i < 8; i++) { Vector3 v = planePoints[i]; v.x = planePointsArray[j++]; v.y = planePointsArray[j++]; v.z = planePointsArray[j++]; } planes[0].set(planePoints[1], planePoints[0], planePoints[2]); planes[1].set(planePoints[4], planePoints[5], planePoints[7]); planes[2].set(planePoints[0], planePoints[4], planePoints[3]); planes[3].set(planePoints[5], planePoints[1], planePoints[6]); planes[4].set(planePoints[2], planePoints[3], planePoints[6]); planes[5].set(planePoints[4], planePoints[0], planePoints[1]); }
float det = edge1.dot(pvec); if (MathUtils.isZero(det)) { p.set(t1, t2, t3); if (p.testPoint(ray.origin) == PlaneSide.OnPlane && Intersector.isPointInTriangle(ray.origin, t1, t2, t3)) { if (intersection != null) intersection.set(ray.origin);
float det = edge1.dot(pvec); if (MathUtils.isZero(det)) { p.set(t1, t2, t3); if (p.testPoint(ray.origin) == PlaneSide.OnPlane && Intersector.isPointInTriangle(ray.origin, t1, t2, t3)) { if (intersection != null) intersection.set(ray.origin);
/** Constructs a new plane out of the three given points that are considered to be on the plane. The normal is calculated via a * cross product between (point1-point2)x(point2-point3) * * @param point1 The first point * @param point2 The second point * @param point3 The third point */ public Plane (Vector3 point1, Vector3 point2, Vector3 point3) { set(point1, point2, point3); }
/** Updates the clipping plane's based on the given inverse combined projection and view matrix, e.g. from an * {@link OrthographicCamera} or {@link PerspectiveCamera}. * @param inverseProjectionView the combined projection and view matrices. */ public void update (Matrix4 inverseProjectionView) { System.arraycopy(clipSpacePlanePointsArray, 0, planePointsArray, 0, clipSpacePlanePointsArray.length); Matrix4.prj(inverseProjectionView.val, planePointsArray, 0, 8, 3); for (int i = 0, j = 0; i < 8; i++) { Vector3 v = planePoints[i]; v.x = planePointsArray[j++]; v.y = planePointsArray[j++]; v.z = planePointsArray[j++]; } planes[0].set(planePoints[1], planePoints[0], planePoints[2]); planes[1].set(planePoints[4], planePoints[5], planePoints[7]); planes[2].set(planePoints[0], planePoints[4], planePoints[3]); planes[3].set(planePoints[5], planePoints[1], planePoints[6]); planes[4].set(planePoints[2], planePoints[3], planePoints[6]); planes[5].set(planePoints[4], planePoints[0], planePoints[1]); }
public void setLeftPlane(Vector3 pivot, Vector3 leftEdgeVertex) { leftPlane.set(pivot, tmp1.set(pivot).add(V3_UP), leftEdgeVertex); leftPortal.set(leftEdgeVertex); }
public void setRightPlane(Vector3 pivot, Vector3 rightEdgeVertex) { rightPlane.set(pivot, tmp1.set(pivot).add(V3_UP), rightEdgeVertex); rightPlane.normal.scl(-1); rightPlane.d = -rightPlane.d; rightPortal.set(rightEdgeVertex); }
return; crossingPlane.set(startPoint, tmp1.set(startPoint).add(V3_UP), endPoint);
float det = edge1.dot(pvec); if (MathUtils.isZero(det)) { p.set(t1, t2, t3); if (p.testPoint(ray.origin) == PlaneSide.OnPlane && Intersector.isPointInTriangle(ray.origin, t1, t2, t3)) { if (intersection != null) intersection.set(ray.origin);