private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
@Override public boolean intersectsBox(BoundingBox box, TempVars vars) { Vector3f axis1 = getScaledAxis(0, vars.vect1); Vector3f axis2 = getScaledAxis(1, vars.vect2); Vector3f axis3 = getScaledAxis(2, vars.vect3); Vector3f tn = vars.vect4; Plane p = vars.plane; Vector3f c = box.getCenter(); p.setNormal(0, 0, -1); p.setConstant(-(c.z + box.getZExtent())); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; p.setNormal(0, 0, 1); p.setConstant(c.z - box.getZExtent()); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; p.setNormal(0, -1, 0); p.setConstant(-(c.y + box.getYExtent())); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; p.setNormal(0, 1, 0); p.setConstant(c.y - box.getYExtent()); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; p.setNormal(-1, 0, 0); p.setConstant(-(c.x + box.getXExtent())); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; p.setNormal(1, 0, 0); p.setConstant(c.x - box.getXExtent()); if (!insidePlane(p, axis1, axis2, axis3, tn)) return false; return true; }
leftPlaneNormal.addLocal(direction.x * coeffLeft[1], direction.y * coeffLeft[1], direction.z * coeffLeft[1]); worldPlane[LEFT_PLANE].setConstant(location.dot(leftPlaneNormal)); rightPlaneNormal.addLocal(direction.x * coeffRight[1], direction.y * coeffRight[1], direction.z * coeffRight[1]); worldPlane[RIGHT_PLANE].setConstant(location.dot(rightPlaneNormal)); bottomPlaneNormal.addLocal(direction.x * coeffBottom[1], direction.y * coeffBottom[1], direction.z * coeffBottom[1]); worldPlane[BOTTOM_PLANE].setConstant(location.dot(bottomPlaneNormal)); topPlaneNormal.addLocal(direction.x * coeffTop[1], direction.y * coeffTop[1], direction.z * coeffTop[1]); worldPlane[TOP_PLANE].setConstant(location.dot(topPlaneNormal)); worldPlane[LEFT_PLANE].setConstant(worldPlane[LEFT_PLANE].getConstant() + frustumLeft); worldPlane[RIGHT_PLANE].setConstant(worldPlane[RIGHT_PLANE].getConstant() - frustumRight); worldPlane[TOP_PLANE].setConstant(worldPlane[TOP_PLANE].getConstant() - frustumTop); worldPlane[BOTTOM_PLANE].setConstant(worldPlane[BOTTOM_PLANE].getConstant() + frustumBottom); worldPlane[FAR_PLANE].setConstant(-(dirDotLocation + frustumFar)); worldPlane[NEAR_PLANE].setConstant(dirDotLocation + frustumNear);
for (int i = 0; i < MAX_WORLD_PLANES; ++i) { worldPlane[i].setNormal(cam.worldPlane[i].getNormal()); worldPlane[i].setConstant(cam.worldPlane[i].getConstant());
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
leftPlaneNormal.addLocal(direction.x * coeffLeft[1], direction.y * coeffLeft[1], direction.z * coeffLeft[1]); worldPlane[LEFT_PLANE].setConstant(location.dot(leftPlaneNormal)); rightPlaneNormal.addLocal(direction.x * coeffRight[1], direction.y * coeffRight[1], direction.z * coeffRight[1]); worldPlane[RIGHT_PLANE].setConstant(location.dot(rightPlaneNormal)); bottomPlaneNormal.addLocal(direction.x * coeffBottom[1], direction.y * coeffBottom[1], direction.z * coeffBottom[1]); worldPlane[BOTTOM_PLANE].setConstant(location.dot(bottomPlaneNormal)); topPlaneNormal.addLocal(direction.x * coeffTop[1], direction.y * coeffTop[1], direction.z * coeffTop[1]); worldPlane[TOP_PLANE].setConstant(location.dot(topPlaneNormal)); worldPlane[LEFT_PLANE].setConstant(worldPlane[LEFT_PLANE].getConstant() + frustumLeft); worldPlane[RIGHT_PLANE].setConstant(worldPlane[RIGHT_PLANE].getConstant() - frustumRight); worldPlane[TOP_PLANE].setConstant(worldPlane[TOP_PLANE].getConstant() - frustumTop); worldPlane[BOTTOM_PLANE].setConstant(worldPlane[BOTTOM_PLANE].getConstant() + frustumBottom); worldPlane[FAR_PLANE].setConstant(-(dirDotLocation + frustumFar)); worldPlane[NEAR_PLANE].setConstant(dirDotLocation + frustumNear);
leftPlaneNormal.addLocal(direction.x * coeffLeft[1], direction.y * coeffLeft[1], direction.z * coeffLeft[1]); worldPlane[LEFT_PLANE].setConstant(location.dot(leftPlaneNormal)); rightPlaneNormal.addLocal(direction.x * coeffRight[1], direction.y * coeffRight[1], direction.z * coeffRight[1]); worldPlane[RIGHT_PLANE].setConstant(location.dot(rightPlaneNormal)); bottomPlaneNormal.addLocal(direction.x * coeffBottom[1], direction.y * coeffBottom[1], direction.z * coeffBottom[1]); worldPlane[BOTTOM_PLANE].setConstant(location.dot(bottomPlaneNormal)); topPlaneNormal.addLocal(direction.x * coeffTop[1], direction.y * coeffTop[1], direction.z * coeffTop[1]); worldPlane[TOP_PLANE].setConstant(location.dot(topPlaneNormal)); worldPlane[LEFT_PLANE].setConstant(worldPlane[LEFT_PLANE].getConstant() + frustumLeft); worldPlane[RIGHT_PLANE].setConstant(worldPlane[RIGHT_PLANE].getConstant() - frustumRight); worldPlane[TOP_PLANE].setConstant(worldPlane[TOP_PLANE].getConstant() - frustumTop); worldPlane[BOTTOM_PLANE].setConstant(worldPlane[BOTTOM_PLANE].getConstant() + frustumBottom); worldPlane[FAR_PLANE].setConstant(-(dirDotLocation + frustumFar)); worldPlane[NEAR_PLANE].setConstant(dirDotLocation + frustumNear);
for (int i = 0; i < MAX_WORLD_PLANES; ++i) { worldPlane[i].setNormal(cam.worldPlane[i].getNormal()); worldPlane[i].setConstant(cam.worldPlane[i].getConstant());
for (int i = 0; i < MAX_WORLD_PLANES; ++i) { worldPlane[i].setNormal(cam.worldPlane[i].getNormal()); worldPlane[i].setConstant(cam.worldPlane[i].getConstant());