Game Object: occlusion

occlusion
  • gets/sets occlusion culling.

Type:
  • boolean
     
  • occlusion culling enabled: 1 or True
     
  • occlusion culling disabled: 0 or False
Note:
  • Occlusion Culling disables rendering of objects when they are hidden behind other objects.
     
  • Occlusion Culling is disabled by default.
Sample Code

################## get the object's occlusion culling status
  
# import bge
import bge

# get controller
cont = bge.logic.getCurrentController()

# get object that controller is attached to
obj = cont.owner

# get occlusion culling
status = obj.occlusion

Sample Code

################## set the object's occlusion culling status
  
# import bge
import bge

# get controller
cont = bge.logic.getCurrentController()

# get object that controller is attached to
obj = cont.owner

# set occlusion culling
obj.occlusion = True