Package 

Class MathUtils

    • Method Summary

      Modifier and Type Method Description
      static void packTangentFrame(float tangentX, float tangentY, float tangentZ, float bitangentX, float bitangentY, float bitangentZ, float normalX, float normalY, float normalZ, @NonNull() @Size(min = 4) Array<float> quaternion) Packs the tangent frame represented by the specified tangent, bitangent, and normal into aquaternion.
      static void packTangentFrame(float tangentX, float tangentY, float tangentZ, float bitangentX, float bitangentY, float bitangentZ, float normalX, float normalY, float normalZ, @NonNull() @Size(min = 4) Array<float> quaternion, @IntRange(from = 0) int offset) Packs the tangent frame represented by the specified tangent, bitangent, and normal into aquaternion.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • packTangentFrame

         static void packTangentFrame(float tangentX, float tangentY, float tangentZ, float bitangentX, float bitangentY, float bitangentZ, float normalX, float normalY, float normalZ, @NonNull() @Size(min = 4) Array<float> quaternion)

        Packs the tangent frame represented by the specified tangent, bitangent, and normal into aquaternion.

        Reflection is preserved by encoding it as the sign of the w component in the resultingquaternion. Since -0 cannot always be represented on the GPU, this function computes a biasto ensure values are always either positive or negative, never 0. The bias is computed basedon a per-element storage size of 2 bytes, making the resulting quaternion suitable forstorage into an SNORM16 vector.

        Parameters:
        tangentX - the X component of the tangent
        tangentY - the Y component of the tangent
        tangentZ - the Z component of the tangent
        bitangentX - the X component of the bitangent
        bitangentY - the Y component of the bitangent
        bitangentZ - the Z component of the bitangent
        normalX - the X component of the normal
        normalY - the Y component of the normal
        normalZ - the Z component of the normal
        quaternion - a float array of at least size 4 for the quaternion result to be stored
      • packTangentFrame

         static void packTangentFrame(float tangentX, float tangentY, float tangentZ, float bitangentX, float bitangentY, float bitangentZ, float normalX, float normalY, float normalZ, @NonNull() @Size(min = 4) Array<float> quaternion, @IntRange(from = 0) int offset)

        Packs the tangent frame represented by the specified tangent, bitangent, and normal into aquaternion.

        Reflection is preserved by encoding it as the sign of the w component in the resultingquaternion. Since -0 cannot always be represented on the GPU, this function computes a biasto ensure values are always either positive or negative, never 0. The bias is computed basedon a per-element storage size of 2 bytes, making the resulting quaternion suitable forstorage into an SNORM16 vector.

        Parameters:
        tangentX - the X component of the tangent
        tangentY - the Y component of the tangent
        tangentZ - the Z component of the tangent
        bitangentX - the X component of the bitangent
        bitangentY - the Y component of the bitangent
        bitangentZ - the Z component of the bitangent
        normalX - the X component of the normal
        normalY - the Y component of the normal
        normalZ - the Z component of the normal
        quaternion - a float array of at least size 4 for the quaternion result to be stored
        offset - offset, in elements, into the quaternion array to store the results