Class OctNormalFactory

java.lang.Object
com.gaia3d.terrain.util.OctNormalFactory

public class OctNormalFactory extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    clamp(float value, float min, float max)
    Clamp value between min and max
    static org.joml.Vector2f
    encodeOctNormal(org.joml.Vector3f normal)
    Encode a normal vector into 2 bytes using oct encoding
    static byte[]
    encodeOctNormalByte(org.joml.Vector3f normal)
    Encode a normal vector into 2 bytes using oct encoding
    static org.joml.Vector2f
    signNotZero(org.joml.Vector2f value)
    Sign function that returns 1 for positive numbers and -1 for negative numbers Only returns (1 for -1)
    static org.joml.Vector2f
    toShortNormal(org.joml.Vector2f value)
    Encode a normal vector into 2 bytes using oct encoding

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OctNormalFactory

      public OctNormalFactory()
  • Method Details

    • toShortNormal

      public static org.joml.Vector2f toShortNormal(org.joml.Vector2f value)
      Encode a normal vector into 2 bytes using oct encoding
    • signNotZero

      public static org.joml.Vector2f signNotZero(org.joml.Vector2f value)
      Sign function that returns 1 for positive numbers and -1 for negative numbers Only returns (1 for -1)
    • clamp

      public static float clamp(float value, float min, float max)
      Clamp value between min and max
    • encodeOctNormal

      public static org.joml.Vector2f encodeOctNormal(org.joml.Vector3f normal)
      Encode a normal vector into 2 bytes using oct encoding
      Returns:
      Vector2f
    • encodeOctNormalByte

      public static byte[] encodeOctNormalByte(org.joml.Vector3f normal)
      Encode a normal vector into 2 bytes using oct encoding
      Returns:
      2 bytes