User Tools

Site Tools


hpl3:engine:static_objects

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
Last revision Both sides next revision
hpl3:engine:static_objects [2012/04/18 18:51]
thomas [Collision]
hpl3:engine:static_objects [2012/04/25 07:54]
thomas [Entity File]
Line 1: Line 1:
-==== Static Objects ====+===== Static Objects ​=====
  
----- 
  
 ==== General ==== ==== General ====
Line 11: Line 10:
 For most of the time, collision is automatically generated from the mesh of the object. This works fine for most of the time and when possible it is wise to spend a little less polygons a on an object with collision or to let more detailed (non-colliding) parts be in a separate object. The physics material of a collider generated this way is determined by the material (.mat) file that the mesh has, so make sure to set this up in the material file for all static object materials! For most of the time, collision is automatically generated from the mesh of the object. This works fine for most of the time and when possible it is wise to spend a little less polygons a on an object with collision or to let more detailed (non-colliding) parts be in a separate object. The physics material of a collider generated this way is determined by the material (.mat) file that the mesh has, so make sure to set this up in the material file for all static object materials!
  
-Sometimes though, the poly-count cannot be reduced enough (like in cylindrical shapes), or the collision needs to be different from the actual geometry (like a stairs, where you want a slope for characters). Then you need to add custom collides, this is done by adding a [[hpl3::​engine::​static_objects#​entity_file|.ent file]] or using naming of the submeshes. ​+Sometimes though, the poly-count cannot be reduced enough (like in cylindrical shapes), or the collision needs to be different from the actual geometry (like a stairs, where you want a slope for characters). Then you need to add custom collides, this is done by adding a [[hpl3::​engine::​static_objects#​entity_file|.ent file]] or using naming of the submeshes. As discussed more later on, ent files should be used for most objects and only when a mesh (not made out of primitive shapes) collider is needed, should the naming be used.
  
 First of all, the collider must be child of one of the other (non-collider) submeshes in the dae file! This is because the material of the parent is used to get the physics material for the collider.\\ First of all, the collider must be child of one of the other (non-collider) submeshes in the dae file! This is because the material of the parent is used to get the physics material for the collider.\\
 Then it has to be named according to a syntax, which is as follows:\\ Then it has to be named according to a syntax, which is as follows:\\
 +
 //​_collider_[type]_[name]//​\\ //​_collider_[type]_[name]//​\\
 //​_charcollider_[type]_[name]//​\\ //​_charcollider_[type]_[name]//​\\
 If starting with "​_charcollider",​ only characters will collide with it, otherwise any body will collide.\\ If starting with "​_charcollider",​ only characters will collide with it, otherwise any body will collide.\\
-**type** can be one of the following:​\\+ 
 +**type**\\ 
 +can be one of the following:​\\
 //mesh// This means that the submesh will only be used collider and not be visible. Works very will for making a low-poly version as a collider.\\ //mesh// This means that the submesh will only be used collider and not be visible. Works very will for making a low-poly version as a collider.\\
-//​(Important note, the following types are legacy stuff, it is almost always better to use .ent file!)//​\\ +//​box// ​(LEGACY)\\ 
-//box//\\ +//​cylinder//​ Height in local coordinates along y-axis! ​(LEGACY)\\ 
-//​cylinder//​ Height in local coordinates along y-axis!\\ +//sphere// Must not be perfectly spherical! ​(LEGACY)\\ 
-//sphere// Must not be perfectly spherical!\\ + 
-**name** can be what ever you want!\\+**name**\\ 
 +can be what ever you want!\\
 Example:\\ Example:\\
-//​_collider_mesh_shape01//​+//​_collider_mesh_shape01//​\\ 
 + 
 +**Important note:**\\ 
 +the types box, cylinder and sphere are legacy stuff! It is almost always better to use [[hpl3::​engine::​static_objects#​entity_file|.ent file]] file!\\
  
 ==== Entity File ==== ==== Entity File ====
 +
 +For more info om entities see [[hpl3:​engine:​entities|here]].
 +
 Static objects support having a .ent file, but this is not needed. The engine will check if there is an entity file with the same name as the model (eg, if "​wall.dae"​ has "​wall.ent"​) and if so load it. The only thing loaded from this file are: Static objects support having a .ent file, but this is not needed. The engine will check if there is an entity file with the same name as the model (eg, if "​wall.dae"​ has "​wall.ent"​) and if so load it. The only thing loaded from this file are:
  
hpl3/engine/static_objects.txt · Last modified: 2012/06/14 11:28 by thomas