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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  how to reset camera at beginning of Spline sunseeker1988 1 755 09-02-2016, 06:01 AM
Last Post: Jake
  Touchscreen input - move camera/object along the spline Mark_T 1 1,125 11-10-2015, 11:37 AM
Last Post: Jake
  Controlling the camera orientation richadam 1 969 10-13-2015, 06:05 PM
Last Post: Jake
  Camera and spline path djgriff 1 1,329 09-27-2015, 08:35 AM
Last Post: Jake

Forum Jump: