Table of Contents

Class MathUtils

Namespace
Ceres
Assembly
Ceres.dll

Utils for Mathematics

public static class MathUtils
Inheritance
MathUtils
Inherited Members

Remarks

Methods should be annotated with AggressiveInlining which allows the burst compiler to optimize the method while optimizing the method's caller.

Methods

Angle(in float3, in float3)

public static float Angle(in float3 from, in float3 to)

Parameters

from float3
to float3

Returns

float

Angle(in quaternion, in quaternion)

public static float Angle(in quaternion q1, in quaternion q2)

Parameters

q1 quaternion
q2 quaternion

Returns

float

GetQuadraticCurvePoint(in float, in float3, in float3, in float3)

Quadratic Bézier curve, dynamically draw a curve based on three points

public static float3 GetQuadraticCurvePoint(in float t, in float3 p0, in float3 p1, in float3 p2)

Parameters

t float

The arrival coefficient is 0 for the start and 1 for the arrival

p0 float3

Starting point

p1 float3

Middle point

p2 float3

End point

Returns

float3

InViewAngle(in float3, in float3, in float3, in float)

public static bool InViewAngle(in float3 center, in float3 position, in float3 forward, in float angle)

Parameters

center float3
position float3
forward float3
angle float

Returns

bool

IsInLayerMask(in int, in LayerMask)

public static bool IsInLayerMask(in int layer, in LayerMask mask)

Parameters

layer int
mask LayerMask

Returns

bool

IsPointInPolygon(in NativeArray<float3>, in float3)

public static bool IsPointInPolygon(in NativeArray<float3> polygonCorners, in float3 p)

Parameters

polygonCorners NativeArray<float3>
p float3

Returns

bool

MultiplyPoint3x4(ref float4x4, in float3, ref float3)

UnityEngine.Matrix4x4.MultiplyPoint3x4(UnityEngine.Vector3) for Unity.Mathematics.float4x4

public static void MultiplyPoint3x4(this ref float4x4 worldMatrix, in float3 point, ref float3 result)

Parameters

worldMatrix float4x4
point float3
result float3

MultiplyVector(ref float4x4, in float3, ref float3)

UnityEngine.Matrix4x4.MultiplyVector(UnityEngine.Vector3) for Unity.Mathematics.float4x4

public static void MultiplyVector(this ref float4x4 worldMatrix, in float3 point, ref float3 result)

Parameters

worldMatrix float4x4
point float3
result float3

RotateTowards(in quaternion, in quaternion, in float)

public static quaternion RotateTowards(in quaternion from, in quaternion to, in float maxDegreesDelta)

Parameters

from quaternion
to quaternion
maxDegreesDelta float

Returns

quaternion