Gamestudio Links
Zorro Links
Newest Posts
How to buy tomorrow at open?
by frutza. 06/01/23 19:58
Adding Position to Current Trade
by AndrewAMD. 05/30/23 10:34
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
Return type of floor()
by AndrewAMD. 05/25/23 14:17
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (AndrewAMD), 1,065 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Physics objects stuck inside an invisible box? #99373
11/21/06 00:05
11/21/06 00:05
Joined: Nov 2006
Posts: 2
O
OpusGames Offline OP
Guest
OpusGames  Offline OP
Guest
O

Joined: Nov 2006
Posts: 2
I'm having a weird problem with the physics engine. I'm trying to build a very straight-forward setup with a ball, which I want to push around the level. However, as I move the ball, I quickly hit an invisible box around the ball, preventing movement beyond a small distance. It doesn't matter where I place the ball in the level... the box is always there around the starting position of the ball.

My level consists of only 3 objects: a skybox, a terrain map, and the ball.

Am I missing some settings that are constraining the ball to a bounding box?

I'm including the code I'm using to setup and run the ball:
------------------------------------------------------------------

//**************************************************************
// action for initing and running the ball
//**************************************************************
action aBall_InitAndUpdate ()
{
// setup physics body for the ball
phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 50);
phent_setdamping(my, 0, 0);
phent_setelasticity(my, 75, 100);

my.shadow = on;
my.passable = off;

// update loop of the car
while (1)
{
if (key_cuu == ON)
{
phent_addvelcentral(my, vector(-10, 0, 0));
}
if (key_cud == ON)
{
phent_addvelcentral(my, vector(10, 0, 0));
}
if (key_cul == ON)
{
phent_addvelcentral(my, vector(0, -10, 0));
}
if (key_cur == ON)
{
phent_addvelcentral(my, vector(0, 10, 0));
}
if (key_pgup == ON)
{
phent_addvelcentral(my, vector(0, 0, 10));
}
if (key_pgdn == ON)
{
phent_addvelcentral(my, vector(0, 0, -10));
}

wait(1);
}
}
------------------------------------------------------------
Thanks for any help!

-Doug

Re: Physics objects stuck inside an invisible box? [Re: OpusGames] #99374
11/22/06 07:23
11/22/06 07:23
Joined: Nov 2006
Posts: 2
O
OpusGames Offline OP
Guest
OpusGames  Offline OP
Guest
O

Joined: Nov 2006
Posts: 2
To add to my experiments into this problem, I replaced the terrain map I was using with a flat box for the floor. The ball then worked perfectly, as did the car demo I was originally working on.

Thus, the problem seems to come (somehow) from the terrain map I was using. I still have no idea what the problem is, but at least now I can bypass it for the time being....

That being said, any help solving the root of the problem would be greatly appreciated!

-Doug

Re: Physics objects stuck inside an invisible box? [Re: OpusGames] #99375
11/22/06 16:09
11/22/06 16:09
Joined: Jul 2000
Posts: 27,947
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,947
Frankfurt
The latest AUM contains an example with a ball, skybox, and terrain. Have you tried that terrain? I normally can't imagine a reason for the ball to be in an invisible box _unless_ it starts inside the terrain for some reason.


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