1 registered members (AndrewAMD),
1,014
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
POlygon not working
#114857
03/03/07 13:25
03/03/07 13:25
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
HI everyone! I've just updated from 6.1 to 6.5 (after putting it off as long as I could ) And I am puzzled about how to get polygon collision detection on models to work , because when I set the polygon flag, the bounding box is still the same when you press F11 two times, and there is no polygon collision detection in the game. How can you activate this?
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: POlygon not working
[Re: Xarthor]
#114859
03/04/07 06:25
03/04/07 06:25
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
Hmmm... It still has a box shaped bounding area. I have polygon flag, c_setminmax(my), and c_updatehull(my, my.frame) set to on.
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: POlygon not working
[Re: Impaler]
#114860
03/04/07 07:03
03/04/07 07:03
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
debug mode shows the bounding box...
the bounding box is irrelevant to polygon precise collision(PPC)
xXxGuitar511 - Programmer
|
|
|
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
|