Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:behaviors:physics2 [2019/01/14 04:14]
lizard-13 Add information about revolute joints
gdevelop5:behaviors:physics2 [2019/05/29 12:00] (current)
akbarhabeebb [Gear Joint] Typo
Line 3: Line 3:
 The Physics behavior can be added to objects to make them move in a realistic way, following the laws of physics. In the background, the extension makes use of Box2D, a fast and very complete rigid bodies physics simulation library.\\ The Physics behavior can be added to objects to make them move in a realistic way, following the laws of physics. In the background, the extension makes use of Box2D, a fast and very complete rigid bodies physics simulation library.\\
 \\ \\
-The behavior is composed of three big concepts: the world that hold the bodies, the bodies itself, and joints that link bodies. All of them are detailed explained ​along this reading.+The behavior is composed of three big concepts: the world that hold the bodies, the bodies itself, and joints that link bodies. All of them are detailed explained ​in this reading.
 \\ \\
 <note important>​Limitation:​ As stated above, the extension simulates rigid bodies physics, it means that bodies can't be deformed. Things like soft shapes, clothes, and fluids are not supported.</​note>​ <note important>​Limitation:​ As stated above, the extension simulates rigid bodies physics, it means that bodies can't be deformed. Things like soft shapes, clothes, and fluids are not supported.</​note>​
Line 13: Line 13:
 \\ \\
 The world has 3 properties: The world has 3 properties:
-  * **Gravity**:​ Consist of two components (X and Y), and works like our gravity does, add a force to every object, pushing them in the given direction. Objects support a gravity scale factor too, more on this in the bodies section. +  * **Gravity**:​ Consist of two components (X and Y), and works like our gravity does, adds a force to every object, pushing them in the given direction. Objects support a gravity scale factor too, more on this in the bodies section. 
-  * **Timescale**:​ It defines the scale of time the simulation will use. With a timescale = 0.5 the simulation will run at half the speed, with a timescale = 2 the simulation will be twice as fast, and if timescale ​is zero the simulation will pause. Super useful for bullet time effects!+  * **Timescale**:​ It defines the scale of time the simulation will use. With a timescale = 0.5the simulation will run at half the speed, with a timescale = 2the simulation will be twice as fast, and if timescale ​= 0, the simulation will pause. Super useful for bullet time effects!
   * **Scale**: GDevelop distances and sizes are defined in pixels but the physics engine uses meters, to make the conversion a scale factor must be set (again, it has two components, scale X and Y). The scale numbers mean how many pixels a meter is, for example, a scale of 50 means that a distance of 50 pixels in GDevelop is converted to 1 meter in the physics world.   * **Scale**: GDevelop distances and sizes are defined in pixels but the physics engine uses meters, to make the conversion a scale factor must be set (again, it has two components, scale X and Y). The scale numbers mean how many pixels a meter is, for example, a scale of 50 means that a distance of 50 pixels in GDevelop is converted to 1 meter in the physics world.
  
Line 29: Line 29:
 GDevelop supports three basic body types: GDevelop supports three basic body types:
   * **Dynamic**:​ The most common type, dynamic bodies are affected by gravity, can collide with other dynamic, static, and kinematic bodies. You can apply forces and impulses on them, and modify its velocity as well. Almost anything that must move should be a dynamic body.   * **Dynamic**:​ The most common type, dynamic bodies are affected by gravity, can collide with other dynamic, static, and kinematic bodies. You can apply forces and impulses on them, and modify its velocity as well. Almost anything that must move should be a dynamic body.
-  * **Static**: Static objects are not affected by gravity, and you can't move them using forces, impulses nor modifying its velocity. Can collide with dynamics objects only, ignoring kinematics and other static bodies. They are meant to be used for static world geometry, as the ground, non-movable walls and platforms.+  * **Static**: Static objects are not affected by gravity, and you can't move them using forces, impulses nor modifying its velocity. Can collide with dynamics objects only, ignoring kinematics and other static bodies. They are meant to be used for static world geometry, as the ground, non-movable wallsand platforms.
   * **Kinematic**:​ Kinematics are very specialized,​ as static objects they won't be affected by gravity nor forces or impulses, but, like dynamics, you can move them through their velocity. Kinematics collide with dynamic objects only and are useful to simulate movable walls and platforms.   * **Kinematic**:​ Kinematics are very specialized,​ as static objects they won't be affected by gravity nor forces or impulses, but, like dynamics, you can move them through their velocity. Kinematics collide with dynamic objects only and are useful to simulate movable walls and platforms.
  
Line 41: Line 41:
 ###Body Shape ###Body Shape
  
