Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

Matrix4x4.float4x4

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Parameters

Parameter Description
v The Matrix4x4 to be converted to a float4x4.

Returns

float4x4 The converted float4x4 result.

Description

Converts a Matrix4x4 to a float4x4.

An implicit conversion operator that converts an input Matrix4x4 value to a float4x4.

// Attach this script to a GameObject.
using UnityEngine;
using Unity.Mathematics;

public class Example_MatrixConversion : MonoBehaviour { void Start() { // Create a sample Matrix4x4 (TRS for clarity) Vector3 position = new Vector3(1f, 2f, 3f); Quaternion rotation = Quaternion.Euler(10f, 20f, 30f); Vector3 scale = new Vector3(2f, 2f, 2f); Matrix4x4 unityMatrix = Matrix4x4.TRS(position, rotation, scale);

Debug.Log("Input UnityEngine.Matrix4x4 is:\n" + unityMatrix.ToString());

// Implicit conversion to Unity.Mathematics.float4x4 float4x4 mathMatrix = unityMatrix;

Debug.Log("Result Unity.Mathematics.float4x4 is:\n" + mathMatrix.ToString()); } }