Gamestudio Links
Zorro Links
Newest Posts
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
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 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
Object sinks through ground #300836
12/05/09 19:09
12/05/09 19:09
Joined: Dec 2009
Posts: 5
H
Hammer_Studio Offline OP
Newbie
Hammer_Studio  Offline OP
Newbie
H

Joined: Dec 2009
Posts: 5
I'm just starting to program in Lite-C, so this should be a quick fix. I'm trying to just get the basic concepts behind creating and object and passing it to the physics engine. Problem is, when I do it, it sinks right through the ground, almost as if the ground is made of some liquid. I know this isn't the case, because it's the same ground from earthball, so I have no clue what's happening. Do I need something set up differently in MED or something? I remember clicking some button that made the objects look more blocky, rather than smooth, could that have caused this in some way? anyways, here's my code:

function main()
{

level_load("small.hmp");
ENTITY* object;
object = ent_create("test_Torus.mdl", vector(10, 20, 30), NULL); //test_Torus is the basic torus#2 shape from the MED

phent_settype(object,PH_RIGID,PH_POLY);
phent_setmass(object,1,PH_POLY);
phent_setfriction(object,90);
phent_setelasticity(object,75,100);
phent_setdamping(object,30,5);
ph_setgravity(vector(0,0,-50));

}
The torus is spawned above the terrain, and falls a few feet to the ground, where it is slowed temporarily, but then sinks through.

Re: Object sinks through ground [Re: Hammer_Studio] #300839
12/05/09 19:11
12/05/09 19:11
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Please no double posts!

Re: Object sinks through ground [Re: Rei_Ayanami] #300840
12/05/09 19:25
12/05/09 19:25
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
First the same: Please do not doubleposts.

To your problem, from the manual: "Do not use PH_POLY or PH_CYLINDER hulls for moving entities"

Re: Object sinks through ground [Re: Widi] #300843
12/05/09 19:32
12/05/09 19:32
Joined: Dec 2009
Posts: 5
H
Hammer_Studio Offline OP
Newbie
Hammer_Studio  Offline OP
Newbie
H

Joined: Dec 2009
Posts: 5
sorry, couldn't figure out how to remove the other one/move it here.... anyways, what Am I supposed to do then if I want a moving entity with physics applied to it?

Re: Object sinks through ground [Re: Hammer_Studio] #300845
12/05/09 19:39
12/05/09 19:39
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
phent_settype(object,PH_RIGID,PH_SPHERE);

edit: or PH_BOX

Last edited by Widi; 12/05/09 19:40.

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