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

bge.types.KX_VehicleWrapper.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 631075363ca232201027f520b668216ccae940f7 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
KX_VehicleWrapper(PyObjectPlus)
===============================

.. module:: bge.types

base class --- :class:`PyObjectPlus`

.. class:: KX_VehicleWrapper(PyObjectPlus)

   KX_VehicleWrapper

   TODO - description

   .. method:: addWheel(wheel, attachPos, downDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)

      Add a wheel to the vehicle

      :arg wheel: The object to use as a wheel.
      :type wheel: :class:`KX_GameObject` or a :class:`KX_GameObject` name
      :arg attachPos: The position to attach the wheel, relative to the chassis object center.
      :type attachPos: vector of 3 floats
      :arg downDir: The direction vector pointing down to where the vehicle should collide with the floor.
      :type downDir: vector of 3 floats
      :arg axleDir: The axis the wheel rotates around, relative to the chassis.
      :type axleDir: vector of 3 floats
      :arg suspensionRestLength: The length of the suspension when no forces are being applied.
      :type suspensionRestLength: float
      :arg wheelRadius: The radius of the wheel (half the diameter).
      :type wheelRadius: float
      :arg hasSteering: True if the wheel should turn with steering, typically used in front wheels.
      :type hasSteering: boolean


   .. method:: applyBraking(force, wheelIndex)

      Apply a braking force to the specified wheel

      :arg force: the brake force
      :type force: float

      :arg wheelIndex: index of the wheel where the force needs to be applied
      :type wheelIndex: integer


   .. method:: applyEngineForce(force, wheelIndex)

      Apply an engine force to the specified wheel

      :arg force: the engine force
      :type force: float

      :arg wheelIndex: index of the wheel where the force needs to be applied
      :type wheelIndex: integer


   .. method:: getConstraintId()

      Get the constraint ID

      :return: the constraint id
      :rtype: integer

   .. method:: getConstraintType()

      Returns the constraint type.

      :return: constraint type
      :rtype: integer

   .. method:: getNumWheels()

      Returns the number of wheels.

      :return: the number of wheels for this vehicle
      :rtype: integer

   .. method:: getWheelOrientationQuaternion(wheelIndex)

      Returns the wheel orientation as a quaternion.

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

      :return: TODO Description
      :rtype: TODO - type should be quat as per method name but from the code it looks like a matrix

   .. method:: getWheelPosition(wheelIndex)

      Returns the position of the specified wheel

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer
      :return: position vector
      :rtype: list[x, y, z]

   .. method:: getWheelRotation(wheelIndex)

      Returns the rotation of the specified wheel

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

      :return: the wheel rotation
      :rtype: float

   .. method:: setRollInfluence(rollInfluece, wheelIndex)

      Set the specified wheel's roll influence.
      The higher the roll influence the more the vehicle will tend to roll over in corners.

      :arg rollInfluece: the wheel roll influence
      :type rollInfluece: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

   .. method:: setSteeringValue(steering, wheelIndex)

      Set the specified wheel's steering

      :arg steering: the wheel steering
      :type steering: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

   .. method:: setSuspensionCompression(compression, wheelIndex)

      Set the specified wheel's compression

      :arg compression: the wheel compression
      :type compression: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

   .. method:: setSuspensionDamping(damping, wheelIndex)

      Set the specified wheel's damping

      :arg damping: the wheel damping
      :type damping: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

   .. method:: setSuspensionStiffness(stiffness, wheelIndex)

      Set the specified wheel's stiffness

      :arg stiffness: the wheel stiffness
      :type stiffness: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer

   .. method:: setTyreFriction(friction, wheelIndex)

      Set the specified wheel's tyre friction

      :arg friction: the tyre friction
      :type friction: float

      :arg wheelIndex: the wheel index
      :type wheelIndex: integer