Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I detect if the camera is looking to the left or right of the current heading?
#2
I am assuming that your camera is on the spline.
What you want is the sign of the signed angle between the spline tangent and the camera forward.
try this


Code:
var projectedCameraForward  =  Vector3.ProjectOnPlane(cameraForward, splineOrientationUp); // You should handle the cases where projectedCameraForward is Vector3.zero;

FluffyUnderware.DevTools.Extensions.Vector3Ext.AngleSigned(projectedCameraForward, splineTangent, splineOrientationUp)
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Messages In This Thread
RE: Can I detect if the camera is looking to the left or right of the current heading? - by _Aka_ - 01-12-2018, 05:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Left-right movement, and spline follow shihaya 3 2,557 07-12-2024, 12:50 PM
Last Post: _Aka_
  How to detect bend in a spline or strait part of spline at position velikizlivuk 10 5,887 08-14-2023, 12:08 PM
Last Post: _Aka_
  Programming a first-person player/camera to follow a Curvy Spline kenmarold 1 1,426 05-21-2023, 05:03 PM
Last Post: _Aka_
  2D CurvyUISpline, Orthographic Camera and Handles MichaelH82 1 1,599 06-16-2022, 12:28 PM
Last Post: _Aka_

Forum Jump: