Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,295 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Customize collision shape #351750
12/28/10 12:51
12/28/10 12:51
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hello i wonder how to make more complex collision shapes.

I want to make a shape that exists of multiple collision boxes..

Its a log trailer where you cal load log on.

Re: Customize collision shape [Re: peteredlin] #351755
12/28/10 13:20
12/28/10 13:20
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
May be you can combine some models (or just use one model with the shape that you need) and then set POLYGON flag on it?
You can customize BBOX by setting both FAT and NARROW flags on it, and then playing with it's MAX_X and MIN_X parameters:
Code:
my.eflags |= FAT | NARROW;
vec_set(my.min_x,vector(-50,-50,-50)); // play with -50 (X,Y,Z)
vec_set(my.max_x,vector(50,50,50)); // play with 50 (X,Y,Z)




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Customize collision shape [Re: 3run] #351757
12/28/10 13:31
12/28/10 13:31
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
I tryed to set the polygon flag but didn't succeed.

Could you explain to me how to set that flag?

Re: Customize collision shape [Re: peteredlin] #351760
12/28/10 13:36
12/28/10 13:36
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Simply before the while loop write:
set(my,POLYGON);
Did half of it fall throw the floor?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Customize collision shape [Re: 3run] #351768
12/28/10 14:02
12/28/10 14:02
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Yes ,it falls trough the floor.

But when i use shift + F11 to check the collision shapes , it doesnt look like the same shape of the trailer..

Re: Customize collision shape [Re: peteredlin] #351771
12/28/10 14:07
12/28/10 14:07
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Then right before setting POLYGON flag, use:
c_setminmax(my);
This will give right BBOX depending on all animation frames, but if it's static model without any animations, the BBOX will just fit right laugh Or set randomly BBOX (example is in my previous posts). Then set POLYGON flag again, should work laugh

Last edited by 3run; 12/28/10 14:09.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Customize collision shape [Re: 3run] #351774
12/28/10 14:19
12/28/10 14:19
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Now the shape looks litle better but it still lools like one box, not the shape of the trailer...

Maby its better to make a few simple boxe's and combine them together.
But what is the right way to do this?

How to connect a collision shape to the model?


Last edited by peteredlin; 12/28/10 14:20.
Re: Customize collision shape [Re: peteredlin] #351777
12/28/10 14:27
12/28/10 14:27
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
No dude, no. BBOX will looks like BOX any way (that's why it called Bounding Box grin I guess)
But collusion will be made depending on the trailers mesh (POLYGONS).
Make a little test, make a player, put him above the track and simply walk laugh
You'll notice that player collides with trailer depending on it's surfaces.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Customize collision shape [Re: 3run] #351780
12/28/10 14:46
12/28/10 14:46
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Ok i understand, but i think i don't use BBox in the right way, cause it collides still as a box.(i tryed)

I am new to this

is used yhe following code:
Code:
trailer = ent_create("trailer\\trailer.mdl",spawnp,NULL);
	
	phent_settype (trailer, PH_RIGID, PH_BOX); // set the physics entity type
	phent_setmass (trailer, 15000, PH_BOX); // and its mass
	phent_setgroup(trailer,4);

	phent_setfriction (trailer, 80); // set the friction
	phent_setdamping (trailer, 40, 40); // set the damping
	phent_setelasticity (trailer, 0, 20); // set the elasticity
	trailer.eflags |= FAT | NARROW;
	
	c_setminmax(trailer);
	set(trailer,POLYGON);








Last edited by peteredlin; 12/28/10 15:00.
Re: Customize collision shape [Re: peteredlin] #351785
12/28/10 15:06
12/28/10 15:06
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Ohh, I see that you are using physics engine, I'm not sure about that, cause I didn't really work with physics engine too much. But I guess there is a PH_POLY or something. Look at the manual for more explanation. The method that I've showed to you wouldn't work with physics I guess.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 2 1 2

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