Author Topic: Crosshair for 3rd view?  (Read 1459 times)

If we find a way to get the distance of w/e the player is looking at client-side (Don't think so) then the maths will exist. Can probably be made into a server/client thing though.

If we find a way to get the distance of w/e the player is looking at client-side (Don't think so) then the maths will exist. Can probably be made into a server/client thing though.
If it is a server/client thing then that's certainly possible. But that's a really limited scope for such a small feature.

probably the best way to do this is to just draw a line from the center of the screen to the top, and say that's around where projectiles will go

Short-Ranged Equipment/Items are useful for 3rd Person Crosshairs, but I highly doubt Long-Sighted-Ranged Items will be essential for that.

I was working on this a short while ago just moving it up or down based on yaw, if I remember right I was having trouble with the fact that that can't really be done only on the client side. No clue where I put the resources.

it is completely impossible to determine the camera's position in third person

What? How?

What? How?
I agree. How? Isn't the position of the third person camera just an offset property of the current playertype? If so, that'd be really easy; just access <datablock>.cameraOffset or something (I don't know the exact property).

I agree. How? Isn't the position of the third person camera just an offset property of the current playertype? If so, that'd be really easy; just access <datablock>.cameraOffset or something (I don't know the exact property).

Well no, but you have the first person camera position and all of the properties used for offsetting it.

  • Take ::getEyeTransform()
  • Add cameraHorizontalOffset and cameraVerticalOffset (IIRC)
  • Rotate upward by cameraTilt
  • Send a raycast from current position in the opposite facing direction, cameraMaxDist units away
    • If it hits something, set the position to the hit position clamped to cameraMinDist
    • Otherwise, set the position to the end point of the raycast

Well no, but you have the first person camera position and all of the properties used for offsetting it.

  • Take ::getEyeTransform()
  • Add cameraHorizontalOffset and cameraVerticalOffset (IIRC)
  • Rotate upward by cameraTilt
  • Send a raycast from current position in the opposite facing direction, cameraMaxDist units away
    • If it hits something, set the position to the hit position clamped to cameraMinDist
    • Otherwise, set the position to the end point of the raycast
I imagine all that would work server-sided.
But then we're getting to the level of requiring a client+server add-on for a small feature, on top of ping issues.

You could always position the camera on either shoulder to get a better angle.