コード例 #1
0
ファイル: CameraUtil.cs プロジェクト: puos/EAProjectV2
 public static void SetCameraPose(Camera cam, CameraPose pose)
 {
     cam.transform.position      = pose.position;
     cam.transform.localRotation = Quaternion.Euler(pose.rotation);
     cam.nearClipPlane           = pose.nearClip;
     cam.farClipPlane            = pose.farClip;
     cam.fieldOfView             = pose.fov;
 }
コード例 #2
0
    void Move(string message)
    {
        // Deserialize the proto.
        CameraPose pose = CameraPose.Parser.ParseFrom(Convert.FromBase64String(message));

        // Update the camera's position and rotation.
        position.Set(pose.PositionX, pose.PositionY, pose.PositionZ);
        rotation.Set(pose.RotationX, pose.RotationY, pose.RotationZ, pose.RotationW);
    }
コード例 #3
0
ファイル: CameraUtil.cs プロジェクト: puos/EAProjectV2
    public static CameraPose GetCameraPose(Camera cam)
    {
        CameraPose pose = new CameraPose();

        pose.position = cam.transform.position;
        pose.rotation = cam.transform.localRotation.eulerAngles;
        pose.nearClip = cam.nearClipPlane;
        pose.farClip  = cam.farClipPlane;
        pose.fov      = cam.fieldOfView;
        return(pose);
    }