本文整理汇总了Java中com.jme3.renderer.Camera.getFrustumNear方法的典型用法代码示例。如果您正苦于以下问题:Java Camera.getFrustumNear方法的具体用法?Java Camera.getFrustumNear怎么用?Java Camera.getFrustumNear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.renderer.Camera
的用法示例。
在下文中一共展示了Camera.getFrustumNear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFrustumPoints2
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
/**
* Updates a points arrays with the frustum corners of the provided camera.
* @param viewCam
* @param points
*/
public static void updateFrustumPoints2(Camera viewCam, Vector3f[] points) {
int w = viewCam.getWidth();
int h = viewCam.getHeight();
float n = viewCam.getFrustumNear();
float f = viewCam.getFrustumFar();
points[0].set(viewCam.getWorldCoordinates(new Vector2f(0, 0), n));
points[1].set(viewCam.getWorldCoordinates(new Vector2f(0, h), n));
points[2].set(viewCam.getWorldCoordinates(new Vector2f(w, h), n));
points[3].set(viewCam.getWorldCoordinates(new Vector2f(w, 0), n));
points[4].set(viewCam.getWorldCoordinates(new Vector2f(0, 0), f));
points[5].set(viewCam.getWorldCoordinates(new Vector2f(0, h), f));
points[6].set(viewCam.getWorldCoordinates(new Vector2f(w, h), f));
points[7].set(viewCam.getWorldCoordinates(new Vector2f(w, 0), f));
}
示例2: getCameraConstant
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
/**
* This computes the "C" value in the geomipmapping paper.
* See section "2.3.1.2 Pre-calculating d"
*
* @param cam
* @param pixelLimit
* @return
*/
private float getCameraConstant(Camera cam, float pixelLimit){
float n = cam.getFrustumNear();
float t = FastMath.abs(cam.getFrustumTop());
float A = n / t;
float v_res = cam.getHeight();
float T = (2f * pixelLimit) / v_res;
return A / T;
}