[Bf-blender-cvs] [1c02a20] master: BGE: Cleanup constraints documentation

Thomas Szepe noreply at git.blender.org
Sun May 10 16:03:38 CEST 2015


Commit: 1c02a201ba992adc43ec9d9a08b121edfaec4232
Author: Thomas Szepe
Date:   Sun May 10 15:58:17 2015 +0200
Branches: master
https://developer.blender.org/rB1c02a201ba992adc43ec9d9a08b121edfaec4232

BGE: Cleanup constraints documentation

* Fixing Python example. Behavior has changed with Blender 2.74
* Adding missing return type
* Fixing typo simbolic
* Fixing note for upper/lower limit
* Adding link to constraints constants

===================================================================

M	doc/python_api/examples/bge.constraints.py
M	doc/python_api/rst/bge.constraints.rst
M	doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst

===================================================================

diff --git a/doc/python_api/examples/bge.constraints.py b/doc/python_api/examples/bge.constraints.py
index e76fc3d..c617ac0 100644
--- a/doc/python_api/examples/bge.constraints.py
+++ b/doc/python_api/examples/bge.constraints.py
@@ -20,15 +20,15 @@ constraint_type = 2
 physics_id_1 = object_1.getPhysicsId()
 physics_id_2 = object_2.getPhysicsId()
 
-# Use bottom right edge of Object1 for hinge position
+# use bottom right edge of Object1 for hinge position
 edge_position_x = 1.0
 edge_position_y = 0.0
 edge_position_z = -1.0
 
-# use Object1 y axis for angle to point hinge
+# rotate the pivot z axis about 90 degrees
 edge_angle_x = 0.0
-edge_angle_y = 1.0
-edge_angle_z = 0.0
+edge_angle_y = 0.0
+edge_angle_z = 90.0
 
 # create an edge constraint
 constraints.createConstraint(physics_id_1, physics_id_2,
diff --git a/doc/python_api/rst/bge.constraints.rst b/doc/python_api/rst/bge.constraints.rst
index 636a662..cf85659 100644
--- a/doc/python_api/rst/bge.constraints.rst
+++ b/doc/python_api/rst/bge.constraints.rst
@@ -22,16 +22,14 @@ Physics Constraints (bge.constraints)
    :type physicsid2: int
 
    :arg constrainttype: the type of the constraint. The constraint types are:
-
+   :type constrainttype: int
    - :class:`POINTTOPOINT_CONSTRAINT`
    - :class:`LINEHINGE_CONSTRAINT`
    - :class:`ANGULAR_CONSTRAINT`
    - :class:`CONETWIST_CONSTRAINT`
    - :class:`VEHICLE_CONSTRAINT`
    - :class:`GENERIC_6DOF_CONSTRAINT`
-
-   :type constrainttype: int
-
+   
    :arg pivot_X: pivot X position
    :type pivot_X: float (optional)
 
@@ -53,9 +51,12 @@ Physics Constraints (bge.constraints)
    :arg flag: 128 to disable collision between linked bodies
    :type flag: int (optional)
 
+   :return: a constraint wrapper.
+   :rtype: :class:`bge.types.KX_ConstraintWrapper`
+
 .. attribute:: error
 
-   Simbolic constant string that indicates error.
+   Symbolic constant string that indicates error.
 
 .. function:: exportBulletFile(filename)
 
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
index 53bef12..2069bfb 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
@@ -23,15 +23,13 @@ base class --- :class:`PyObjectPlus`
       :arg axis:
       :type axis: integer
 
-   .. note::
-      For each axis:
-      * Lowerlimit == Upperlimit -> axis is locked
-      * Lowerlimit > Upperlimit -> axis is free
-      * Lowerlimit < Upperlimit -> axis it limited in that range
+      .. note::
+         * Lowerlimit == Upperlimit -> axis is locked
+         * Lowerlimit > Upperlimit -> axis is free
+         * Lowerlimit < Upperlimit -> axis it limited in that range
 
       PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
       axis = 3 is a constraint limit, with low/high limit value
-
          * 3: X axis angle
 
       :arg value0 (min): Set the minimum limit of the axis
@@ -132,10 +130,10 @@ base class --- :class:`PyObjectPlus`
       Returns the contraint type (read only)
 
       :type: integer
+      - 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
+      - 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
+      - 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
+      - 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
+      - 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
+      - 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
 
-         * 1 = POINTTOPOINT_CONSTRAINT
-         * 2 = LINEHINGE_CONSTRAINT
-         * 3 = ANGULAR_CONSTRAINT (aka LINEHINGE_CONSTRAINT)
-         * 4 = CONETWIST_CONSTRAINT
-         * 11 = VEHICLE_CONSTRAINT
-         * 12 = GENERIC_6DOF_CONSTRAINT




More information about the Bf-blender-cvs mailing list