本文整理汇总了Java中com.jme3.renderer.Camera.FrustumIntersect方法的典型用法代码示例。如果您正苦于以下问题:Java Camera.FrustumIntersect方法的具体用法?Java Camera.FrustumIntersect怎么用?Java Camera.FrustumIntersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.renderer.Camera
的用法示例。
在下文中一共展示了Camera.FrustumIntersect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateRenderSet
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
public void generateRenderSet(Set<Geometry> renderSet, Camera cam){
// generateRenderSetNoCheck(renderSet, cam);
bbox.setCheckPlane(0);
cam.setPlaneState(0);
Camera.FrustumIntersect result = cam.contains(bbox);
if (result != Camera.FrustumIntersect.Outside){
if (geoms != null){
renderSet.addAll(Arrays.asList(geoms));
}
for (int i = 0; i < 8; i++){
if (children[i] != null){
if (result == Camera.FrustumIntersect.Inside){
children[i].generateRenderSetNoCheck(renderSet, cam);
}else{
children[i].generateRenderSet(renderSet, cam);
}
}
}
}
}
示例2: intersectCamera
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
/**
* 判断目标是否在摄像机视景体之内或者与视景体交叉
* @param spatial
* @return
*/
public static boolean intersectCamera(Spatial spatial) {
Camera cam = LuoYing.getApp().getCamera();
BoundingVolume bv = spatial.getWorldBound();
int checkPlane = bv.getCheckPlane();
bv.setCheckPlane(0);
Camera.FrustumIntersect interset = cam.contains(bv);
boolean result = interset != FrustumIntersect.Outside;
bv.setCheckPlane(checkPlane);
return result;
}
示例3: generateRenderSet
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
public void generateRenderSet(Geometry[] globalGeomList, Set<Geometry> renderSet, Camera cam, BoundingBox parentBox, boolean isRoot){
tempBox.setCenter(parentBox.getCenter());
tempBox.setXExtent(parentBox.getXExtent());
tempBox.setYExtent(parentBox.getYExtent());
tempBox.setZExtent(parentBox.getZExtent());
if (!isRoot){
findChildBound(tempBox, getSide());
}
tempBox.setCheckPlane(0);
cam.setPlaneState(0);
Camera.FrustumIntersect result = cam.contains(tempBox);
if (result != Camera.FrustumIntersect.Outside){
if (length != 0){
int start = getOffset();
int end = start + length;
for (int i = start; i < end; i++){
renderSet.add(globalGeomList[i]);
}
}
if (child == null)
return;
FastOctnode node = child;
float x = tempBox.getCenter().x;
float y = tempBox.getCenter().y;
float z = tempBox.getCenter().z;
float ext = tempBox.getXExtent();
while (node != null){
if (result == Camera.FrustumIntersect.Inside){
node.generateRenderSetNoCheck(globalGeomList, renderSet, cam);
}else{
node.generateRenderSet(globalGeomList, renderSet, cam, tempBox, false);
}
tempBox.getCenter().set(x,y,z);
tempBox.setXExtent(ext);
tempBox.setYExtent(ext);
tempBox.setZExtent(ext);
node = node.next;
}
}
}
示例4: getLastFrustumIntersection
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
/**
* Returns this spatial's last frustum intersection result. This int is set
* when a check is made to determine if the bounds of the object fall inside
* a camera's frustum. If a parent is found to fall outside the frustum, the
* value for this spatial will not be updated.
*
* @return The spatial's last frustum intersection result.
*/
public Camera.FrustumIntersect getLastFrustumIntersection() {
return frustrumIntersects;
}
示例5: setLastFrustumIntersection
import com.jme3.renderer.Camera; //导入方法依赖的package包/类
/**
* Overrides the last intersection result. This is useful for operations
* that want to start rendering at the middle of a scene tree and don't want
* the parent of that node to influence culling.
*
* @param intersects
* the new value
*/
public void setLastFrustumIntersection(Camera.FrustumIntersect intersects) {
frustrumIntersects = intersects;
}