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)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
  How to detect bend in a spline or strait part of spline at position velikizlivuk 10 31 08-14-2023, 12:08 PM
Last Post: _Aka_
  Programming a first-person player/camera to follow a Curvy Spline kenmarold 1 6 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_
  Camera wobbles on too long spline (100km+) Vectorvision 10 8,023 08-01-2019, 12:35 PM
Last Post: _Aka_

Forum Jump: