|
1 registered members (AndrewAMD),
15,949
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: POlygon not working
[Re: Impaler]
#114861
03/04/07 12:01
03/04/07 12:01
|
Joined: Dec 2005
Posts: 414 Munich, Germany
Robotronic
Senior Member
|
Senior Member
Joined: Dec 2005
Posts: 414
Munich, Germany
|
Quote:
I have polygon flag, c_setminmax(my), and c_updatehull(my, my.frame) set to on.
This sounds confusing to me. There is an extensive chapter in the manual, "The collision engine".
If you want nice collision behaviour in your level you should always make a difference between
a) static entities b) moving entities
The polygon flag should only be used for static entities - for example a house model. That´s all you have to do for the static entities.
For moving entities in a more complex level you should not use the polygon flag. Instead you should set the dimension of the hull. There are several ways to do this:
You can use a) c_updatehull (sets bounding box to animation frame of your choice) or b) c_setminmax (sets bounding box to entities first frame) or c) set the dimension directly with entity.min_x etc. (this is the fastest method, however you should make sure, that you get a symmetrical shape. You can find the dimensions in MED)
If you don´t do anything the entity will get a default hull (see narrow or fat - flags), depending on its size.
You need a wait(1); instruction, before using c_setminmax, c_updatehull or the direct setting method for the first time. If you set the dimensions directly - which gives you most control - you also have to set narrow and fat flags to "on" after setting the dimension.
Here is a structural example:
Code:
action my_player { // player=my; etc. wait(1); vec_set(my.min_x, vector(-12,-12,-31)); vec_set(my.max_x, vector(12,12,31)); my.narrow = on; my.fat = on; while (1) { // movement and animation stuff (use c_-instructions) wait (1); } }
In a similar, more simple way you can use c_setminmax instead:
action my_player { player=me; wait(1); c_setminmax(me); while(1) { //animation and movement (use c_-instructions)... } }
That´s it for the moment ...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|