BGE Epydocs were missing some functions
authorCampbell Barton <ideasman42@gmail.com>
Mon, 6 Apr 2009 13:13:25 +0000 (13:13 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 6 Apr 2009 13:13:25 +0000 (13:13 +0000)
renamed KX_Light -> KX_LightObject
added some missing controllers

18 files changed:
source/gameengine/PyDoc/GameLogic.py
source/gameengine/PyDoc/GameTypes.py [new file with mode: 0644]
source/gameengine/PyDoc/KX_Camera.py
source/gameengine/PyDoc/KX_GameObject.py
source/gameengine/PyDoc/KX_LightObject.py [moved from source/gameengine/PyDoc/KX_Light.py with 97% similarity]
source/gameengine/PyDoc/KX_MouseFocusSensor.py
source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
source/gameengine/PyDoc/KX_SCA_DynamicActuator.py
source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py
source/gameengine/PyDoc/KX_Scene.py
source/gameengine/PyDoc/KX_VertexProxy.py
source/gameengine/PyDoc/SCA_ActuatorSensor.py [moved from source/gameengine/PyDoc/KX_ActuatorSensor.py with 91% similarity]
source/gameengine/PyDoc/SCA_MouseSensor.py
source/gameengine/PyDoc/SCA_NANDController.py [new file with mode: 0644]
source/gameengine/PyDoc/SCA_NORController.py [new file with mode: 0644]
source/gameengine/PyDoc/SCA_XNORController.py [new file with mode: 0644]
source/gameengine/PyDoc/SCA_XORController.py [new file with mode: 0644]
source/gameengine/PyDoc/WhatsNew.py

index f158b41097534d9829eecc7c86ced84318ea87eb..da394288e25038438f2237c89e90aabb2543e919 100644 (file)
@@ -3,10 +3,17 @@
 Documentation for the GameLogic Module.
 =======================================
 
-       There are only three importable modules in the game engine:
+       Modules available in the game engine:
                - GameLogic
                - L{GameKeys}
                - L{Rasterizer}
+               - L{GameTypes}
+       
+       Undocumented modules:
+               - VideoTexture
+               - CValue
+               - Expression
+               - PhysicsConstraints
        
        All the other modules are accessible through the methods in GameLogic.
        
@@ -18,7 +25,7 @@ Documentation for the GameLogic Module.
                
                # To get the game object this controller is on:
                obj = co.getOwner()
-       L{KX_GameObject} and L{KX_Camera} or L{KX_Light} methods are
+       L{KX_GameObject} and L{KX_Camera} or L{KX_LightObject} methods are
        available depending on the type of object::
                # To get a sensor linked to this controller.
                # "sensorname" is the name of the sensor as defined in the Blender interface.
@@ -165,9 +172,19 @@ Documentation for the GameLogic Module.
 @var KX_DYN_DISABLE_RIGID_BODY:        See L{KX_SCA_DynamicActuator}
 @var KX_DYN_SET_MASS:                  See L{KX_SCA_DynamicActuator}
 
-"""
+@group Input Status: KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED
+@var KX_INPUT_NONE:                            See L{SCA_MouseSensor}
+@var KX_INPUT_JUST_ACTIVATED:  See L{SCA_MouseSensor}
+@var KX_INPUT_ACTIVE:                  See L{SCA_MouseSensor}
+@var KX_INPUT_JUST_RELEASED:   See L{SCA_MouseSensor}
 
 
+@group Mouse Buttons: KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT
+@var KX_MOUSE_BUT_LEFT:                See L{SCA_MouseSensor}
+@var KX_MOUSE_BUT_MIDDLE:      See L{SCA_MouseSensor}
+@var KX_MOUSE_BUT_RIGHT:       See L{SCA_MouseSensor}
+"""
+
 def getCurrentController():
        """
        Gets the Python controller associated with this Python script.
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py
new file mode 100644 (file)
index 0000000..f39e4ed
--- /dev/null
@@ -0,0 +1,75 @@
+# $Id: GameLogic.py 19483 2009-03-31 21:03:15Z ben2610 $
+"""
+GameEngine Types
+================
+@var BL_ActionActuator: L{BL_ActionActuator<BL_ActionActuator.BL_ActionActuator>}
+@var BL_Shader: L{BL_Shader<BL_Shader.BL_Shader>}
+@var BL_ShapeActionActuator: L{BL_ShapeActionActuator<BL_ShapeActionActuator.BL_ShapeActionActuator>}
+@var CListValue: L{CListValue<CListValue.CListValue>}
+@var CValue: L{CValue<CValue.CValue>}
+@var KX_BlenderMaterial: L{KX_BlenderMaterial<KX_BlenderMaterial.KX_BlenderMaterial>}
+@var KX_CDActuator: L{KX_CDActuator<KX_CDActuator.KX_CDActuator>}
+@var KX_Camera: L{KX_Camera<KX_Camera.KX_Camera>}
+@var KX_CameraActuator: L{KX_CameraActuator<KX_CameraActuator.KX_CameraActuator>}
+@var KX_ConstraintActuator: L{KX_ConstraintActuator<KX_ConstraintActuator.KX_ConstraintActuator>}
+@var KX_ConstraintWrapper: L{KX_ConstraintWrapper<KX_ConstraintWrapper.KX_ConstraintWrapper>}
+@var KX_GameActuator: L{KX_GameActuator<KX_GameActuator.KX_GameActuator>}
+@var KX_GameObject: L{KX_GameObject<KX_GameObject.KX_GameObject>}
+@var KX_IpoActuator: L{KX_IpoActuator<KX_IpoActuator.KX_IpoActuator>}
+@var KX_LightObject: L{KX_LightObject<KX_LightObject.KX_LightObject>}
+@var KX_MeshProxy: L{KX_MeshProxy<KX_MeshProxy.KX_MeshProxy>}
+@var KX_MouseFocusSensor: L{KX_MouseFocusSensor<KX_MouseFocusSensor.KX_MouseFocusSensor>}
+@var KX_NearSensor: L{KX_NearSensor<KX_NearSensor.KX_NearSensor>}
+@var KX_NetworkMessageActuator: L{KX_NetworkMessageActuator<KX_NetworkMessageActuator.KX_NetworkMessageActuator>}
+@var KX_NetworkMessageSensor: L{KX_NetworkMessageSensor<KX_NetworkMessageSensor.KX_NetworkMessageSensor>}
+@var KX_ObjectActuator: L{KX_ObjectActuator<KX_ObjectActuator.KX_ObjectActuator>}
+@var KX_ParentActuator: L{KX_ParentActuator<KX_ParentActuator.KX_ParentActuator>}
+@var KX_PhysicsObjectWrapper: L{KX_PhysicsObjectWrapper<KX_PhysicsObjectWrapper.KX_PhysicsObjectWrapper>}
+@var KX_PolyProxy: L{KX_PolyProxy<KX_PolyProxy.KX_PolyProxy>}
+@var KX_PolygonMaterial: L{KX_PolygonMaterial<KX_PolygonMaterial.KX_PolygonMaterial>}
+@var KX_RadarSensor: L{KX_RadarSensor<KX_RadarSensor.KX_RadarSensor>}
+@var KX_RaySensor: L{KX_RaySensor<KX_RaySensor.KX_RaySensor>}
+@var KX_SCA_AddObjectActuator: L{KX_SCA_AddObjectActuator<KX_SCA_AddObjectActuator.KX_SCA_AddObjectActuator>}
+@var KX_SCA_DynamicActuator: L{KX_SCA_DynamicActuator<KX_SCA_DynamicActuator.KX_SCA_DynamicActuator>}
+@var KX_SCA_EndObjectActuator: L{KX_SCA_EndObjectActuator<KX_SCA_EndObjectActuator.KX_SCA_EndObjectActuator>}
+@var KX_SCA_ReplaceMeshActuator: L{KX_SCA_ReplaceMeshActuator<KX_SCA_ReplaceMeshActuator.KX_SCA_ReplaceMeshActuator>}
+@var KX_Scene: L{KX_Scene<KX_Scene.KX_Scene>}
+@var KX_SceneActuator: L{KX_SceneActuator<KX_SceneActuator.KX_SceneActuator>}
+@var KX_SoundActuator: L{KX_SoundActuator<KX_SoundActuator.KX_SoundActuator>}
+@var KX_StateActuator: L{KX_StateActuator<KX_StateActuator.KX_StateActuator>}
+@var KX_TouchSensor: L{KX_TouchSensor<KX_TouchSensor.KX_TouchSensor>}
+@var KX_TrackToActuator: L{KX_TrackToActuator<KX_TrackToActuator.KX_TrackToActuator>}
+@var KX_VehicleWrapper: L{KX_VehicleWrapper<KX_VehicleWrapper.KX_VehicleWrapper>}
+@var KX_VertexProxy: L{KX_VertexProxy<KX_VertexProxy.KX_VertexProxy>}
+@var KX_VisibilityActuator: L{KX_VisibilityActuator<KX_VisibilityActuator.KX_VisibilityActuator>}
+@var PyObjectPlus: L{PyObjectPlus<PyObjectPlus.PyObjectPlus>}
+@var SCA_2DFilterActuator: L{SCA_2DFilterActuator<SCA_2DFilterActuator.SCA_2DFilterActuator>}
+@var SCA_ANDController: L{SCA_ANDController<SCA_ANDController.SCA_ANDController>}
+@var SCA_ActuatorSensor: L{SCA_ActuatorSensor<SCA_ActuatorSensor.SCA_ActuatorSensor>}
+@var SCA_AlwaysSensor: L{SCA_AlwaysSensor<SCA_AlwaysSensor.SCA_AlwaysSensor>}
+@var SCA_DelaySensor: L{SCA_DelaySensor<SCA_DelaySensor.SCA_DelaySensor>}
+@var SCA_ILogicBrick: L{SCA_ILogicBrick<SCA_ILogicBrick.SCA_ILogicBrick>}
+@var SCA_IObject: L{SCA_IObject<SCA_IObject.SCA_IObject>}
+@var SCA_ISensor: L{SCA_ISensor<SCA_ISensor.SCA_ISensor>}
+@var SCA_JoystickSensor: L{SCA_JoystickSensor<SCA_JoystickSensor.SCA_JoystickSensor>}
+@var SCA_KeyboardSensor: L{SCA_KeyboardSensor<SCA_KeyboardSensor.SCA_KeyboardSensor>}
+@var SCA_MouseSensor: L{SCA_MouseSensor<SCA_MouseSensor.SCA_MouseSensor>}
+@var SCA_NANDController: L{SCA_NANDController<SCA_NANDController.SCA_NANDController>}
+@var SCA_NORController: L{SCA_NORController<SCA_NORController.SCA_NORController>}
+@var SCA_ORController: L{SCA_ORController<SCA_ORController.SCA_ORController>}
+@var SCA_PropertyActuator: L{SCA_PropertyActuator<SCA_PropertyActuator.SCA_PropertyActuator>}
+@var SCA_PropertySensor: L{SCA_PropertySensor<SCA_PropertySensor.SCA_PropertySensor>}
+@var SCA_PythonController: L{SCA_PythonController<SCA_PythonController.SCA_PythonController>}
+@var SCA_RandomActuator: L{SCA_RandomActuator<SCA_RandomActuator.SCA_RandomActuator>}
+@var SCA_RandomSensor: L{SCA_RandomSensor<SCA_RandomSensor.SCA_RandomSensor>}
+@var SCA_XNORController: L{SCA_XNORController<SCA_XNORController.SCA_XNORController>}
+@var SCA_XORController: L{SCA_XORController<SCA_XORController.SCA_XORController>}
+"""
+
+if 0:
+       # Use to print out all the links
+       for i in a.split('\n'):
+               if i.startswith('@var'):
+                       var = i.split(' ')[1].split(':')[0]
+                       print '@var %s: L{%s<%s.%s>}' % (var, var, var, var)
+
index 4cadf1c0ed007f8b07a8184fe930afd8fde1019e..f5d0d45f968b588f61b696bb53427083bcecdd76 100644 (file)
@@ -185,3 +185,25 @@ class KX_Camera(KX_GameObject):
                @param matrix: The new projection matrix for this camera.
                """
 
+       def enableViewport(viewport):
+               """
+               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
+               @param viewport: the new viewport status
+               """
+       def setOnTop():
+               """
+               Set this cameras viewport ontop of all other viewport.
+               """
+       def setViewport(left, bottom, right, top):
+               """
+               Sets the region of this viewport on the screen in pixels.
+               
+               Use L{Rasterizer.getWindowHeight} L{Rasterizer.getWindowWidth} to calculate values relative to the entire display.
+               
+               @type left: int
+               @type bottom: int
+               @type right: int
+               @type top: int
+               """
index 97e53ffacaadbba29a6dee1cb394a95d7548fead..972a15b77658451fcfd0e2e4068fc4a1500a7daf 100644 (file)
@@ -442,5 +442,12 @@ class KX_GameObject: # (SCA_IObject)
                         If no hit, returns (None,None,None) or (None,None,None,None)
                         If the object hit is not a static mesh, polygon is None
                """
-
-
+       def setCollisionMargin(margin):
+               """
+               Set the objects collision margin.
+               
+               note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
+               
+               @type margin: float
+               @param margin: the collision margin distance in blender units.
+               """
similarity index 97%
rename from source/gameengine/PyDoc/KX_Light.py
rename to source/gameengine/PyDoc/KX_LightObject.py
index ff0cf071d2d3d99107bcbb5dd1b66d5481e47b83..8cc1787887b21b6b64a4160572b3c3c3370fa131 100644 (file)
@@ -2,7 +2,7 @@
 # Documentation for Light game objects.
 from KX_GameObject import *
 
-class KX_Light(KX_GameObject):
+class KX_LightObject(KX_GameObject):
        """
        A Light object.
 
index 28d584037f837b03aae268e3db68688339980865..ceab5b8c5111805f8a098e73d37077e530655c0a 100644 (file)
@@ -10,17 +10,45 @@ class KX_MouseFocusSensor(SCA_MouseSensor):
        space to 3d space then raycasting away from the camera.
        """
        
-       def GetRayTarget():
+       def getHitNormal():
                """
-               Returns the end point of the sensor ray.
+               Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.
                
                @rtype: list [x, y, z]
-               @return: the end point of the sensor ray, in world coordinates.
+               @return: the ray collision normal.
                """
-       def GetRaySource():
+       def getHitObject():
                """
-               Returns the start point of the sensor ray.
+               Returns the object that was hit by this ray or None.
+               
+               @rtype: L{KX_GameObject} or None
+               @return: the collision object.
+               """
+       def getHitPosition():
+               """
+               Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray.
+               
+               @rtype: list [x, y, z]
+               @return: the ray collision position.
+               """
+       def getRayDirection():
+               """
+               Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse.
                
                @rtype: list [x, y, z]
-               @return: the start point of the sensor ray, in world coordinates.
+               @return: the ray direction.
                """
+       def getRaySource():
+               """
+               Returns the position (in worldcoordinates) the ray was cast from by the mouse.
+               
+               @rtype: list [x, y, z]
+               @return: the ray source.
+               """
+       def getRayTarget():
+               """
+               Returns the target of the ray (in worldcoordinates) that seeks the focus object.
+               
+               @rtype: list [x, y, z]
+               @return: the ray target.
+               """
\ No newline at end of file
index 974ef718ccf0d6956111bfd4d4a997df6da100c8..572b864ff0a950a25b7cdcb7f60906aac6934a16 100644 (file)
@@ -109,3 +109,10 @@ class KX_SCA_AddObjectActuator(SCA_IActuator):
                @rtype: L{KX_GameObject}
                @return: A L{KX_GameObject} or None if no object has been created.
                """
+       def instantAddObject():
+               """
+               Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}.
+               
+               @rtype: None
+               """
+       
index d65d3c2299368406d657d71af678a36a6e8afc11..22da159ce711bc01446eeb73eeda35b742e6237b 100644 (file)
@@ -22,7 +22,7 @@ class KX_SCA_DynamicActuator(SCA_IActuator):
                                - 3 = disable rigid body
                                - 4 = set mass
                """
-       def getOperatoin():
+       def getOperation():
                """
                DEPRECATED: Use the operation property instead.
                return the type of operation
index 4397a9152d0742ac430a9b76242fa463758dff90..951c118a99ac587f370766526944d87226db22f4 100644 (file)
@@ -77,4 +77,8 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator):
                
                @rtype: string or None
                """
-
+       def instantReplaceMesh():
+               """
+               Immediately replace mesh without delay.
+               @rtype: None
+               """
\ No newline at end of file
index 4f7beb9e300afee7bfd20e5af717f930ed1400be..a9fd44ffc9af00b868d7bb882169fd31fa313e50 100644 (file)
@@ -55,7 +55,7 @@ class KX_Scene:
                """
                Returns the list of lights in the scene.
                
