Getting player view angle height.

There are no stupid questions, just stupid answers.
  • 1
  • 2
15 posts Page 1 of 2
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Tue Jul 03, 2018 11:05 am
I hit a wall trying to get and set the angle of the view in height of the player.
When i access the rotation value of %client.getCameraObject() it returns a value but it only gives me the values in the x axis(left/right).
When i turn the view upward the normal vector does not change.
I skimmed trough the docs and source code but to no avail.
Online Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Jul 03, 2018 11:34 am
Maybe the camera does not rotate, but the player does. The camera is basically glued to the player and inherits the position and rotation of the bone that it is attached to, if it is attached to a bone.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Tue Jul 03, 2018 1:11 pm
No, i already have the player rotation, which rotates only along the x axis, oddly enough the camera has the exact same angle, no trace of up/down movement.
Online Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Jul 03, 2018 2:46 pm
The player cannot rotate up/down as well, maybe it is giving you the player rotation instead.
Jason Campbell
Posts: 271
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Wed Jul 04, 2018 6:37 am
If it is only in first person couldn't you use the player eye rotation or transform?
Steve_Yorkshire
Posts: 296
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Wed Jul 04, 2018 6:27 pm
For where something is pointing/aiming at, I think that you want the vector rather than the objects own rotation.

Edit:
Try %camera.getEulerRotation(); or %camera.getEyeVector();
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Wed Jul 04, 2018 7:59 pm
For where something is pointing/aiming at, I think that you want the vector rather than the objects own rotation.

Edit:
Try %camera.getEulerRotation(); or %camera.getEyeVector();
If that is correct then i have an even bigger problem.
The thing is that i want to implement realistic weapons behaviour and that means i need to set the player height view value.
If it is not encoded in camera.rotation and %camera.getEyeVector() does not have a corresponding set function, then how can i change where the player looks?
I need not only the player view adjusted but the whole player model look up/down.
That is according the the ShapeBase class reference.
Online Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Jul 04, 2018 9:32 pm
The weapon has its own vector, why you do not just use that, why you need the player camera view vector, what are you even trying to achieve?
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Wed Jul 04, 2018 9:55 pm
I want to simulate some kind of recoil setting off the player view forcing him to reaim at his target.
Offsetting in the horizontal works fine, but not the vertical.

Is weapon view the origin of camera?
If it is not then offsetting the weapon will detatch the reticule from the weapon.
Online Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Jul 04, 2018 10:22 pm
Recoil has already been done multiple times, there are multiple resources on different styles of recoil systems:

http://www.garagegames.com/community/re ... view/21867
http://www.garagegames.com/community/re ... view/10243
http://www.garagegames.com/community/re ... view/21868
http://www.garagegames.com/community/re ... view/10241

Test these out and see if it does what you need and then tell me which is best, since I also need a recoil system.
  • 1
  • 2
15 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 4 guests