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.

AppGameKit Classic Chat / rotate towards object

Author
Message
qwe
20
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 3rd May 2013 06:07
i am going for a function like this:

function rotate_towards_object(start_X, start_Y, object_X as float, object_Y as float)

returns: (-) value if the entity pointing toward the object should rotate left, (+) if it should rotate right, 0 if it is on target

if anybody could help with the trigonometry i would appreciate it
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd May 2013 06:20
Use atanfull() to calculate the angle between objects.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd May 2013 10:26
There's a version of this in the useful community functions project (stickier at the top of this forum).


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-05-03 23:56:03
Your offset time is: 2024-05-03 23:56:03