Raised This Month: $51 Target: $400
 12% 

Solved Convert movedir to angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 05-21-2019 , 08:32   Convert movedir to angles
Reply With Quote #1

How to rotate pev->movedir with angles ???

I see 0 90 0 angles == 0 1 0 movedir... (door)
0 270 0 angles == 0 -1 0 movedir

But how to convert it between angles and movedir, or rotate it by angles ?

Last edited by karaulov; 05-21-2019 at 10:39.
karaulov is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-21-2019 , 09:16   Re: Rotate movedir with another object
Reply With Quote #2

I'm not sure I really understand what you need, but you should be able to convert from angles to movedir (which seems to be a unit vector) with the angle_vector() function.
__________________
klippy is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 05-21-2019 , 09:27   Re: Rotate movedir with another object
Reply With Quote #3

For example door movedir : {0, 1, 0} how to rotate it by "pev->angle - pev->oldangle" vector?
(Change door direction)

Need convert movedir to angles, then do "movedirangles += pev->angle - pev->oldangle", and convert it back?

How to convert movedir to angles ?

Convert angles to movedir here http://cpp.sh/2o2xu but how to convert it back ?(((


Yes VectorAngles works but strange, may be bad?

http://cpp.sh/4raol

Last edited by karaulov; 05-21-2019 at 10:22.
karaulov is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-21-2019 , 10:59   Re: Convert movedir to angles
Reply With Quote #4

The opposite of angle_vector() is vector_to_angle(), try that.
__________________
klippy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode