sphereInsideFrustum
sphereInsideFrustum(centre, radius)
Checks to see if a sphere is inside the camera's view frustum.
Returns: INSIDE, OUTSIDE or INTERSECT
center:
Type: List
[ x, y, z]
Center of the sphere in World Coordinates.
radius:
Type:
float number.
Radius of the sphere
Sample Code
# get the current scene
scene = GameLogic.getCurrentScene()
# get the active camera
cam = scene.active_camera
# check if sphere is inside view frustum
sphereInside = cam.sphereInsideFrustum( [0.0, 0.0, 0.0], 4.5)
if sphereInside == cam.INSIDE:
# your code here
if sphereInside == cam.OUTSIDE:
# your code here
if sphereInside == cam.INTERSECT:
# your code here
|