User Tools

Site Tools


es:orx:tutorials:physics

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
es:orx:tutorials:physics [2012/03/03 07:43 (13 years ago)] – [Sumario] zeraes:orx:tutorials:physics [2020/08/19 21:14 (5 years ago)] (current) – Old content sausage
Line 1: Line 1:
-====== Tutorial de Física ====== 
- 
- 
- 
-===== Sumario ===== 
- 
-Ver los anteriores [[main#Basic|tutoriales básicos]] para más información sobre la [[object|creación básica de objetos]], [[clock|manejo del reloj]], [[frame|jerarquía de fotogramas]], [[anim|animaciones]], [[viewport|cámaras & vistas]], [[sound|música & sonido]] y [[FX|efectos(FXs)]]. 
- 
-Este tutorial muestra como añadirle propiedades físicas a los objetos y manejar colisiones. 
- 
-Como puedes ver, las propiedades físicas son completamente manipuladas por datos. Así, creando un objeto con propiedades físicas (ej. con un cuerpo) o sin ellas, resulta en exactamente la misma linea de código. 
- 
-Los objetos pueden ser enlazados a un cuerpo, que puede ser estático o dinámico.\\ 
-Cada cuerpo puede estar hecho de hasta 8 partes. 
- 
-Un cuerpo es definido por: 
-  * su forma (actualmente caja, esfera y malla(ej. poligono convexo) son los únicos disponibles) 
-  * información acerca del tamaño de la forma (esquinas para la caja, centro y radio para la esdera, ) 
- 
-A body part is defined by: 
-  * its shape (currently box, sphere and mesh (ie. convex polygon) are the only available) 
-  * information about the shape size (corners for the box, center and radius for the sphere, vertices for the mesh) 
-  * if no size data is specified, the shape will try to fill the complete body (using the object size and scale) 
-  * collision "self" flags that defines this part 
-  * collision "check" mask that defines with which other parts this one will collide ((two parts in the same body will never collide)) 
-  * a flag (''Solid'') specifying if this shaped should only give information about collisions or if it should impact on the body physics simulation (bouncing, etc...) 
-  * various attributes such as restitution, friction, density, ... 
- 
-In this tutorial we create static solid walls around our screen. We then spawn boxes in the middle.\\ 
-The number of boxes created is tweakable through the config file and is 100 by default. 
- 
-The only interaction possible is using left and right mouse buttons (or left and right keys) to rotate the camera.\\ 
-As we rotate it, we also update the gravity vector of our simulation.\\ 
-Doing so, it gives the impression that the boxes will be always falling toward the bottom of our screen no matter how the camera is rotated. 
- 
-We also register to the physics events to add a visual FXs on two colliding objects.\\ 
-By default the FX is a fast color flash and is, as usual, tweakable in realtime 
-(ie. reloading the config history will apply the new settings immediately as the FX isn't kept in cache by default). 
- 
-Updating an object scale (including changing its scale with FXs) will update its physical properties (ie. its body).\\ 
-Keep in mind that scaling an object with a physical body is more expensive as we have to delete the current shapes and recreate them at the correct size.\\ 
-This is done this way as our current single physics plugin is based on Box2D which doesn't allow realtime rescaling of shapes. 
- 
-This tutorial does only show basic physics and collision control, but, for example, you can also be notified with events for object separating or keeping contact. 
- 
-===== Detalles ===== 
- 
- 
- 
-===== Recursos ===== 
- 
  
es/orx/tutorials/physics.1330789397.txt.gz · Last modified: 2017/05/30 00:50 (8 years ago) (external edit)