Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Quad), 7,987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entity falling through floor blocks #91384
09/24/06 16:24
09/24/06 16:24
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
Hi everyone,

I'm attempting to create a cylinder-shaped barrel that I want to roll around and use physics. I know not to use ph_cylinder, so here is the code that I have set up:

Code:
action smallbarrel
{
while (player == null) {wait (1);}
phent_settype(my, ph_rigid, ph_poly);
phent_setmass(my, 0.5, ph_sphere);
phent_setfriction(my, 80);
phent_setelasticity(my, 10, 50);
}



Unfortunately, with the code as it is now, the barrel sinks through the floor, even when gravity is set to a low value. This hasn't happened with the other physics objects I've made, so I'm wondering if it could have to do with the model I'm using.

I'm using ph_poly for collision detection because when I use ph_box, the invisible box is way too large for the barrel, and the barrel appears to float in the air.

My questions are:

1. Is there a way to prevent the entity from sinking through the ground while using ph_poly? What could be causing this?

2. If I have to use ph_box (though I'd prefer not to), is there a way to shrink the box's boundries?

Thanks!

Last edited by CBSection31; 09/24/06 17:23.
Re: Entity falling through floor blocks [Re: CBSection31] #91385
09/24/06 22:06
09/24/06 22:06
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Try

phent_setmass(my, 0.5, ph_poly); insteat of

phent_setmass(my, 0.5, ph_sphere);


no science involved
Re: Entity falling through floor blocks [Re: fogman] #91386
09/24/06 23:13
09/24/06 23:13
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
I've tried all four options--poly, sphere, box, and cylinder, even though cylinder is still not stable. None of them help.

Re: Entity falling through floor blocks [Re: CBSection31] #91387
09/25/06 16:04
09/25/06 16:04
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
Okay, I think I've gotten it to work. It seems that when you use physics, larger entity models are more accurate with hull structures. I trippled the size of the model in MED and scaled it in WED...I know you aren't supposed to do that, but now they work fine.

Re: Entity falling through floor blocks [Re: CBSection31] #91388
09/25/06 16:22
09/25/06 16:22
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Yes, i think its true too. I had some serious problems sometime ago concerning collision detection in 6.40.5 version. I noticed that if i scale up my entities around six times, the collision in physics entities seems to be more accurate. If i remember well, JCL said that this fact will be added to the manual. I dont know if he already done that.

Re: Entity falling through floor blocks [Re: demiGod] #91389
03/27/07 13:59
03/27/07 13:59
Joined: Dec 2005
Posts: 57
Brazil
P
pesseba Offline
Junior Member
pesseba  Offline
Junior Member
P

Joined: Dec 2005
Posts: 57
Brazil
As a matter of fact, PH_CYLINDER works nice with entities, but not with blocks...


Moderated by  HeelX, Spirit 

Gamestudio download | 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