Class Math
Helper functions.
Inherited Members
Namespace: Unity.Physics
Assembly: solution.dll
Syntax
public static class Math
Methods
Name | Description |
---|---|
CalculatePerpendicularNormalized(float3, out float3, out float3) | Return two normals perpendicular to the input vector. |
CalculateTwistAngle(quaternion, int) | Returns the twist angle of the swing-twist decomposition of q about i, j, or k corresponding to index = 0, 1, or 2 respectively. Full calculation for readability: float invLength = RSqrtSafe(dot * dot + w * w); float sinHalfAngle = dot * invLength; float cosHalfAngle = w * invLength; Observe: invLength cancels in the tan^-1(sin / cos) calc, so avoid unnecessary calculations. |
ClampToMaxLength(float, ref float3) | Clamps the vector to to maximum length. |
DecomposeRigidBodyOrientation(in float4x4) | Physics internally represents all rigid bodies in world space. If a static body is in a hierarchy, its local-to-world matrix must be decomposed when building the physics world. This method returns a world-space orientation that would be decomposed for such a rigid body. |
DecomposeRigidBodyTransform(in float4x4) | Physics internally represents all rigid bodies in world space. If a static body is in a hierarchy, its local-to-world matrix must be decomposed when building the physics world. This method returns a world-space RigidTransform that would be decomposed for such a rigid body. |
DecomposeScale(float4x4) | Obtain 3-dimensional scale vector of the provided 4x4 transformation matrix, the components of which represent the lengths of the three orthonormal basis vectors forming the 3x3 rotational sub-matrix, respectively. |
HasNonIdentityScale(float4x4, float) | Checks if the matrix has non-identity scale. |
HasNonUniformScale(float4x4, float) | Checks if the matrix has non-uniform scale. |
HasShear(float4x4) | Checks if the matrix has shear. |
Inverse(MTransform) | Inverses the given transform. |
Inverse(ScaledMTransform) | Inverses the given transform. |
IsNormalized(float3) | Check if 'v' is normalized. |
Mul(MTransform, float3) | Multiplies the point by the transform. |
Mul(MTransform, MTransform) | Returns cFromA = cFromB * bFromA. |
Mul(ScaledMTransform, float3) | Multiplies the point by the transform. |
Mul(ScaledMTransform, ScaledMTransform) | Returns cFromA = cFromB * bFromA. |
NormalizeWithLength(float3, out float3) | Normalize and return the lenght of a vector. |