Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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,392 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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