Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
phent_addvellocal #99161
11/18/06 17:32
11/18/06 17:32
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Someone please can explain to me why using the code below the ball receives random velocities and not a constant "kick"?

The direction vector seems to work properly but the speed sometimes its forwards and sometimes backwards or upwards at random values.
Thanks in advance.

Code:

function testVelocities()
{
var speedVector[3];
var angleVector[3] = 45,0,0;
vec_set(speedVector, vector(10000,0,0));
vec_rotate(speedVector,angleVector);
phent_addvellocal(ball,speedVector,vector(20,0,0));
}



Re: phent_addvellocal [Re: demiGod] #99162
11/20/06 15:35
11/20/06 15:35
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Speeds are measured in units per tick, so the value of your speed vector doesn't make sense. 50 or 100 are realistic values.

You'll find an example for kicking a physics ball in the latest AUM issue.

Re: phent_addvellocal [Re: jcl] #99163
11/20/06 15:54
11/20/06 15:54
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Thanks for answering jcl,

Unfortanly i have serious problems with physics questions, however i am trying to learn and search for some support. If we search this forums for "phent_addvellocal" it appears 3 results with a few information on that matter.

Anyway, thanks for your reply. I will check the AUM issue.

Btw, one more question. Should i use phent_addvellocal to kick an object like a ball and give it some effects like a kick with lateral curvature or "banana curvature" depending on vector* pos values? Or should i use other function?

Thanks.

Edit:
You see, the problem is that i had to scale up the world several times because of collision detection problems with the ball at high velocities.
So i have to apply higher velocities to the objects. With phent_addvelcentral it works ok, but with vellocal the ball has random movements.

Last edited by demiGod; 11/20/06 16:17.
Re: phent_addvellocal [Re: demiGod] #99164
11/21/06 12:07
11/21/06 12:07
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Yes, but even in a scaled up world, 10000 seems far too high. At that speed your ball would be out of the whole level in half a second. But in your case, the problem is not even the linear speed of the ball but the rotation speed that you give it by a non-central kick. Such a speed would cause a spin of several thousand rotations per second, which is certainly a higher rotation speed than a physics engine can manage. A real ball would explode at such a spin.

Reduce the speed, and make the kick less central. This shifts the ball spin into more reasonable ranges. Also, increasing the physics frame rate gives a higher accuracy at the price of a lower overall frame rate.


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