Example usage for com.badlogic.gdx.math Frustum boundsInFrustum

List of usage examples for com.badlogic.gdx.math Frustum boundsInFrustum

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Frustum boundsInFrustum.

Prototype

public boolean boundsInFrustum(BoundingBox bounds) 

Source Link

Document

Returns whether the given BoundingBox is in the frustum.

Usage

From source file:com.badlogic.gdx.tests.g3d.shadows.utils.FrustumLightFilter.java

License:Apache License

@Override
public boolean filter(BaseLight light, Camera camera, Camera mainCamera) {
    Frustum f1 = mainCamera.frustum;
    Frustum f2 = camera.frustum;//from  w ww.ja  va 2 s .  c  o m
    bb.inf();

    for (int i = 0; i < f2.planePoints.length; i++) {
        bb.ext(f2.planePoints[i]);
    }

    if (f1.boundsInFrustum(bb)) {
        return true;
    }

    return false;
}