diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-07 15:03:12 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-07 15:03:12 +0400 |
commit | c16444e624040bd51a86b5dfd743396eaed970d1 (patch) | |
tree | 8224a39a10bd2b16968394d2e185c1413c57ed13 /source/gameengine/PyDoc/KX_Scene.py | |
parent | b468bf726c50d3126fac2664164e1be0d6e209c5 (diff) |
Python updates:
Added scene module
Diffstat (limited to 'source/gameengine/PyDoc/KX_Scene.py')
-rw-r--r-- | source/gameengine/PyDoc/KX_Scene.py | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py new file mode 100644 index 00000000000..2ba57dc9d78 --- /dev/null +++ b/source/gameengine/PyDoc/KX_Scene.py @@ -0,0 +1,68 @@ +# $Id$ +# Documentation for KX_Scene.py + +class KX_Scene: + """ + Scene. + + The activity culling stuff is supposed to disable logic bricks when their owner gets too far + from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows + what it does! + + Example:: + import GameLogic + + # get the scene + scene = GameLogic.getCurrentScene() + + # print all the objects in the scene + for obj in scene.getObjectList(): + print obj.getName() + + # get an object named 'Cube' + obj = scene.getObjectList()["OBCube"] + + # get the first object in the scene. + obj = scene.getObjectList()[0] + + Example:: + # Get the depth of an object in the camera view. + import GameLogic + + obj = GameLogic.getCurrentController().getOwner() + cam = GameLogic.getCurrentScene().active_camera + + # Depth is negative and decreasing further from the camera + 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] + + @ivar name: The scene's name + @type name: string + @ivar active_camera: The current active camera + @type active_camera: L{KX_Camera} + @ivar suspended: True if the scene is suspended. + @type suspended: boolean + @ivar activity_culling: True if the scene is activity culling + @type activity_culling: boolean + @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance. + @type activity_culling_radius: float + """ + + def getLightList(): + """ + Returns the list of lights in the scene. + + @rtype: list [L{KX_Light}] + """ + def getObjectList(): + """ + Returns the list of objects in the scene. + + @rtype: list [L{KX_GameObject}] + """ + def getName(): + """ + Returns the name of the scene. + + @rtype: string + """ + |