-Body shape options determine the body form and size, and depending on the shape type you have different options to set the dimensions:​ +Body shape options determine the body form and size, anddepending on the shape typeyou have different options to set the dimensions:​ 
-  * **Box**: An axis-aligned rectangle centered on the object, if custom width and height are not set the object size is used +  * **Box**: ​*An axis-aligned rectangle centered on the object*, if custom width and height are not setthe object size is used. 
-  * **Circle**: A circle centered on the object, if a custom ​radio is not set it will be calculated as an average from the object width and height, if the object is squared ​the result will be an inscribed circle inside the object bounding box. +  * **Circle**: ​*A circle centered on the object*, if a custom ​radius ​is not set it will be calculated as an average from the object width and height. If the object is in the form of a square, ​the result will be an inscribed circle inside the object bounding box. 
-  * **Edge**: A thin line centered in the object, since this shape has no volume it doesn'​t work well as a dynamic body, it's meant to be used for static geometry, as ground and platforms. If customs ​length and angle are not set the edge will be a horizontal line with length equal to the object width. +  * **Edge**: ​*A thin line centered in the object*, since this shape has no volume it doesn'​t work well as a dynamic body, it's meant to be used for static geometry, as ground and platforms. If a custom ​length and angle are not setthe edge will be a horizontal line with length equal to the object width. 
-  * **Polygon**: ​The polygon shape lets you define a custom shape through vertices. The polygon must be convexif this condition fails the shape falls back to a default box. The number of vertices must be greater or equal than 3 (otherwise it can't be convex) and equal or less than 8 (the maximum number of vertices supported per polygon): 3 ≤ number of vertices ≤ 8.+  * **Polygon**: ​*A custom shape through vertices*. The polygon must be convex ​and if this condition failsthe shape falls back to a default box. The number of vertices must be greater ​than or equal to 3 (otherwise it can't be convex) and less than or equal to 8 (the maximum number of vertices supported per polygon): 3 ≤ number of vertices ≤ 8.
  
 In addition to custom shape type and dimension, the body shape supports two extra options: In addition to custom shape type and dimension, the body shape supports two extra options:
   * **Offset**: The offset has two components (X and Y) and can be used to move the shape from the object center.   * **Offset**: The offset has two components (X and Y) and can be used to move the shape from the object center.
-  * **Scale**: You can scale the shape too. It will scale the shape custom dimensions and offset. If you don't use custom dimensions, for example you use the box shape and let the width and height be equal to the object original size, there'​s no need to change the shape scale as the scaling will be done automatically. If the shape type is a polygon the scale will modify the vertices position too, and the scaling origin will be the **Polygon Origin**, if you set the polygon origin to `Center` and scale the shape down the vertices will be scaled down to/​in-direction-of the center of the object.+  * **Scale**: You can scale the shape too. It will scale the shape'​s ​custom dimensions and offset. If you don't use custom dimensions, for exampleyou use the box shape and let the width and height be equal to the object original size, there'​s no need to change the shape scale as the scaling will be done automatically. If the shape type is a polygon the scale will modify the vertices position too, and the scaling origin will be the **Polygon Origin**. If you set the polygon origin to `Center`and scale the shape downthe vertices will be scaled down to/​in-direction-of the center of the object.
  
 ###Body Settings ###Body Settings
  
-Besides the type and shape, ​physic ​bodies have some extra settings that determine how the body will behave on collision, how the gravity will affect them and the energy they lose by air friction. Each setting is explained below: +Besides the type and shape, ​physics ​bodies have some extra settings that determine how the body will behave on collision, how the gravity will affect them and the energy they lose by air friction. Each setting is explained below: 
-  * **Density**:​ The density determines the body mass. The general formula is `density = mass/area`. Two bodies with the same density but different areas/size will have different mass, so you have to take the density into account when resizing objects.\\ \\ __Density can't be negative!__+  * **Density**:​ The density determines the body mass. The general formula is `density = mass/​volume`,​ but since there is no third dimension, we can safely assume it to be `density = mass/area`. Two bodies with the same density but different areas/size will have different mass, so you have to take the density into account when resizing objects.\\ \\ __Density can't be negative!__
  
-  * **Friction**:​ The friction adds a force to bodies in contact in the opposite direction of their movement. The higher the friction the faster the objects will slow down on contact. To understand it better, a platform made of sand will have friction close to 1 (very high), while a platform made of ice will have a friction factor close to zero.\\ \\ __Friction can't be negative!__\\ \\ When two objects ​make contact, the total friction is calculated ​mixing ​the friction ​of the colliding objects through the formula: `friction = sqrt(frictionA * frictionB)`+  * **Friction**:​ The friction adds a force to the bodies in contactin the direction ​opposite ​to their direction of movement. The higher the frictionthe faster the objects will slow down on contact. To understand it better, a platform made of sand will have friction close to 1 (very high), while a platform made of icewill have a friction factor close to zero.\\ \\ __Friction can't be negative!__\\ \\ When two objects ​are in contact, the total friction is calculated ​using the frictions ​of the colliding objects through the formula: `friction = sqrt(frictionA * frictionB)`
  
