Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Learning 3d physic

Author
Message
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 3rd Feb 2018 11:07
Hi all,

Im learning agk2 physic right now, not working on any project. i want to ask several thing about dynamic object and physic command

1. Regular movement taking account on its axis, like moveobjectlocalZ something like that. How about physic? When we use linear velocity, do we need to care about it axis also especially in model like arrow.

2.When we want to setup dynamic object, let say arrow on player. Which come first, do we create physic body for the arrow and the position it at the player.Which is i dont found any command to position it OR we position it first and create physic body after that. The later mean we create physic body on each arrow every time?

3. I look into character controller example, and i found that at certain angle, the ball wont bounce, it stick to the floor. So....

Thats all. Thanks
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 3rd Feb 2018 21:54
1. I believe the answer is yes, although I'm not entirely sure myself. Also, quite a few commands to change positions and angles don't work when an object is set to be a physics body. You would need to apply the proper forces I think. (I would love to see a good example of such a thing, or a debug function so it's a bit more apparent what happens within the engine )

As for number 2. yes, you would SetObjectPosition first, then after that you set the physics body using Create3DPhysicsDynamicBody( objectID ) .

You probably need to use Delete3DPhysicsBody( objectID ) when you need to reset an arrow's position whilst ignoring physics.

3. Good question. Maybe it doesn't return a good normal and then gets stuck? Honestly, I hope they will add more physics functionality to the engine.
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 4th Feb 2018 01:09 Edited at: 4th Feb 2018 02:17
Hi...thanks for the reply

So to conclude,repositioning must be done before creating physic body or delete the physic body to do that. Hrmmm

EDIT:
1one thing i notice and maybe i setup it wrong when i add positive value of "diry" in SetObject3DPhysicsLinearVelocity command, it launch the object downward while i expecting positive Y direction to be upward?

2.Let say i load arrow model intro AppGameKit, how to determine the right direction for the arrow when applying liner velocity?

Login to post a reply

Server time is: 2024-11-23 01:22:54
Your offset time is: 2024-11-23 01:22:54