Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | 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