Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 74 and Version 75 of content/LevelHowTo


Ignore:
Timestamp:
Dec 2, 2015, 8:43:05 PM (9 years ago)
Author:
fvultier
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/LevelHowTo

    v74 v75  
    260260}}}
    261261In this example the static entity has five collision shapes. Flying into any of these will cause a collision detected by the physics engine.
     262
     263== Collision types ==
     264In Orxonox there are four collision types: static, kinematic, dynamic, none
     265
     266Depending on the collision type of a WorldEntity it will in a different way to a collision with an other WorldEntity.
     267
     268In the next example there is a StaticEntity with a model and a collision shape. If you try to push away the box with a spaceship you will fail. This is because a WorldEntity with collision type "static" will never react to collisions with other WorldEntities. It will stay at the same position forever.
     269{{{
     270#!xml
     271<Model position="0,0,0" mesh="cube.mesh" scale3D="10000,1,1" />
     272
     273<StaticEntity position="0,0,0" collisionType=static mass=10000>
     274  <attached>
     275      <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     276  </attached>
     277  <collisionShapes>
     278      <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     279  </collisionShapes>
     280</StaticEntity>
     281}}}
     282
     283In the following example we changed the collision type to "kinematic" and replaced the StaticEntity by a MovableEntity. It is still impossible to push away the box with the spaceship, but the moving box is able to push the spaceship.
     284
     285{{{
     286#!xml
     287<Model position="0,0,0" mesh="cube.mesh" scale3D="10000,1,1" />
     288
     289<MovableEntity position="0,0,0" velocity="20,0,0" collisionType=kinematic mass=10000>
     290  <attached>
     291      <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     292  </attached>
     293  <collisionShapes>
     294      <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     295  </collisionShapes>
     296</MovableEntity>
     297}}}
     298
     299To make it possible that the box may be pushed by the spaceship and the spaceship may be pushed by the box we need to change the collision type to "dynamic":
     300
     301{{{
     302#!xml
     303<Model position="0,0,0" mesh="cube.mesh" scale3D="10000,1,1" />
     304
     305<MovableEntity position="0,0,0" velocity="20,0,0" collisionType=dynamic mass=10000>
     306  <attached>
     307      <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     308  </attached>
     309  <collisionShapes>
     310      <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     311  </collisionShapes>
     312</MovableEntity>
     313}}}
     314
     315To completely deactivate the physics of a WorldEntity set the collision type to "none".
     316
     317A WorldEntity with the collision type "dynamic" may have damping parameters:
     318{{{
     319#!xml
     320<MovableEntity position="0,-100,0" velocity="0,50,0" rotationaxis="0,1,0" rotationrate=1000 collisionType=dynamic lineardamping=0.1 angularDamping=0.01 mass=10000>
     321  <attached>
     322      <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     323  </attached>
     324  <collisionShapes>
     325      <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     326  </collisionShapes>
     327</MovableEntity>
     328}}}
     329Since the linear damping is large the box will stop the linear movement after a few seconds. The low angular damping decreases the angluar velocity only slowly.
     330
     331Not every collision type is legal for every WorldEntity. The following table gives an overview over the legal collision types of common WorldEntities:
     332|| || '''StaticEntity''' || '''MovableEntity, ControllableEntity, Pawn''' || '''Spaceship'''||
     333||'''dynamic'''|| ||X||X||
     334||'''kinematic'''|| ||X|| ||
     335||'''static'''||X|| || ||
     336||'''none'''||X||X|| ||
     337
    262338== Spawnpoints ==
    263339A Spawnpoint is the '''entrance point''' for controllable entities (spaceships). Without a spawnpoint no level can work!
     
    269345|| '''pawndesign''' || '''include()''' || '''additional information'''||
    270346||spaceshipassff||"templates/spaceshipAssff.oxt"||default spaceship - equipped with rockets||
     347||spaceshipescort||"templates/spaceshipEscort.oxt"||small spaceship with only weak laser weapons||
    271348||spaceshippirate||"templates/spaceshipPirate.oxt"||Spaceship used by pirates||
    272349||spaceshipswallow||"templates/spaceshipSwallow.oxt"||fast, nice design||