Raised This Month: $32 Target: $400
 8% 

Entity rotation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 02-29-2016 , 06:30   Entity rotation
Reply With Quote #1

Could someone please provide an effiecient stock of rotating an entity around its origin? I found some code in sentry guns plugin, but it is old, inefficient and hard to understand.
Kowalsky is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-29-2016 , 07:42   Re: Entity rotation
Reply With Quote #2

pev_avelocity (fakemeta) or EV_VEC_avelocity (engine).
__________________
Arkshine is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 03-01-2016 , 04:50   Re: Entity rotation
Reply With Quote #3

I am really bad in geometric functions, I somehow refuse to understand them... Everything that is connected with angles/velocity is hard to understand. Could you please provide an example and explain it?

Last edited by Kowalsky; 03-01-2016 at 04:50.
Kowalsky is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-01-2016 , 07:39   Re: Entity rotation
Reply With Quote #4

Just pick up an axis and set some value.

You want probably:

new Float:avelocity[3]
avelocity[1] = someFloatValue; // rotating on y axis
set_pev(entity, pev_avelocity, avelocity);
__________________
Arkshine is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-01-2016 , 10:32   Re: Entity rotation
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
pev_avelocity (fakemeta) or EV_VEC_avelocity (engine).
Shed some light on this function, i can't seem to find anything solid regarding it
EpicMonkey is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-01-2016 , 11:21   Re: Entity rotation
Reply With Quote #6

Nothing to say really.

_velocity is linear
_avelocity is angular. It just rotates around their own axis, like:

__________________

Last edited by Arkshine; 03-01-2016 at 11:21.
Arkshine is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 03-01-2016 , 11:27   Re: Entity rotation
Reply With Quote #7

So rotating code would be something like

pev( ent, avelocity, aVelo );

aVelo += 10.0; // add 10 degrees???

set_pev( ent, avelocity, aVelo );
Kowalsky is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-01-2016 , 12:09   Re: Entity rotation
Reply With Quote #8

If you want to rotate it immediately and only once you need to set its angles instead
Miu is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-01-2016 , 12:15   Re: Entity rotation
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
Nothing to say really.

_velocity is linear
_avelocity is angular. It just rotates around their own axis, like:
So is there a difference between avelocity and lets say ( EV_VEC_ANGLES / pev_angles )?
EpicMonkey is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-01-2016 , 12:33   Re: Entity rotation
Reply With Quote #10

position:velocity::angles:angular velocity
Miu is offline
Reply


Thread Tools
Display Modes

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 11:31.


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