-  * **Restitution**:​ Determines how much energy the object will keep or lose in each collision. A value of zero means the collisions will be perfectly inelastic and the object won't bounce at all. While a restitution = 1 means the collisions will be perfectly elastic, and the object will bounce with the same energy each time, imagine ​a ball bouncing ​in the ground and always ​reach the same height, forever. Values of restitution greater than 1 are valid but will make the object gain energy on each collision, and the simulation will probably run out of control.\\ \\ __Restitution can't be negative!__\\ \\ When two objects make contact, the total restitution is calculated ​mixing ​the restitution ​of the colliding objects through the formula: `restitution = max(restitutionA,​ restitutionB)`+  * **Restitution**:​ Determines how much energy the object will keep or lose in each collision. A value of zero means the collisions will be perfectly inelastic and the object won't bounce at all. While a restitution = 1 means the collisions will be perfectly elastic, and the object will bounce with the same energy each time. Imagine ​a ball bouncing ​off the groundand always ​reaching ​the same height. Values of restitution greater than 1 are valid but will make the object gain energy on each collision, and the simulation will probably run out of control.\\ \\ __Restitution can't be negative!__\\ \\ When two objects make contact, the total restitution is calculated ​using the restitutions ​of the colliding objects through the formula: `restitution = max(restitutionA,​ restitutionB)`
  
-  * **Linear Damping**: The linear damping reduces the object velocity all the time, the higher the value the faster it slows down the objects. You can imagine it as the air viscosity, very high values would even simulate the object to move in liquid.\\ \\ __Although you can use any value, negative damping will make the object to gain velocity on each step, generating a non-physical behavior__.+  * **Linear Damping**: The linear damping reduces the object velocity all the time. The higher the valuethe faster it slows down the objects. You can imagine it as the air viscosity, very high values would even simulate the object to move in liquid.\\ \\ __Although you can use any value, negative damping will make the object to gain velocity on each step, generating a non-physical behavior__.
  
-  * **Angular Damping**: Analogous to the linear damping, but instead slowing down the object velocity it slows down the angular velocity, making the object to rotate slower each step.\\ \\ __Although you can use any value, negative damping will make the object to gain angular velocity on each step, generating a non-physical behavior__.+  * **Angular Damping**: Analogous to the linear damping, but instead slowing down the object's linear ​velocity it slows down the angular velocity, making the object to rotate slower each step.\\ \\ __Although you can use any value, negative damping will make the object to gain angular velocity on each step, generating a non-physical behavior__.
  
   * **Gravity Scale**: This factor is multiplied by the world gravity to determine the gravity applied to the object. Note that this is a number and not a vector, you can't change the orientation of the gravity, just the magnitude and sense. Any number is valid, some examples: If the gravity scale is 1 the gravity applied will be the world gravity, if it's 2 the gravity will be twice as strong for this object, if it's 0.5 the gravity will be twice as weak, if it's 0 the object won't be affected by gravity, and if it's -1 the gravity will be inverted.   * **Gravity Scale**: This factor is multiplied by the world gravity to determine the gravity applied to the object. Note that this is a number and not a vector, you can't change the orientation of the gravity, just the magnitude and sense. Any number is valid, some examples: If the gravity scale is 1 the gravity applied will be the world gravity, if it's 2 the gravity will be twice as strong for this object, if it's 0.5 the gravity will be twice as weak, if it's 0 the object won't be affected by gravity, and if it's -1 the gravity will be inverted.
Line 69: Line 69:
 ###Layers & Masks ###Layers & Masks
  
-Layers and masks are the way to filter collisions between objects. Imagine you're building a zombies game, and you want your player to collide with the ground, and want the zombies to collide with the player and with the ground as well, but you don't want zombies to collide with other zombies, you need collision filters.+Layers and masks are the way to filter collisions between objects. Imagine you're building a zombies game, and you want your player to collide with the ground, and want the zombies to collide with the player and with the ground as well, but you don't want zombies to collide with other zombies, for such a case, you need collision filters.
  
-How filters work?, there is one rule only:+How do filters work? 
 +There is just a single ​rule:
 <note important>​Two objects A and B can collide if any layer of A matches any mask of B **and** any layer of B matches any mask of A</​note>​ <note important>​Two objects A and B can collide if any layer of A matches any mask of B **and** any layer of B matches any mask of A</​note>​
  
