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

Player Rotation Breakdown?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jug
Junior Member
Join Date: Jul 2011
Old 06-07-2014 , 09:20   Player Rotation Breakdown?
Reply With Quote #1

I'm pretty much looking for a way to:
  • Force players to turn and look at a specific coordinate area/entity
  • Have players be knocked back in a specific direction relating to the location of an entity/another player

Typically I could figure this out on my own but some vector calculations are still a mystery to me and would appreciate some help
Jug is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-07-2014 , 10:24   Re: Player Rotation Breakdown?
Reply With Quote #2

Teleporting their angle will adjust view position
Makevectofrompoints / scalevector will get you a force vector between 2 pts
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-07-2014 , 19:46   Re: Player Rotation Breakdown?
Reply With Quote #3

Basics http://www.gamedev.net/page/resource...in-games-r2968

Theres a good amount of uses for all the vector functions
- offsetting a point of origin from an entity (probly use this the most)
- calculating velocity when given a direction
- calculating velocity required to push a physics object a given distance
- rotating two points relative to eachother (translating local/global space)
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 06-08-2014 , 09:02   Re: Player Rotation Breakdown?
Reply With Quote #4

Quote:
Originally Posted by Jug View Post
I'm pretty much looking for a way to:
  • Force players to turn and look at a specific coordinate area/entity
  • Have players be knocked back in a specific direction relating to the location of an entity/another player

Typically I could figure this out on my own but some vector calculations are still a mystery to me and would appreciate some help
1:
Code:
// make client look at VecTarget decl Float:vecEyePos[ 3 ]; decl Float:vecDelta[ 3 ]; decl Float:angles[ 3 ]; GetClientEyePosition( client, vecEyePos ); MakeVectorFromPoints( vecEyePos, vecTarget, vecDelta ); NormalizeVector( vecDelta, vecDelta ); GetVectorAngles( vecDelta, angles ); TeleportEntity( client, NULL_VECTOR, angles, NULL_VECTOR );

2: similar. Negate and scale vecDelta, then add it to the player's velocity. Skip the angles part.


Quote:
Originally Posted by Dr. Greg House View Post
They shouldn't. Most stuff you'll ever need is incredibly easy.
Please don't make such condescending and unhelpful posts
__________________
MikeJS is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-12-2014 , 09:00   Re: Player Rotation Breakdown?
Reply With Quote #5

This should provide examples of what you need: https://forums.alliedmods.net/showthread.php?t=241964
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 15:59.


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