11-21-2013 10:52 AM
11-21-2013 11:41 AM
11-21-2013 12:36 PM
11-21-2013 12:51 PM
11-21-2013 04:14 PM
11-21-2013 04:17 PM
11-21-2013 04:18 PM
11-21-2013 05:18 PM
11-21-2013 06:01 PM
11-21-2013 06:44 PM
bool ConfigureCamera(ref Camera camera, float distOffset, float perspOffset, float eyePositionOffset)
{
Vector3 PerspOffset = Vector3.zero;
Vector3 EyePosition = EyeCenterPosition;
// Vertical FOV
camera.fieldOfView = VerticalFOV;
// Aspect ratio
camera.aspect = AspectRatio;
// Centre of lens correction
camera.GetComponent<OVRLensCorrection>()._Center.x = distOffset;
ConfigureCameraLensCorrection(ref camera);
// Clip Planes
camera.nearClipPlane = NearClipPlane;
camera.farClipPlane = FarClipPlane;
// Perspective offset for image
PerspOffset.x = perspOffset;
camera.GetComponent<OVRCamera>().SetPerspectiveOffset(ref PerspOffset);
// Set camera variables that pertain to the neck and eye position
// NOTE: We will want to add a scale vlue here in the event that the player
// grows or shrinks in the world. This keeps head modelling behaviour
// accurate
camera.GetComponent<OVRCamera>().NeckPosition = NeckPosition;
EyePosition.x = eyePositionOffset;
camera.GetComponent<OVRCamera>().EyePosition = EyePosition;
// Background color
camera.backgroundColor = BackgroundColor;
return true;
}