OctEncodedNormal Class
Represents a 3d normal vector compressed into a single 16-bit integer using oct-encoding. These are chiefly used to reduce the space required to store normal vectors for RenderGraphics.
Methods
Name | Description | |
---|---|---|
constructor(val: number): OctEncodedNormal | Construct directly from a 16-bit encoded value. | |
decode(): Vector3d | Decode this oct-encoded normal into a normalized vector. | |
decodeValue(val: number, result?: Vector3d): Vector3d Static | Decode a 16-bit encoded value into a normalized vector. | |
encode(vec: Readonly<WritableXYAndZ>): number Static | Compute the encoded 16-bit value of the supplied normalized vector. | |
encodeXYZ(nx: number, ny: number, nz: number): number Static | Compute the encoded 16-bit value of the supplied normalized vector components. | |
fromVector(val: Readonly<WritableXYAndZ>): OctEncodedNormal Static | Create an OctEncodedNormal from a normalized vector. |
Properties
Name | Type | Description | |
---|---|---|---|
value Readonly | number | The encoded normal. |
Defined in
Last Updated: 20 June, 2023