mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
343 lines
17 KiB
ReStructuredText
343 lines
17 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||
.. DO NOT EDIT THIS FILE, but the VehicleWheel.xml source instead.
|
||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||
|
||
.. _class_VehicleWheel:
|
||
|
||
VehicleWheel
|
||
============
|
||
|
||
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
Objeto físico que simula el comportamiento de una rueda.
|
||
|
||
Descripción
|
||
----------------------
|
||
|
||
This node needs to be used as a child node of :ref:`VehicleBody<class_VehicleBody>` and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
|
||
|
||
\ **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another :ref:`PhysicsBody<class_PhysicsBody>` class.
|
||
|
||
Tutoriales
|
||
--------------------
|
||
|
||
- `3D Truck Town Demo <https://godotengine.org/asset-library/asset/524>`__
|
||
|
||
Propiedades
|
||
----------------------
|
||
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`brake<class_VehicleWheel_property_brake>` | ``0.0`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`damping_compression<class_VehicleWheel_property_damping_compression>` | ``0.83`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`damping_relaxation<class_VehicleWheel_property_damping_relaxation>` | ``0.88`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`engine_force<class_VehicleWheel_property_engine_force>` | ``0.0`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`steering<class_VehicleWheel_property_steering>` | ``0.0`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`suspension_max_force<class_VehicleWheel_property_suspension_max_force>` | ``6000.0`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`suspension_stiffness<class_VehicleWheel_property_suspension_stiffness>` | ``5.88`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`suspension_travel<class_VehicleWheel_property_suspension_travel>` | ``5.0`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`bool<class_bool>` | :ref:`use_as_steering<class_VehicleWheel_property_use_as_steering>` | ``false`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`bool<class_bool>` | :ref:`use_as_traction<class_VehicleWheel_property_use_as_traction>` | ``false`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`wheel_friction_slip<class_VehicleWheel_property_wheel_friction_slip>` | ``10.5`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`wheel_radius<class_VehicleWheel_property_wheel_radius>` | ``0.5`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`wheel_rest_length<class_VehicleWheel_property_wheel_rest_length>` | ``0.15`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
| :ref:`float<class_float>` | :ref:`wheel_roll_influence<class_VehicleWheel_property_wheel_roll_influence>` | ``0.1`` |
|
||
+---------------------------+-------------------------------------------------------------------------------+------------+
|
||
|
||
Métodos
|
||
--------------
|
||
|
||
+-------------------------------+-----------------------------------------------------------------------------------------+
|
||
| :ref:`Spatial<class_Spatial>` | :ref:`get_contact_body<class_VehicleWheel_method_get_contact_body>` **(** **)** |const| |
|
||
+-------------------------------+-----------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_rpm<class_VehicleWheel_method_get_rpm>` **(** **)** |const| |
|
||
+-------------------------------+-----------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_skidinfo<class_VehicleWheel_method_get_skidinfo>` **(** **)** |const| |
|
||
+-------------------------------+-----------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_in_contact<class_VehicleWheel_method_is_in_contact>` **(** **)** |const| |
|
||
+-------------------------------+-----------------------------------------------------------------------------------------+
|
||
|
||
Descripciones de Propiedades
|
||
--------------------------------------------------------
|
||
|
||
.. _class_VehicleWheel_property_brake:
|
||
|
||
- :ref:`float<class_float>` **brake**
|
||
|
||
+-----------+------------------+
|
||
| *Default* | ``0.0`` |
|
||
+-----------+------------------+
|
||
| *Setter* | set_brake(value) |
|
||
+-----------+------------------+
|
||
| *Getter* | get_brake() |
|
||
+-----------+------------------+
|
||
|
||
Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the :ref:`RigidBody.mass<class_RigidBody_property_mass>` of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_damping_compression:
|
||
|
||
- :ref:`float<class_float>` **damping_compression**
|
||
|
||
+-----------+--------------------------------+
|
||
| *Default* | ``0.83`` |
|
||
+-----------+--------------------------------+
|
||
| *Setter* | set_damping_compression(value) |
|
||
+-----------+--------------------------------+
|
||
| *Getter* | get_damping_compression() |
|
||
+-----------+--------------------------------+
|
||
|
||
La amortiguación aplicada al resorte cuando éste se está comprimiendo. Este valor debe estar entre 0.0 (sin amortiguación) y 1.0. Un valor de 0.0 significa que el coche seguirá rebotando mientras el muelle mantiene su energía. Un buen valor para esto es alrededor de 0.3 para un coche normal, 0.5 para un coche de carreras.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_damping_relaxation:
|
||
|
||
- :ref:`float<class_float>` **damping_relaxation**
|
||
|
||
+-----------+-------------------------------+
|
||
| *Default* | ``0.88`` |
|
||
+-----------+-------------------------------+
|
||
| *Setter* | set_damping_relaxation(value) |
|
||
+-----------+-------------------------------+
|
||
| *Getter* | get_damping_relaxation() |
|
||
+-----------+-------------------------------+
|
||
|
||
La amortiguación aplicada al resorte al relajarse. Este valor debe estar entre 0.0 (sin amortiguación) y 1.0. Este valor siempre debe ser ligeramente superior a la propiedad :ref:`damping_compression<class_VehicleWheel_property_damping_compression>`. Para un valor de :ref:`damping_compression<class_VehicleWheel_property_damping_compression>` de 0,3, pruebe un valor de relajación de 0,5.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_engine_force:
|
||
|
||
- :ref:`float<class_float>` **engine_force**
|
||
|
||
+-----------+-------------------------+
|
||
| *Default* | ``0.0`` |
|
||
+-----------+-------------------------+
|
||
| *Setter* | set_engine_force(value) |
|
||
+-----------+-------------------------+
|
||
| *Getter* | get_engine_force() |
|
||
+-----------+-------------------------+
|
||
|
||
Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The :ref:`RigidBody.mass<class_RigidBody_property_mass>` of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.
|
||
|
||
\ **Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears.
|
||
|
||
A negative value will result in the wheel reversing.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_steering:
|
||
|
||
- :ref:`float<class_float>` **steering**
|
||
|
||
+-----------+---------------------+
|
||
| *Default* | ``0.0`` |
|
||
+-----------+---------------------+
|
||
| *Setter* | set_steering(value) |
|
||
+-----------+---------------------+
|
||
| *Getter* | get_steering() |
|
||
+-----------+---------------------+
|
||
|
||
El ángulo de dirección del volante. Si lo fijamos en un valor distinto de cero, el vehículo girará cuando esté en movimiento.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_suspension_max_force:
|
||
|
||
- :ref:`float<class_float>` **suspension_max_force**
|
||
|
||
+-----------+---------------------------------+
|
||
| *Default* | ``6000.0`` |
|
||
+-----------+---------------------------------+
|
||
| *Setter* | set_suspension_max_force(value) |
|
||
+-----------+---------------------------------+
|
||
| *Getter* | get_suspension_max_force() |
|
||
+-----------+---------------------------------+
|
||
|
||
The maximum force the spring can resist. This value should be higher than a quarter of the :ref:`RigidBody.mass<class_RigidBody_property_mass>` of the :ref:`VehicleBody<class_VehicleBody>` or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_suspension_stiffness:
|
||
|
||
- :ref:`float<class_float>` **suspension_stiffness**
|
||
|
||
+-----------+---------------------------------+
|
||
| *Default* | ``5.88`` |
|
||
+-----------+---------------------------------+
|
||
| *Setter* | set_suspension_stiffness(value) |
|
||
+-----------+---------------------------------+
|
||
| *Getter* | get_suspension_stiffness() |
|
||
+-----------+---------------------------------+
|
||
|
||
Este valor define la rigidez de la suspensión. Usa un valor inferior a 50 para un coche todoterreno, un valor entre 50 y 100 para un coche de carreras y prueba algo alrededor de 200 para algo como un coche de Fórmula 1.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_suspension_travel:
|
||
|
||
- :ref:`float<class_float>` **suspension_travel**
|
||
|
||
+-----------+------------------------------+
|
||
| *Default* | ``5.0`` |
|
||
+-----------+------------------------------+
|
||
| *Setter* | set_suspension_travel(value) |
|
||
+-----------+------------------------------+
|
||
| *Getter* | get_suspension_travel() |
|
||
+-----------+------------------------------+
|
||
|
||
Esta es la distancia que puede recorrer la suspensión. Como las unidades Godot equivalen a metros, mantenga este ajuste relativamente bajo. Pruebe con un valor entre 0,1 y 0,3 dependiendo del tipo de coche.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_use_as_steering:
|
||
|
||
- :ref:`bool<class_bool>` **use_as_steering**
|
||
|
||
+-----------+----------------------------+
|
||
| *Default* | ``false`` |
|
||
+-----------+----------------------------+
|
||
| *Setter* | set_use_as_steering(value) |
|
||
+-----------+----------------------------+
|
||
| *Getter* | is_used_as_steering() |
|
||
+-----------+----------------------------+
|
||
|
||
If ``true``, this wheel will be turned when the car steers. This value is used in conjunction with :ref:`VehicleBody.steering<class_VehicleBody_property_steering>` and ignored if you are using the per-wheel :ref:`steering<class_VehicleWheel_property_steering>` value instead.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_use_as_traction:
|
||
|
||
- :ref:`bool<class_bool>` **use_as_traction**
|
||
|
||
+-----------+----------------------------+
|
||
| *Default* | ``false`` |
|
||
+-----------+----------------------------+
|
||
| *Setter* | set_use_as_traction(value) |
|
||
+-----------+----------------------------+
|
||
| *Getter* | is_used_as_traction() |
|
||
+-----------+----------------------------+
|
||
|
||
If ``true``, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with :ref:`VehicleBody.engine_force<class_VehicleBody_property_engine_force>` and ignored if you are using the per-wheel :ref:`engine_force<class_VehicleWheel_property_engine_force>` value instead.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_wheel_friction_slip:
|
||
|
||
- :ref:`float<class_float>` **wheel_friction_slip**
|
||
|
||
+-----------+--------------------------+
|
||
| *Default* | ``10.5`` |
|
||
+-----------+--------------------------+
|
||
| *Setter* | set_friction_slip(value) |
|
||
+-----------+--------------------------+
|
||
| *Getter* | get_friction_slip() |
|
||
+-----------+--------------------------+
|
||
|
||
Esto determina cuánto agarre tiene esta rueda. Se combina con el ajuste de la fricción de la superficie con la que la rueda está en contacto. 0.0 significa que no hay agarre, 1.0 es el agarre normal. Para una configuración de coche a la deriva, intente ajustar el agarre de las ruedas traseras ligeramente más bajo que el de las ruedas delanteras, o utilice un valor más bajo para simular el desgaste de los neumáticos.
|
||
|
||
Lo mejor es ajustarlo a 1.0 al comenzar.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_wheel_radius:
|
||
|
||
- :ref:`float<class_float>` **wheel_radius**
|
||
|
||
+-----------+-------------------+
|
||
| *Default* | ``0.5`` |
|
||
+-----------+-------------------+
|
||
| *Setter* | set_radius(value) |
|
||
+-----------+-------------------+
|
||
| *Getter* | get_radius() |
|
||
+-----------+-------------------+
|
||
|
||
El radio de la rueda en metros.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_wheel_rest_length:
|
||
|
||
- :ref:`float<class_float>` **wheel_rest_length**
|
||
|
||
+-----------+-----------------------------------+
|
||
| *Default* | ``0.15`` |
|
||
+-----------+-----------------------------------+
|
||
| *Setter* | set_suspension_rest_length(value) |
|
||
+-----------+-----------------------------------+
|
||
| *Getter* | get_suspension_rest_length() |
|
||
+-----------+-----------------------------------+
|
||
|
||
Esta es la distancia en metros a la que se baja la rueda desde su punto de origen. No lo pongas a 0.0 y mueve la rueda a su posición, en su lugar mueve el punto de origen de tu rueda (el gizmo en Godot) a la posición que la rueda tomará al descender, luego usa la longitud de reposo para mover la rueda hacia abajo a la posición en la que debería estar cuando el auto esté en reposo.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_property_wheel_roll_influence:
|
||
|
||
- :ref:`float<class_float>` **wheel_roll_influence**
|
||
|
||
+-----------+---------------------------+
|
||
| *Default* | ``0.1`` |
|
||
+-----------+---------------------------+
|
||
| *Setter* | set_roll_influence(value) |
|
||
+-----------+---------------------------+
|
||
| *Getter* | get_roll_influence() |
|
||
+-----------+---------------------------+
|
||
|
||
Este valor afecta al balanceo de su vehículo. Si se establece en 1,0 para todas las ruedas, tu vehículo será propenso a volcarse, mientras que un valor de 0.0 resistirá el balanceo de la carrocería.
|
||
|
||
Descripciones de Métodos
|
||
------------------------------------------------
|
||
|
||
.. _class_VehicleWheel_method_get_contact_body:
|
||
|
||
- :ref:`Spatial<class_Spatial>` **get_contact_body** **(** **)** |const|
|
||
|
||
Returns the contacting body node if valid in the tree, as :ref:`Spatial<class_Spatial>`. At the moment, :ref:`GridMap<class_GridMap>` is not supported so the node will be always of type :ref:`PhysicsBody<class_PhysicsBody>`.
|
||
|
||
Returns ``null`` if the wheel is not in contact with a surface, or the contact body is not a :ref:`PhysicsBody<class_PhysicsBody>`.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_method_get_rpm:
|
||
|
||
- :ref:`float<class_float>` **get_rpm** **(** **)** |const|
|
||
|
||
Devuelve la velocidad de rotación de la rueda en revoluciones por minuto.
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_method_get_skidinfo:
|
||
|
||
- :ref:`float<class_float>` **get_skidinfo** **(** **)** |const|
|
||
|
||
Devuelve un valor entre 0.0 y 1.0 que indica si esta rueda está patinando. 0.0 es patinar (la rueda ha perdido el agarre, por ejemplo, en un terreno helado), 1.0 significa no patinar (la rueda tiene un agarre total, por ejemplo, en una carretera de asfalto seco).
|
||
|
||
----
|
||
|
||
.. _class_VehicleWheel_method_is_in_contact:
|
||
|
||
- :ref:`bool<class_bool>` **is_in_contact** **(** **)** |const|
|
||
|
||
Devuelve ``true`` si esta rueda está en contacto con una superficie.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
||
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
||
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|