2 # Documentation for KX_Scene.py
8 The activity culling stuff is supposed to disable logic bricks when their owner gets too far
9 from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows
16 scene = GameLogic.getCurrentScene()
18 # print all the objects in the scene
19 for obj in scene.getObjectList():
22 # get an object named 'Cube'
23 obj = scene.getObjectList()["OBCube"]
25 # get the first object in the scene.
26 obj = scene.getObjectList()[0]
29 # Get the depth of an object in the camera view.
32 obj = GameLogic.getCurrentController().getOwner()
33 cam = GameLogic.getCurrentScene().active_camera
35 # Depth is negative and decreasing further from the camera
36 depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
38 @ivar name: The scene's name
40 @ivar active_camera: The current active camera
41 @type active_camera: L{KX_Camera}
42 @ivar suspended: True if the scene is suspended.
43 @type suspended: boolean
44 @ivar activity_culling: True if the scene is activity culling
45 @type activity_culling: boolean
46 @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance.
47 @type activity_culling_radius: float
52 Returns the list of lights in the scene.
54 @rtype: list [L{KX_Light}]
58 Returns the list of objects in the scene.
60 @rtype: list [L{KX_GameObject}]
64 Returns the name of the scene.