Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,886 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple object physics behavior #58311
11/02/05 00:31
11/02/05 00:31
Joined: Sep 2005
Posts: 6
J
josh Offline OP
Newbie
josh  Offline OP
Newbie
J

Joined: Sep 2005
Posts: 6
I'm trying to apply basic physics to simple objects such as barrels and things you can tip over/slide around.

Curently when using a barrel object I can make the object slide around tip over, but when it tips over it doesn't stop (even with friction) and continues to flip over and act in a very strange manner.

This is the code I am using:

action movearound
{
var earthgravity[3] = 0,0, -2000;
ph_setgravity( earthgravity );
phent_settype (my,ph_rigid,0);
phent_setfriction(my,300); phent_setmass (my,9000,PH_POLY);
}

Can anyone make any suggestions on how to get something that behaves normally? thanks

Re: Simple object physics behavior [Re: josh] #58312
11/02/05 12:51
11/02/05 12:51
Joined: Jun 2005
Posts: 54
I
iWaNtToKnOw Offline
Junior Member
iWaNtToKnOw  Offline
Junior Member
I

Joined: Jun 2005
Posts: 54
because you don't specify a type to it, try this: phent_settype (my,ph_rigid,ph_cylinder);


Tell Me, iWaNtToKnOw!
Re: Simple object physics behavior [Re: iWaNtToKnOw] #58313
11/02/05 20:48
11/02/05 20:48
Joined: Apr 2005
Posts: 64
Italy - Rome
_
_Tommo_ Offline
Junior Member
_Tommo_  Offline
Junior Member
_

Joined: Apr 2005
Posts: 64
Italy - Rome
Hi,
for me the type isn't a problem, because PH_box means 0.
The problem could be the gravity... -2000 is very high and i noticed that the engine has more errors the higher is the gravity. On the manual they say that -368 is Earth gravity, see if this value works.
Another problem could be the the friction, that is infinite if over 100... try a value like 70, and mass, that is very high: a very heavy object like a car has a mass around 1500, and PH_poly itself is a very unstable collision detection, you could use ph_box or PH_sphere...

Last edited by _Tommo_; 11/02/05 20:54.
Re: Simple object physics behavior [Re: _Tommo_] #58314
11/02/05 22:21
11/02/05 22:21
Joined: Sep 2005
Posts: 6
J
josh Offline OP
Newbie
josh  Offline OP
Newbie
J

Joined: Sep 2005
Posts: 6
Thanks, the object is behaving quite normally now.


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