You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
923 B
C#
42 lines
923 B
C#
/*****************************************************************************/
|
|
/*
|
|
Project - MudBun
|
|
Publisher - Long Bunny Labs
|
|
http://LongBunnyLabs.com
|
|
Author - Ming-Lun "Allen" Chou
|
|
http://AllenChou.net
|
|
*/
|
|
/******************************************************************************/
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
using UnityEngine;
|
|
|
|
namespace MudBun
|
|
{
|
|
[StructLayout(LayoutKind.Sequential, Pack = 0)]
|
|
[Serializable]
|
|
public struct CameraInfo
|
|
{
|
|
public static readonly int Stride = 12 * sizeof(float);
|
|
|
|
public Vector4 Position;
|
|
public Vector4 Direction;
|
|
public Vector4 Up;
|
|
|
|
public CameraInfo(Transform cameraTransform)
|
|
{
|
|
Position = cameraTransform.position;
|
|
Position.w = 1.0f;
|
|
|
|
Direction = cameraTransform.forward;
|
|
Direction.w = 0.0f;
|
|
|
|
Up = cameraTransform.up;
|
|
Up.w = 0.0f;
|
|
}
|
|
}
|
|
}
|
|
|