Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


implicit operator float4x4

Converts a Matrix4x4 to a float4x4.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Operator
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

implicit operator float4x4(float4x)

Converts a Matrix4x4 to a float4x4.
public static implicit operator float4x4(Matrix4x4 m)

Parameters

Returns

Type

Description

float4x4The converted float4x4 result.

Remarks

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

Examples

// 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()); }}

implicit operator Matrix4x4(Matrix4x)

Converts a float4x4 to a Matrix4x4.
public static implicit operator Matrix4x4(float4x4 m)

Parameters

Returns

Type

Description

Matrix4x4The converted Matrix4x4 result.

Remarks

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