-Here is a possible solution to the zombies problem: +Here is a possible solution to the above zombies problem: 
-  * Ground: Enable the first layerand the first and second masks. +  * Ground: Enable the first layer and the first and second masks. 
-  * Player: Enable the first layerand the first and second masks. +  * Player: Enable the first layer and the first and second masks. 
-  * Zombie: Enable the second layerand the first mask only.+  * Zombie: Enable the second layer and the first mask only.
 Why does it work? Why does it work?
   * Ground & Player: A ground layer matches a player mask (first) **and** a player layer matches a ground mask (first)   * Ground & Player: A ground layer matches a player mask (first) **and** a player layer matches a ground mask (first)
Line 88: Line 89:
 ###Movement ###Movement
  
-After setting up your objects it's time to start the simulation: gravity will start to push things, objects will move and collide, but you can't interact with your game at all. It's time to move the objects by yourselfand to do that you have to use the events system, here are some useful actions to interact with the objects and move them in the way you want:+After setting up your objects it's time to start the simulation: gravity will start to push things, objects will move and collide, but you can't interact with your game at all. It's time to move the objects by yourself and to do that you have to use the events system. Here are some useful actions to interact with the objects and move them in the way you want:
  
-<note warning>​GDevelop built-in forces are not suited for the Physics behavior, use the forces specific for physics</​note>​+<note warning>​GDevelop built-in forces are not suited for the Physics behavior, to set the linear velocity, use the forces specific for physics ​or the physics actions.</​note>​
  
-  * **Forces**: Forces change the movement of an object and are meant to be used for some time to generate an apreciable ​effect. The velocity the object ​gain when you apply on it a force depends on the force length ​and the object mass. A heavy object will move slower than a lighter one applying ​the same force on both.\\ \\ +  * **Forces**: Forces change the movement of an object and are meant to be used for some time to generate an appreciable ​effect. The velocity the object ​gains when you apply on it a force depends on the magnitude of the force and the object mass. A heavy object will move slower than a lighter one if the same force is applied ​on both the masses.\\ \\ 
-__To add a force an application point must be set.__\\ \\ +__To add a forcean application point must be set.__\\ \\ 
-  * **Torques**:​ The analogous of forces but for rotation. A toque will generate an angular acceleration on the object, making it rotate faster or slower along the time. +  * **Torques**:​ The analogous of forces but for rotation. A torque ​will generate an angular acceleration on the object, making it rotate faster or slower along the time. 
-  * **Impulses**:​ Similar to forces, but don't depend on the time step, adding an "​amount"​ of velocity instantly. They'​re meant to be used a single time. A common use could be to simulate jumps: each time the jump button is pressed add an impulse upwards.\\ \\+  * **Impulses**:​ Similar to forces, but don't depend on the time step, instead, adding an "​amount"​ of velocity instantly. They'​re meant to be used a single time. A common use could be to simulate jumps: each time the jump button is pressed add an impulse upwards.\\ \\
 __To add an impulse an application point must be set.__\\ \\ __To add an impulse an application point must be set.__\\ \\
   * **Angular Impulses**: The analogous of impulses but for rotation. Change the rotation speed of an object instantly.   * **Angular Impulses**: The analogous of impulses but for rotation. Change the rotation speed of an object instantly.
-  * **Velocity**:​ You can modify the velocity of an object directly. For example, you can make your character walk with constant speed changing ​the velocity while a movement button is pressed.+  * **Velocity**:​ You can modify the velocity of an object directly. For example, you can make your character walk with constant speed and then change ​the velocity while a movement button is pressed.
   * **Angular Velocity**: You can set the angular velocity (rotation speed) directly too.   * **Angular Velocity**: You can set the angular velocity (rotation speed) directly too.
  
Line 111: Line 112:
 Joints are restrictions given to the objects to make them follow extra rules of movement. Some joints make the objects rotate around a fixed point, others keep two objects together, complex ones simulate vehicle wheels limiting the distance between the bodies but allowing them to rotate freely. Joints are restrictions given to the objects to make them follow extra rules of movement. Some joints make the objects rotate around a fixed point, others keep two objects together, complex ones simulate vehicle wheels limiting the distance between the bodies but allowing them to rotate freely.
  
-When you create a joint you can pass a variable name, if you do it GD will store the joint unique identification number (ID) in the given variable. Using the joint ID you can modify it after the creation, check its values and remove it. Imagine you create a joint to stick a key to a rope attached to the roof, if you save the joint ID in a variable then you can check if an object collides with the rope, and remove the joint using the saved ID to make the key fall down.+**Joint ID**:\\ 
 +When you create a joint you can pass a variable name, if you do it GD will store the joint unique identification number (ID) in the given variable. Using the joint IDyou can modify it after the creation, check its values and remove it. Imagine you create a joint to stick a key to a rope attached to the roof, if you save the joint ID in a variable then you can check if an object collides with the rope, and remove the joint using the saved ID to make the key fall down. 
 +<​note>​A joint ID will be always a number greater than zero.</​note>​
  
 Usually, you will need two objects to define a joint (in the previous example the rope and the key), but there are "​exceptions",​ check the explanation given in the Revolute joint if you want to know more. Usually, you will need two objects to define a joint (in the previous example the rope and the key), but there are "​exceptions",​ check the explanation given in the Revolute joint if you want to know more.