-               @rtype: list [L{KX_Light}]
+               @rtype: list [L{KX_LightObject}]
                """
        def getObjectList():
                """
index 8dc2752c0376ad7a356ca260bb3d9908ebcc97c8..5baaf76c3d9253b118f5d9991f7d71c0c7f1bc29 100644 (file)
@@ -70,6 +70,19 @@ class KX_VertexProxy:
                """
                Sets the UV (texture) coordinates of this vertex.
                
+               @type uv: list [u, v]
+               """
+       def getUV2():
+               """
+               Gets the 2nd UV (texture) coordinates of this vertex.
+               
+               @rtype: list [u, v]
+               @return: this vertexes UV (texture) coordinates.
+               """
+       def setUV2(uv):
+               """
+               Sets the 2nd UV (texture) coordinates of this vertex.
+               
                @type uv: list [u, v]
                """
        def getRGBA():
@@ -120,3 +133,11 @@ class KX_VertexProxy:
                @rtype: list [nx, ny, nz]
                @return: normalised normal vector.
                """
+       def setNormal(normal):
+               """
+               Sets the normal vector of this vertex.
+
+               @type normal: sequence of floats [r, g, b]
+               @param normal: the new normal of this vertex.
+               """
+
similarity index 91%
rename from source/gameengine/PyDoc/KX_ActuatorSensor.py
rename to source/gameengine/PyDoc/SCA_ActuatorSensor.py
index 27ee3a475e0d3154b2f11b50300aaf37663ece27..515354e8716bb2178552a5786061bdb6989d0d2f 100644 (file)
@@ -1,10 +1,10 @@
 # $Id$
-# Documentation for KX_ActuatorSensor
+# Documentation for SCA_ActuatorSensor
 from SCA_IActuator import *
 from SCA_ISensor import *
 from SCA_ILogicBrick import *
 
-class KX_ActuatorSensor(SCA_ISensor):
+class SCA_ActuatorSensor(SCA_ISensor):
        """
        Actuator sensor detect change in actuator state of the parent object.
        It generates a positive pulse if the corresponding actuator is activated
