Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 04/05/26 10:06
TMFs on options in live trading
by Spirit. 03/26/26 19:52
TDAmeritrade plugin with new Schwab accountt?
by AndrewAMD. 03/24/26 17:11
Black Book, 4th edition
by jcl. 03/17/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (vince, TipmyPip), 4,609 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
ondrej, mredit, vestriaa, Lukudo, mldenoiser
19205 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
proper sphere rotation as it rolls #231369
10/14/08 01:27
10/14/08 01:27
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
I use phent_addvelcentral to move a sphere entity. It moves nicely, rolls and everything, except that right after it is first propelled, it changes course slightly, since it initially is not rolling in the direction it is being moved (as it has no angular velocity). How can I give my sphere the appropriate initial angular velocity to match the direction that I desire it to roll?

Thanks so much!

Re: proper sphere rotation as it rolls [Re: BES] #231389
10/14/08 07:51
10/14/08 07:51
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Would you post your code Mark? Have you tried using phent_clearvelocity right before you use phent_addvelcentral?

Re: proper sphere rotation as it rolls [Re: DavidLancaster] #231463
10/14/08 17:21
10/14/08 17:21
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
Sure =)

Quote:
phent_enable( me, false );
vec_set( my.x, ball.x );
phent_enable( me, true );
phent_addvelcentral( me, &ballVelocity );


I might have actually had clearvelocity in there before, but I'll check it out.

While rolling I sample the ball velocity with:

Quote:
VECTOR feelerVect;
velReadOk = phent_getvelocity( me, &feelerVect, nullvector ); //! Assuming units: quants / sec
if( velReadOk != 1 )
{
diag("\nERROR in simController: phent_getvelocity failed!");
}


Re: proper sphere rotation as it rolls [Re: BES] #231656
10/15/08 21:34
10/15/08 21:34
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
bump


Moderated by  HeelX, Spirit 

Gamestudio download | 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