コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】float ではなく double の Vector、Quaternion、Matrix を使用できる「Mathd」紹介

はじめに

「Mathd」を Unity プロジェクトに導入することで
float ではなく double の Vector、Quaternion、Matrix を使用できるようになります

使用例

using Mathd;
using UnityEngine;

public class Example : MonoBehaviour
{
    private void Start()
    {
        var vec2d = new Vector2d( 1.0, 2.0 );
        var vec3d = new Vector3d( 1.0, 2.0, 3.0 );
        var vec4d = new Vector4d( 1.0, 2.0, 3.0, 4.0 );
        var m     = new Matrix4x4d();
        var q     = new Quaterniond();
    }
}