mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Updated tutorial_physics_2d (markdown)
parent
064df099b4
commit
df90827c26
@ -88,7 +88,7 @@ To solve all these problems, Godot has a physics and collision engine that is we
|
||||
|
||||
<p align="center"><img src="images/collision_inheritance.png"></p>
|
||||
|
||||
### Creating a StaticBody2D
|
||||
### StaticBody2D
|
||||
|
||||
The simplest node in the physics engine is the StaticBody2D, which provides a static collision. This means that other objects can collide against it, but StaticBody2D will not move by itself or generate any kind of interaction when colliding other bodies. It's just there to be collided.
|
||||
|
||||
@ -122,3 +122,13 @@ In fact, what CollisionPolygon does is to decompose the polygon in convex shapes
|
||||
|
||||
<p align="center"><img src="images/decomposed.png"></p>
|
||||
|
||||
### KinematicBody2D
|
||||
|
||||
[Kinematic](class_kinematicbody2d) bodies are special types of bodies that are meant to be user-controlled. They are not affected by the physics at all (to other types of bodies, such a character or a rigidbody, these are the same as a staticbody). They have however, two main uses:
|
||||
|
||||
* **Simulated Motion**: When these bodies are moved manually, either from code or from an [AnimationPlayer](class_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). As an example, the 2d/platformer demo uses them for moving platforms.
|
||||
* **Kinematic Characters**: KinematicBody2D also has an api for moving objects (the move() function) while performing collision tests. This makes them really useful to implement characters that collide against a work, but that don't require advanced physics. A special [tutorial for this exists](tutorial_kinematic_char).
|
||||
|
||||
### RigidBody2D
|
||||
|
||||
This type of body simulates newtonian physics. It has mass, friction, and the 0,0 coordinates simulates the center of mass. When real physics are needed, [RigidBody2D](class_rigidbody2d) is the node to use. The motion of this body is affected by gravity and/or other bodies.
|
Loading…
Reference in New Issue
Block a user