Line 118: Line 121:
   * **Joint first/​second object**: Conditions that let you pick objects if they are the first or second object the joint is attached to.   * **Joint first/​second object**: Conditions that let you pick objects if they are the first or second object the joint is attached to.
   * **Joint first/​second anchor X/Y**: Expressions to get the position of the first or second object anchor point the joint is attached at.   * **Joint first/​second anchor X/Y**: Expressions to get the position of the first or second object anchor point the joint is attached at.
-  * **Joint reaction force/​torque**:​ Conditions and expressions to check the joint reaction force or torque, this value is a measure of how much far away is the joint from its equilibrium state. If the joint reaction force is too high it means the joint has been separated from the equilibrium position through a considerable force. Useful to make breakable joints.+  * **Joint reaction force/​torque**:​ Conditions and expressions to check the joint reaction force or torque, this value is a measure of how far away is the joint from its equilibrium state. If the joint reaction force is too high it means the joint has been separated from the equilibrium position through a considerable force. Useful to make breakable joints.
   * **Remove joint**: Action to remove the specified joint. If the joint is one of the children of a gear joint the gear will be also removed. If any of the objects the joint is attached to is deleted the joint will be deleted too.   * **Remove joint**: Action to remove the specified joint. If the joint is one of the children of a gear joint the gear will be also removed. If any of the objects the joint is attached to is deleted the joint will be deleted too.
  
Line 138: Line 141:
 ###Revolute Joint ###Revolute Joint
  
-Revolute joints work like "​pins",​ they make an object ​to rotate around a point. +Revolute joints work like "pins" and are also known as "​hinges", they make the objects ​to rotate around a point. 
-There are two types of revolute joints, in the end they are the same, but there'​s ​a small difference:+There are two types of revolute joints, in the endthey are almost ​the same, with a small difference:
   * **Revolute joint between two objects**: It "​pins"​ two objects, the objects will move together in a way their anchor points overlap, and each object will rotate around their anchor point. Imagine that you pin two cards together and throw them so they move and rotate freely around the pin.   * **Revolute joint between two objects**: It "​pins"​ two objects, the objects will move together in a way their anchor points overlap, and each object will rotate around their anchor point. Imagine that you pin two cards together and throw them so they move and rotate freely around the pin.
   * **Revolute joint in a single object**: Joints usually work between two objects, this is one of the exceptions. This joint needs a single object and its anchor point, and pin the object at the given fixed position. Think of it like pinning a note in a wall, the note can rotate around the pin but can't move.   * **Revolute joint in a single object**: Joints usually work between two objects, this is one of the exceptions. This joint needs a single object and its anchor point, and pin the object at the given fixed position. Think of it like pinning a note in a wall, the note can rotate around the pin but can't move.
Line 147: Line 150:
   * **Angle limits**: If enabled the rotation will be restricted between the minimum and maximum angles. Note that both angles are relative to the first object.   * **Angle limits**: If enabled the rotation will be restricted between the minimum and maximum angles. Note that both angles are relative to the first object.
   * **Reference angle**: The angle between the objects that will be considered as zero. It offsets all the angle properties. If the reference angle is 15 degrees, asking for the current joint angle when the angle between the objects is 15 degrees in world coordinates will return 0, and set the maximum angle to 30 will set it to 45 (relative to the first object).   * **Reference angle**: The angle between the objects that will be considered as zero. It offsets all the angle properties. If the reference angle is 15 degrees, asking for the current joint angle when the angle between the objects is 15 degrees in world coordinates will return 0, and set the maximum angle to 30 will set it to 45 (relative to the first object).
-  * **Minimum angle**: The minimum angle between the objects, relative to the first object. Must be lower or equal than the maximum angle. +  * **Minimum angle**: The minimum angle between the objects, relative to the first object. Must be lower than or equal to the maximum angle. 
-  * **Maximum angle**: The minimum angle between the objects, relative to the first object. Must be higher ​or equal than the minimum angle.+  * **Maximum angle**: The minimum angle between the objects, relative to the first object. Must be greater than or equal to the minimum angle.
 <note tip>You can use revolute joints with angle limits to simulate articulations,​ in other words, ragdolls!</​note>​ <note tip>You can use revolute joints with angle limits to simulate articulations,​ in other words, ragdolls!</​note>​
