Class Math
Helper functions.
Inherited Members
Namespace: Unity.Physics
Assembly: solution.dll
Syntax
public static class Math
Methods
Name | Description |
---|---|
Calculate |
Return two normals perpendicular to the input vector. |
Calculate |
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. |
Clamp |
Clamps the vector to to maximum length. |
Decompose |
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. |
Decompose |
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. |
Decompose |
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. |
Has |
Checks if the matrix has non-identity scale. |
Has |
Checks if the matrix has non-uniform scale. |
Has |
Checks if the matrix has shear. |
Inverse(MTransform) | Inverses the given transform. |
Inverse(Scaled |
Inverses the given transform. |
Is |
Check if 'v' is normalized. |
Mul(MTransform, float3) | Multiplies the point by the transform. |
Mul(MTransform, MTransform) | Returns cFromA = cFromB * bFromA. |
Mul(Scaled |
Multiplies the point by the transform. |
Mul(Scaled |
Returns cFromA = cFromB * bFromA. |
Normalize |
Normalize and return the lenght of a vector. |