Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
0 registered members (), 1,498 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | 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