-  * **Motor**: If enabled, the joint will add torque to the second object to make it rotate without the need of an external force... like a motor. If you enable it, remember to set motor speed and a maximum motor torque! +  * **Motor**: If enabled, the joint will add torque to the second object to make it rotate without the need of an external force... like a motor. If you enable it, remember to set motor speed and a maximum motor torque! 
-  * **Motor speed**: The target motor speed, in degrees per second. This is the speed the second object will try to reachrotating around the first object. +  * **Motor speed**: The target motor speed, in degrees per second. This is the speed the second object will try to reach while rotating around the first object. Motor speed can be positive to rotate the object in a clockwise direction, or negative to rotate it in the anticlockwise direction
-  * **Maximum motor torque**: The maximum torque the motor can spend to reach the target motor speed.+  * **Maximum motor torque**: The maximum torque the motor can spend to reach the target motor speed. Must be positive.
  
-Also, you can access ​these values during simulation:+Also, you can access ​the following ​values during simulation:
   * **Joint angle**: The current angle between the objects, relative to the first object and affected by the reference angle.   * **Joint angle**: The current angle between the objects, relative to the first object and affected by the reference angle.
   * **Joint speed**: The current joint angular speed, i.e. the speed the second object is rotating around, relative to the first object rotation.   * **Joint speed**: The current joint angular speed, i.e. the speed the second object is rotating around, relative to the first object rotation.
