Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.KX_ConstraintWrapper.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 59bd836d90e2a664919231ef5b13e792dc1e30c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
KX_ConstraintWrapper(PyObjectPlus)
==================================

.. module:: bge.types

base class --- :class:`PyObjectPlus`

.. class:: KX_ConstraintWrapper(PyObjectPlus)

   KX_ConstraintWrapper

   .. method:: getConstraintId(val)

      Returns the contraint ID

      :return: the constraint ID
      :rtype: integer

   .. method:: setParam(axis, value0, value1)

      Set the contraint limits

      :arg axis:
      :type axis: integer

      .. note::
         * Lowerlimit == Upperlimit -> axis is locked
         * Lowerlimit > Upperlimit -> axis is free
         * Lowerlimit < Upperlimit -> axis it limited in that range

      For 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
      :type value0: float
      :arg value1 (max): Set the maximum limit of the axis
      :type value1: float

      For PHY_CONE_TWIST_CONSTRAINT = 4:

      axis = 3..5 are constraint limits, high limit values
         * 3: X axis angle
         * 4: Y axis angle
         * 5: Z axis angle

      :arg value0 (min): Set the minimum limit of the axis
      :type value0: float
      :arg value1 (max): Set the maximum limit of the axis
      :type value1: float

      For PHY_GENERIC_6DOF_CONSTRAINT = 12:

      axis = 0..2 are constraint limits, with low/high limit value
         * 0: X axis position
         * 1: Y axis position
         * 2: Z axis position

      axis = 3..5 are relative constraint (Euler) angles in radians
         * 3: X axis angle
         * 4: Y axis angle
         * 5: Z axis angle

      :arg value0 (min): Set the minimum limit of the axis
      :type value0: float
      :arg value1 (max): Set the maximum limit of the axis
      :type value1: float

      axis = 6..8 are translational motors, with value0=target velocity, value1 = max motor force
         * 6: X axis position
         * 7: Y axis position
         * 8: Z axis position

      axis = 9..11 are rotational motors, with value0=target velocity, value1 = max motor force
         * 9: X axis angle
         * 10: Y axis angle
         * 11: Z axis angle

      :arg value0 (speed): Set the linear velocity of the axis
      :type value0: float Range: -10,000.00 to 10,000.00
      :arg value1 (force): Set the maximum force limit of the axis
      :type value1: float Range: -10,000.00 to 10,000.00

      axis = 12..14 are for linear springs on each of the position of freedom
         * 12: X axis position
         * 13: Y axis position
         * 14: Z axis position

      axis = 15..17 are for angular springs on each of the angle of freedom in radians
         * 15: X axis angle
         * 16: Y axis angle
         * 17: Z axis angle

      :arg value0 (stiffness): Set the stiffness of the spring
      :type value0: float
      :arg value1 (damping): Tendency of the spring to return to it's original position
      :type value1: float
                    1.0 = springs back to original position (no damping)
                    0.0 = don't springs back

   .. method:: getParam(axis)

      Get the contraint position or euler angle of a generic 6DOF constraint

      :arg axis:
      :type axis: integer

      axis = 0..2 are linear constraint values
         * 0: X axis position
         * 1: Y axis position
         * 2: Z axis position

      :return: position
      :rtype: float

      axis = 3..5 are relative constraint (Euler) angles in radians 
         * 3: X axis angle
         * 4: Y axis angle
         * 5: Z axis angle

      :return: angle
      :rtype: float

   .. attribute:: constraint_id

      Returns the contraint ID  (read only)

      :type: integer

   .. attribute:: constraint_type

      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`