- Updated BGE docs to match the game engines class inheritance more closely.

- Grouped deprecated functions for KX_Camera, KX_GameObject, SCA_ISensor, SCA_ILogicBrick, KX_Scene
This commit is contained in:
Campbell Barton 2009-04-28 13:02:49 +00:00
parent d4f8b416e9
commit eee8dd9086
17 changed files with 100 additions and 15 deletions

@ -1,4 +1,7 @@
class BL_Shader: # (PyObjectPlus)
from PyObjectPlus import *
class BL_Shader(PyObjectPlus):
"""
BL_Shader GLSL shaders.

@ -1,4 +1,6 @@
class CListValue: # (PyObjectPlus)
from CPropValue import *
class CListValue(CPropValue):
"""
CListValue

@ -0,0 +1,8 @@
#
# Documentation for CValue class
from CValue import *
class CPropValue(CValue):
"""
This class has no python functions
"""
pass

@ -0,0 +1,8 @@
#
# Documentation for CValue class
from PyObjectPlus import *
class CValue(PyObjectPlus):
"""
This class has no python functions
"""
pass

@ -1,4 +1,7 @@
class KX_BlenderMaterial: # (PyObjectPlus)
from PyObjectPlus import *
class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial)
"""
KX_BlenderMaterial

@ -40,6 +40,8 @@ class KX_Camera(KX_GameObject):
Regenerated every frame from the camera's position and orientation.
This is camera_to_world inverted.
@type world_to_camera: 4x4 Matrix [[float]]
@group Deprecated: enableViewport
"""
def sphereInsideFrustum(centre, radius):
@ -187,6 +189,7 @@ class KX_Camera(KX_GameObject):
def enableViewport(viewport):
"""
DEPRECATED: use the isViewport property
Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}.
@type viewport: bool

@ -1,18 +1,18 @@
# $Id$
# Documentation for game objects
# from SCA_IObject import *
from SCA_IObject import *
# from SCA_ISensor import *
# from SCA_IController import *
# from SCA_IActuator import *
class KX_GameObject: # (SCA_IObject)
class KX_GameObject(SCA_IObject):
"""
All game objects are derived from this class.
Properties assigned to game objects are accessible as attributes of this class.
- note: Calling ANY method or attribute on an object that has been removed from a scene will raise a RuntimeError, if an object may have been removed since last accessing it use the L{isValid} attribute to check.
- note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check.
@ivar name: The object's name. (Read only)
- note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5.
@ -79,8 +79,7 @@ class KX_GameObject: # (SCA_IObject)
- note: This attribute is experemental and may be removed (but probably wont be).
- note: Changes to this list will not update the KX_GameObject.
@type actuators: list
@ivar isValid: Retuerns fails when the object has been removed from the scene and can no longer be used.
@type isValid: bool
@group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh
"""
def endObject():
"""

@ -1,7 +1,9 @@
# $Id$
# Documentation for KX_MeshProxy
class KX_MeshProxy:
from SCA_IObject import *
class KX_MeshProxy(SCA_IObject):
"""
A mesh object.

@ -1,4 +1,6 @@
class KX_PhysicsObjectWrapper: # (PyObjectPlus)
from PyObjectPlus import *
class KX_PhysicsObjectWrapper(PyObjectPlus):
"""
KX_PhysicsObjectWrapper

@ -1,7 +1,8 @@
# $Id$
# Documentation for the polygon proxy class
from SCA_IObject import *
class KX_PolyProxy:
class KX_PolyProxy(SCA_IObject):
"""
A polygon holds the index of the vertex forming the poylgon.

@ -1,7 +1,9 @@
# $Id$
# Documentation for KX_Scene.py
class KX_Scene:
from PyObjectPlus import *
class KX_Scene(PyObjectPlus):
"""
Scene.
@ -41,6 +43,12 @@ class KX_Scene:
@type name: string
@ivar objects: A list of objects in the scene.
@type objects: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_GameObject.KX_GameObject>}
@ivar objects_inactive: A list of objects on background layers (used for the addObject actuator).
@type objects_inactive: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_GameObject.KX_GameObject>}
@ivar lights: A list of lights in the scene.
@type lights: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_LightObject.KX_LightObject>}
@ivar cameras: A list of cameras in the scene.
@type cameras: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_Camera.KX_Camera>}
@ivar active_camera: The current active camera
@type active_camera: L{KX_Camera}
@ivar suspended: True if the scene is suspended.
@ -49,22 +57,26 @@ class KX_Scene:
@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
@group Deprecated: getLightList, getObjectList, getName
"""
def getLightList():
"""
DEPRECATED: use the 'lights' property.
Returns the list of lights in the scene.
@rtype: list [L{KX_LightObject}]
"""
def getObjectList():
"""
DEPRECATED: use the 'objects' property.
Returns the list of objects in the scene.
@rtype: list [L{KX_GameObject}]
"""
def getName():
"""
DEPRECATED: use the 'name' property.
Returns the name of the scene.
@rtype: string

@ -1,4 +1,6 @@
class KX_VehicleWrapper: # (PyObjectPlus)
from PyObjectPlus import *
class KX_VehicleWrapper(PyObjectPlus):
"""
KX_VehicleWrapper

@ -1,7 +1,9 @@
# $Id$
# Documentation for the vertex proxy class
class KX_VertexProxy:
from SCA_IObject import *
class KX_VertexProxy(SCA_IObject):
"""
A vertex holds position, UV, colour and normal information.

@ -0,0 +1,26 @@
#
# Documentation for PyObjectPlus base class
class PyObjectPlus:
"""
PyObjectPlus base class of most other types in the Game Engine.
@ivar invalid: Test if the object has been freed by the game engine and is no longer valid.
Normally this is not a problem but when storing game engine data in the GameLogic module,
KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
Calling an attribute or method on an invalid object will raise a SystemError.
The invalid attribute allows testing for this case without exception handling.
@type invalid: bool
"""
def isA(game_type):
"""
Check if this is a type or a subtype game_type.
@param game_type: the name of the type or the type its self from the L{GameTypes} module.
@type game_type: string or type
@return: True if this object is a type or a subtype of game_type.
@rtype: bool
"""

@ -1,8 +1,9 @@
# $Id$
# Documentation for the logic brick base class SCA_ILogicBrick
from KX_GameObject import *
from CValue import *
class SCA_ILogicBrick:
class SCA_ILogicBrick(CValue):
"""
Base class for all logic bricks.
@ -10,6 +11,7 @@ class SCA_ILogicBrick:
@type executePriority: int
@ivar owner: The game object this logic brick is attached to (read only).
@type owner: L{KX_GameObject<KX_GameObject.KX_GameObject>} or None in exceptional cases.
@group Deprecated: getOwner, setExecutePriority, getExecutePriority
"""
def getOwner():

@ -0,0 +1,9 @@
#
# Documentation for SCA_IObject class
from CValue import *
class SCA_IObject(CValue):
"""
This class has no python functions
"""
pass

@ -24,6 +24,7 @@ class SCA_ISensor(SCA_ILogicBrick):
@type triggered: boolean
@ivar positive: True if this sensor brick is in a positive state. (Read only)
@type positive: boolean
@group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel
"""
def reset():