Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
POlygon not working #114857
03/03/07 13:25
03/03/07 13:25
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline OP
Member
Impaler  Offline OP
Member
I

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: Impaler] #114858
03/03/07 13:29
03/03/07 13:29
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If you have a static model object set its polygon flag to "on"

For dynamic models (the player model e.g.) write at the beginning of your action:
c_updatehull(my,my.frame);
wait(2);

And use the new c_* commands (c_move, c_trace, c_rotate and so on)

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
I
Impaler Offline OP
Member
Impaler  Offline OP
Member
I

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 Offline
Expert
xXxGuitar511  Offline
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
R
Robotronic Offline
Senior Member
Robotronic  Offline
Senior Member
R

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 ...


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1