Line 162: Line 165:
  
 ###​Prismatic Joint ###​Prismatic Joint
 +
 +Prismatic joints work like "​pistons"​ and are also known as "​sliders"​. They make objects to slide one over the other, in a given axis. A good example is an elevator, the elevator moves in a vertical axis along a rail, the rail would be the first joint body and the elevator the second one, the axis would be an angle pointing up or down (-90 or 90 degrees).
 +
 +Settings specific for prismatic joints:
 +  * **Axis angle**: The angle that determines the movement direction, an axis angle of 0 means a horizontal movement. The value is given in world coordinates,​ but the axis will rotate following the first object direction (if you rotate your elevator rails, the elevator movement angle rotates too).
 +  * **Reference angle**: As in revolute joints, this angle adds an offset to the axis, establishing a new "angle zero". If the reference angle is 15, an axis angle of 15 in world coordinates (relative to the first object direction) will be treated as 0.
 +  * **Translation limits**: If enabled the second object movement will be limited between the given minimum and maximum translations.
 +  * **Minimum translation**:​ The minimum position the second object can move from the first one. In our elevator example, the minimum translation would be the floor.
 +  * **Maximum translation**:​ The maximum position the second object can move from the first one. In our elevator example, the roof.
 +<note important>​The translation limits range must include the zero, a minimum translation of 5 and maximum translation of 10 (range [5, 10]) will be converted to the range [0, 10] to include the zero</​note>​
 +  * **Motor**: If enabled, the joint will apply a force to the second object to reach a given motor speed. If you enable it, remember to set a motor speed and motor maximum force!
 +  * **Motor speed**: The target speed the motor will try to reach, if positive the second object will move in the axis direction, and in the opposite direction if negative.
 +  * **Maximum motor force**: The maximum amount of force the motor can spend to reach the target speed. Must be positive.
 +
 +Also, you can access the below values during simulation:
 +  * **Joint translation**:​ The current translation the second object has moved relative to the first.
 +  * **Joint speed**: The current speed the second object is moving at, along the axis and relative to the first object speed.
 +  * **Joint motor force**: The current force the motor is applying to the second object, this value can be lower than the maximum motor force as it's the force needed to reach the target motor speed.
  
 ###Pulley joint ###Pulley joint
 +
 +A simple joint with a simple name. This joint makes the summation of the distances from each object to its ground position to be constant, it's a lot easier to understand using other words: simulates a pulley :)
 +
 +Imagine you have a box hanging 3 meters under a fixed point A, and a circle hanging 2 meters under a fixed point B, both objects attached to the ends of the same rope. The rope has a constant length, so if you move the box up, now hanging just 1 meter under A, the circle has to move down the same distance, now 4 meters under B, this way the distance between the box and A plus the distance between the circle and B is always 5 meters:\\
 +`distance(box,​ A) + distance(circle,​ B) = constant`
 +
 +**Ratio**:​\\
 +Easy, no? now the crazy part, this joint supports an extra setting: ratio. The ratio makes the rope to be more extensible in one of the sides than the other. It can make, for example, 1 meter of rope in the box side to be equivalent to 2 meters of rope in the circle side (ratio = 1/2 = 0.5).
 +
 +Going back to our initial example: The box 3 meters under A, the circle 2 meters under B, but with a ratio = 0.5. Now, moving the box 2 meters upward will make the circle move 4 meters downward. Clearly, the rope length is not constant, but:\\
 +`distance(box,​ A) + ratio*distance(circle,​ B) = constant`
 +(Note that the first equation is a particular case of this one, with ratio = 1).
 +
 +Also, please note that there is not a "​rope"​ at all, the joint works with the distance between the objects and the anchor points only!
 +
 +Here are the joint settings:
 +  * **First ground point**: The fixed point the first object is attached (in the examples, the point A).
 +  * **Second ground point**: The fixed point the second object is attached (in the examples, the point B).
 +  * **First length**: The initial rope length between the first object and its ground point, if the value is negative or zero the distance at the moment of creating the joint is used.
 +  * **Second length**: The initial rope length between the second object and its ground point, if the value is negative or zero the distance at the moment of creating the joint is used.
 +  * **Ratio**: Explained above, the equivalence between the distance in each side. If the ratio is = 0.33, 1 meter on the first side is equivalent to 3 meters on the second side.
  
 ###Gear Joint ###Gear Joint
 +
 +This joint is very special, instead of joining two bodies directly, gears join two other joints, those child joints must be revolute or prismatic.\\
 +When two joints are linked through a gear joint the movement of one of the joints makes the other joint to move. For example, moving an object along the axis on a prismatic joint will make the linked revolute joint to rotate, and vice versa.
 +
 +This joint is also very tricky! ​ To get a gear to work, the first body of each child'​s joint must be static, and the second body dynamic.\\
 +You can gear together two revolute joints, two prismatic joints, or a revolute and a prismatic, but always the first body of each of the joints must be static!
 +<​note>​The first body of the gear child joints must be static, that's why the single object version of the revolute joint clarifies that the first body is a hidden static object</​note>​
 +
 +The gear joint settings:
 +  * **First joint**: A revolute or prismatic joint, will be linked to the second joint.
 +  * **Second joint**: A revolute or prismatic joint, will be linked to the first joint.
 +  * **Ratio**: Like the pulley joint, gears support a "​ratio",​ and works in a similar way: If you link two revolute joints with a ratio = 0.33, each turn in the first revolute will be equivalent to three turns in the second one. But there is a difference against the pulley joint ratio: gears ratios can be negative, allowing a positive movement in one of the joints to generate a negative movement in the other. For example, when linking two revolute joints with a ratio = -1, clockwise rotation in a revolute joint will generate an anti-clockwise rotation in the other, much like a gear, uh?
 +
 +<note important>​The necessary condition for the existence of a gear is the existence of the two child joints. If any of the two joints are deleted the gear will be automatically deleted too.</​note>​
  
 ###Mouse Joint ###Mouse Joint
 +
 +This joint is not necessarily related to the mouse, but it's very common. What this joint does is move an object towards a target position, if you update the target position continuously to target the mouse or a touch position you can drag objects around.
 +
 +Note that it's another exception from the other joints is that it's a joint that requires a single body to work: the object that will be moved towards the target.
 +
 +Settings for the mouse joint:
 +  * **Object**: The object to move around, towards the target position.
 +  * **Target**: ​ The target point the object will try to reach. You can update it as many times as you want after creating the joint.
 +<note important>​The initial target position (at the moment of creating the joint) is also used as the object anchor point, so make sure to set it!</​note>​
 +  * **Maximum force**: The maximum force the joint can apply on the object to reach the target position, the greater the force, the faster the object will move. Must be positive.
 +  * **Frequency**:​ Works like the distance joint frequency, determining how fast the object will oscillate around the target.
 +  * **Damping ratio**: Works like the distance joint damping ratio, slowing down the object along the time.
 +
 +<​note>​The mouse joint is not restricted to be used with the mouse only but accepts any world point as the target. </​note>​
  
 ###Wheel Joint ###Wheel Joint
 +
 +A very specified joint, when you need wheels you'll want this joint, and it's hard to think a case different than vehicles wheel where the best joint is the wheel joint.\\
 +Made to simulate vehicles wheels, this joint does only that, but does it very well!
 +
 +You can think in the wheel joint as a revolute plus a prismatic joint:\\
 +The revolute joint is used to make the second object (the wheel) to rotate and, as the classic revolute joint, it supports a motor to simulate the vehicle motor, making the wheel to rotate.\\
 +The prismatic joint function is to simulate the vehicle wheel suspension and, as the classic prismatic joint, you can set the axis angle to define the wheel translation direction. Generally, the axis direction is vertical but, for example, motorbikes have a front wheel suspension direction different (and in some cases very far) from vertical.
 +
 +<note important>​The body that will work as the wheel has to be the second object in the joint.</​note>​
 +
 +Here are the wheel joint settings:
 +  * **Axis angle**: Equivalent to the prismatic joint axis angle, it determines the direction of movement (or sliding) between the wheel and the first object.
 +  * **Frequency**:​ The suspension frequency, equivalent to the distance joint frequency. Higher values will make the wheel to oscillate faster.
 +  * **Damping ratio**: The suspension damping, equivalent to the distance joint damping ratio. Higher value slows down the wheel movement at a higher rate.
 +  * **Motor**: If enabled the joint will add torque to the wheel (second object) to reach a given motor target speed. If you enable it, remember to set the motor speed and the maximum motor torque!
 +  * **Motor speed**: The target angular speed the wheel will try to reach. Can be positive for clockwise rotation or negative for anti-clockwise rotation.
 +  * **Maximum motor torque**: The maximum amount of torque the joint can apply to the wheel to reach the motor target speed. Must be positive.
 +
 +And some extra values you can access during simulation:
 +  * **Joint translation**:​ The current wheel translation along the suspension axis.
 +  * **Joint speed**: The current wheel rotation speed.
 +  * **Joint motor torque**: The current torque the joint is applying to the wheel, it can be lower than the maximum motor torque as it's the torque needed to reach the target speed.
  
 ###Weld Joint ###Weld Joint
 +
 +This joint is super basic, just tries to stick/glue two objects together, and move them as if it were a single object.
 +
 +<note important>​You can use it to make breakable objects, but don't abuse! after all the objects will be attached by soft joints and sticking lots of objects or with very different densities can lead to physically inaccurate results.</​note>​
 +
 +The weld joint specific settings:
 +  * **Reference angle**: The angle the second object will have, relative to the first object angle.
 +<​note>​To stick the objects in the angle they are at the moment of creating the joint, use the relative angle between the objects as the reference angle: `SecondObject.Angle() - FirstObject.Angle()`</​note>​
 +  * **Frequency**:​ Works like the distance joint frequency, determining how fast the objects will oscillate to reach the rest position.
 +  * **Damping ratio**: Works like the distance joint damping ratio, slowing down the objects along the time.
  
 ###Rope Joint ###Rope Joint
 +
 +Another simple joint. This one makes two objects to be virtually linked with a rope, this way they can't be separated by a distance greater than the rope length, but can be in any distance below it.
 +
 +As in the pulley joint, there is not a real rope at all, the joint just checks the distance between the objects, and react if the distance is greater than the given length.
 +
 +The only setting specific for the rope joint:
 +  * **Maximum length**: The maximum distance between the objects. If the initial value is negative the distance between the objects at the moment of creating the joint is used.
  
 ###Friction Joint ###Friction Joint
 +
 +Friction joint simulates friction in a Z-axis, it slows down the relative speed and/or the angular speed between two objects, so that it can simulate linear and angular friction.
 +<note tip>If one of the objects is static, the friction joint can be used to correctly simulate friction in a top-down game, like a pool table or top-down racing games.</​note>​
 +
 +Friction joint settings:
 +  * **Maximum force**: The maximum force the joint can apply to the objects, higher values generate higher linear friction.
 + ​**Maximum torque**: The maximum torque the joint can apply to the objects, higher values generate higher angular friction.
  
 ###Motor Joint ###Motor Joint
 +
 +The motor joint has not much to do with real motors, at least not directly. When you link two objects with a motor joint, the objects will try to reach a target position and/or angle relative to the other object plus an offset.
 +
 +Two things to take into account:
 +  * The joint is not rigid at all, the objects can be far away from their target position or angle, a correction factor will tell how fast they will move and rotate to reach the rest pose.\\
 +For example, imagine one of these punching bags toys that always gets up again. You could simulate it using a motor joint, linking the ground and the bag, this way no matter how much you push the bag object the joint will try to put it back in the original angle, but not automatically.
 +  * Motor joints will stop if there are obstacles.\\
 +Going back to the punching bag example, if you push it with a big object to keep it on the ground, the motor joint won't be able to push it back, like in real life.
 +
 +<​note>​Note that this joint doesn'​t use anchor points, the offset position must be set using the linear and angular offsets only. Accessing the anchor points of this joint will return the objects positions.</​note>​
 +
 +The motor joint specific settings:
 +  * **Offset X/Y**: The offset position for the second object, relative to the first one. To use the current objects position at the moment of creating the joints use `SecondObject.X() - FirstObject.X()` and `SecondObject.Y() - FirstObject.Y()`
 +  * **Offset angle**: The angular offset for the second object, relative to the first one. To use the current objects relative angle at the moment of creating the joints use `SecondObject.Angle() - FirstObject.Angle()`
 +  * **Maximum force**: The maximum force the joint can apply to the objects to move them to the target position. Higher values will move the objects faster, in case of being necessary. If this value is zero, there won't be a linear correction and objects won't move to reach the target position.
 +  * **Maximum torque**: The maximum torque the joint can apply to the objects to rotate them to the target angle. Higher values will rotate the objects faster, in case of being necessary. If this value is zero, there won't be an angular correction and objects won't rotate to reach the target angle.
 +  * **Correction factor**: How fast the objects have to move and rotate to reach the target position and angle. The higher the correction, the faster the objects will move and/or rotate. The correction is limited by the maximum amount of force and torque the joint can use.