79 | | The StaticEntity defines the model's place and orientation (and some other values). With the proper sized collisionshape attached to the model you have a "solid" cube. Without a collisionshape, the cube wouldn't be solid and your spaceship could just fly through it. This exampe is quite useful, since you usually can't see a collisionshape's size. If you combine a invisible collisionshape with a fitting model you can see where a collisionshape is. |
| 79 | The StaticEntity defines the model's place and orientation (and some other values). The Model (a cube) is attached to the StaticEntity. With the proper sized collisionshape attached to the StaticEntity you have a "solid" cube. Without a collisionshape, the cube wouldn't be solid and your spaceship could just fly through it. This exampe is quite useful, since you usually can't see a collisionshape's size. If you combine a invisible collisionshape with a fitting model you can see where a collisionshape is for testing purposes. |
| 80 | |
| 81 | == MovalbeEntity - Let's get the world moving== |
| 82 | Worldentities can be attached to other worldentities. If you want a model to move in circles, you can create a MovableEntity that rotates and a StaticEntity attached to it. The model that should be rotating is attached to the StaticEntity. |
| 83 | {{{ |
| 84 | #!xml |
| 85 | <?lua |
| 86 | dofile("includes/CuboidSpaceStation.lua") |
| 87 | ?> |
| 88 | <!-- ----------------Rotating SpaceStation--------------- --> |
| 89 | <MovableEntity position="1,1,1" rotationrate="-4.5" rotationaxis="0,0,1"> |
| 90 | <attached> |
| 91 | <StaticEntity position="-2500,0,0" yaw=90 pitch=90> |
| 92 | <attached> |
| 93 | <?lua |
| 94 | createSpaceStationPar(0,2,1,2,1,4,1,50) |
| 95 | ?> |
| 96 | </attached> |
| 97 | </StaticEntity> |
| 98 | </attached> |
| 99 | </MovableEntity> |
| 100 | }}} |
| 101 | Note that in this example there Model is created by a lua script that is called in a lua tag. Lua is a scripting language that is a very powerful tool for level design. |