index 9550cbb4105e897e93d8218c253aea721ceea583..278ebe63b8a93d19b4390086f1456e6a548edf70 100644 (file)
@@ -32,3 +32,13 @@ class SCA_MouseSensor(SCA_ISensor):
                @rtype: integer
                @return: the current y coordinate of the mouse, in frame coordinates (pixels).
                """     
+       def getButtonStatus(button):
+               """
+               Get the mouse button status.
+               
+               @type button: int
+               @param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT
+               
+               @rtype: integer
+               @return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED
+               """
diff --git a/source/gameengine/PyDoc/SCA_NANDController.py b/source/gameengine/PyDoc/SCA_NANDController.py
new file mode 100644 (file)
index 0000000..81e1dfd
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $
+# Documentation for SCA_NANDController
+from SCA_IController import *
+
+class SCA_NANDController(SCA_IController):
+       """
+       An NAND controller activates when all linked sensors are not active.
+       
+       There are no special python methods for this controller.
+       """
+
diff --git a/source/gameengine/PyDoc/SCA_NORController.py b/source/gameengine/PyDoc/SCA_NORController.py
new file mode 100644 (file)
index 0000000..e3bdeef
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $
+# Documentation for SCA_NORController
+from SCA_IController import *
+
+class SCA_NORController(SCA_IController):
+       """
+       An NOR controller activates only when all linked sensors are de-activated.
+       
+       There are no special python methods for this controller.
+       """
+
diff --git a/source/gameengine/PyDoc/SCA_XNORController.py b/source/gameengine/PyDoc/SCA_XNORController.py
new file mode 100644 (file)
index 0000000..b1d9ddd
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $
+# Documentation for SCA_XNORController
+from SCA_IController import *
+
+class SCA_XNORController(SCA_IController):
+       """
+       An XNOR controller activates when all linked sensors are the same (activated or inative).
+       
+       There are no special python methods for this controller.
+       """
+
diff --git a/source/gameengine/PyDoc/SCA_XORController.py b/source/gameengine/PyDoc/SCA_XORController.py
new file mode 100644 (file)
index 0000000..b8f2b5f
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id: SCA_ANDController.py 15444 2008-07-05 17:05:05Z lukep $
+# Documentation for SCA_XORController
+from SCA_IController import *
+
+class SCA_XORController(SCA_IController):
+       """
+       An XOR controller activates when there is the input is mixed, but not when all are on or off.
+       
+       There are no special python methods for this controller.
+       """
+
index 64bef7ee1c8a4f126451142d19578049124d0cfa..4d86e6ef3c4764e53ebdb6fb3239f52eed5593bc 100644 (file)
@@ -26,7 +26,7 @@ Blender 2.34
        - Added getType() and setType() to L{BL_ActionActuator} and L{KX_SoundActuator} (sgefant)
        - New Scene module: L{KX_Scene}
        - New Camera module: L{KX_Camera}
-       - New Light module: L{KX_Light}
+       - New Light module: L{KX_LightObject}
        - Added attributes to L{KX_GameObject}, L{KX_VertexProxy}
        - L{KX_SCA_AddObjectActuator}.setObject(), L{KX_TrackToActuator}.setObject() and 
          L{KX_SceneActuator}.setCamera() now accept L{KX_GameObject}s as parameters