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 after slight collision/penetration #300759
12/04/09 22:36
12/04/09 22:36
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.

Last edited by Hammer_Studio; 12/05/09 12:07. Reason: Clarification
Re: Object sinks through ground [Re: Hammer_Studio] #300764
12/04/09 23:48
12/04/09 23:48
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
start debugging by creating the object high enough above the ground

vector(10, 20, 30), -> vector(10, 20, 300)

Might be caused by the object beeing spawned already inside the terrain.

Re: Object sinks through ground [Re: Damocles_] #300791
12/05/09 12:02
12/05/09 12:02
Joined: Dec 2009
Posts: 5
H
Hammer_Studio Offline OP
Newbie
Hammer_Studio  Offline OP
Newbie
H

Joined: Dec 2009
Posts: 5
=( unfortunately, it is not that simple. It's spawning well above the terrain. When if falls, there is some collision, to the extent that the torus' fall is briefly slowed to a near stop, however it then continues to sink, like how when Golum in LotR 3 hit the lava, then begun to sink. I'm tempted to think that somehow it's only applying the physics to the individual vertexes, rather than as to the object's faces as well.

Re: Object sinks through ground [Re: Hammer_Studio] #300797
12/05/09 12:34
12/05/09 12:34
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I've never used any physics before, but how about your models zero origin? It(the origin) should be ewhere near the model's center...

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

Joined: Aug 2007
Posts: 1,922
Schweiz
From the Manual: "Do not use PH_POLY or PH_CYLINDER hulls for moving entities".

And.... please no doubleposts !!!


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