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?
#1
I need to establish a relative baseline for the 'center' Y rotation of the spline, that way if the camera is looking negative/positive of that number it will know the camera is looking left/right.

I'm hunting through the API but I'm a bit lost.
Reply
#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)
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Left-right movement, and spline follow shihaya 3 10 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 32 08-14-2023, 12:08 PM
Last Post: _Aka_
  Programming a first-person player/camera to follow a Curvy Spline kenmarold 1 8 05-21-2023, 05:03 PM
Last Post: _Aka_
  2D CurvyUISpline, Orthographic Camera and Handles MichaelH82 1 4 06-16-2022, 12:28 PM
Last Post: _Aka_

Forum Jump: