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
fromfloat3tofloat3
Returns
Angle(in quaternion, in quaternion)
public static float Angle(in quaternion q1, in quaternion q2)
Parameters
q1quaternionq2quaternion
Returns
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
tfloatThe arrival coefficient is 0 for the start and 1 for the arrival
p0float3Starting point
p1float3Middle point
p2float3End 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
centerfloat3positionfloat3forwardfloat3anglefloat
Returns
IsInLayerMask(in int, in LayerMask)
public static bool IsInLayerMask(in int layer, in LayerMask mask)
Parameters
Returns
IsPointInPolygon(in NativeArray<float3>, in float3)
public static bool IsPointInPolygon(in NativeArray<float3> polygonCorners, in float3 p)
Parameters
polygonCornersNativeArray<float3>pfloat3
Returns
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
worldMatrixfloat4x4pointfloat3resultfloat3
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
worldMatrixfloat4x4pointfloat3resultfloat3
RotateTowards(in quaternion, in quaternion, in float)
public static quaternion RotateTowards(in quaternion from, in quaternion to, in float maxDegreesDelta)
Parameters
fromquaterniontoquaternionmaxDegreesDeltafloat
Returns
- quaternion