123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
- .. _class_KinematicBody:
- KinematicBody
- =============
- **Inherits:** :ref:`PhysicsBody<class_physicsbody>` **<** :ref:`CollisionObject<class_collisionobject>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- Kinematic body 3D node.
- Member Functions
- ----------------
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_vector3>` | :ref:`get_floor_velocity<class_KinematicBody_get_floor_velocity>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_safe_margin<class_KinematicBody_get_safe_margin>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`KinematicCollision<class_kinematiccollision>` | :ref:`get_slide_collision<class_KinematicBody_get_slide_collision>` **(** :ref:`int<class_int>` slide_idx **)** |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_slide_count<class_KinematicBody_get_slide_count>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_on_ceiling<class_KinematicBody_is_on_ceiling>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_on_floor<class_KinematicBody_is_on_floor>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_on_wall<class_KinematicBody_is_on_wall>` **(** **)** const |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`KinematicCollision<class_kinematiccollision>` | :ref:`move_and_collide<class_KinematicBody_move_and_collide>` **(** :ref:`Vector3<class_vector3>` rel_vec **)** |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_vector3>` | :ref:`move_and_slide<class_KinematicBody_move_and_slide>` **(** :ref:`Vector3<class_vector3>` linear_velocity, :ref:`Vector3<class_vector3>` floor_normal=Vector3( 0, 0, 0 ), :ref:`float<class_float>` slope_stop_min_velocity=0.05, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398 **)** |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_safe_margin<class_KinematicBody_set_safe_margin>` **(** :ref:`float<class_float>` pixels **)** |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`test_move<class_KinematicBody_test_move>` **(** :ref:`Transform<class_transform>` from, :ref:`Vector3<class_vector3>` rel_vec **)** |
- +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Member Variables
- ----------------
- - :ref:`float<class_float>` **collision/safe_margin**
- Description
- -----------
- Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all (to other types of bodies, such a character or a rigid body, these are the same as a static body). They have however, two main uses:
- Simulated Motion: When these bodies are moved manually, either from code or from an AnimationPlayer (with process mode set to fixed), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
- Kinematic Characters: KinematicBody also has an api for moving objects (the :ref:`move<class_KinematicBody_move>` method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
- Member Function Description
- ---------------------------
- .. _class_KinematicBody_get_floor_velocity:
- - :ref:`Vector3<class_vector3>` **get_floor_velocity** **(** **)** const
- .. _class_KinematicBody_get_safe_margin:
- - :ref:`float<class_float>` **get_safe_margin** **(** **)** const
- .. _class_KinematicBody_get_slide_collision:
- - :ref:`KinematicCollision<class_kinematiccollision>` **get_slide_collision** **(** :ref:`int<class_int>` slide_idx **)**
- .. _class_KinematicBody_get_slide_count:
- - :ref:`int<class_int>` **get_slide_count** **(** **)** const
- .. _class_KinematicBody_is_on_ceiling:
- - :ref:`bool<class_bool>` **is_on_ceiling** **(** **)** const
- .. _class_KinematicBody_is_on_floor:
- - :ref:`bool<class_bool>` **is_on_floor** **(** **)** const
- .. _class_KinematicBody_is_on_wall:
- - :ref:`bool<class_bool>` **is_on_wall** **(** **)** const
- .. _class_KinematicBody_move_and_collide:
- - :ref:`KinematicCollision<class_kinematiccollision>` **move_and_collide** **(** :ref:`Vector3<class_vector3>` rel_vec **)**
- .. _class_KinematicBody_move_and_slide:
- - :ref:`Vector3<class_vector3>` **move_and_slide** **(** :ref:`Vector3<class_vector3>` linear_velocity, :ref:`Vector3<class_vector3>` floor_normal=Vector3( 0, 0, 0 ), :ref:`float<class_float>` slope_stop_min_velocity=0.05, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398 **)**
- .. _class_KinematicBody_set_safe_margin:
- - void **set_safe_margin** **(** :ref:`float<class_float>` pixels **)**
- .. _class_KinematicBody_test_move:
- - :ref:`bool<class_bool>` **test_move** **(** :ref:`Transform<class_transform>` from, :ref:`Vector3<class_vector3>` rel_vec **)**
|