V3fCoder
A V3fCoder can be used to encode direction vectors in unsigned integers.
Constructors
Constructor | Description |
new(raster)
Signature: raster:uint32 -> unit
|
Create a V3fCoder with supplied raster. The raster defines the number of discretized directons along an octant of one of the major circumferences of the sphere. Thus on each of the 3 major circumferences of the sphere 8 * raster evenly spaced different directions are encoded. |
Instance members
Instance member | Description |
Count
Signature: uint32
|
Calculate the number of different codes that are available. |
Decode(code)
Signature: code:uint32 -> V3f
|
Decode the unsigned integer direction code. |
DecodeOnCube(code, warped)
Signature: (code:uint32 * warped:bool) -> V3f
|
|
Encode(dir)
Signature: dir:V3f -> uint32
|
Encode the given direction in an unsigned integer. The direction does not need to be normalized! |
GenerateTable()
Signature: unit -> V3f []
|
Calculate all directions that are exactly encoded. |
NeighbourCodes(code, neighbourCodes)
Signature: (code:uint32 * neighbourCodes:uint32 []) -> uint32
|
Fills the array neighbourCodes with the codes of all neigbouring cells of the code discretization. |
WriteAllCornerNeighbours()
Signature: unit -> unit
|
Code generation. |
WriteCode(code)
Signature: code:uint32 -> unit
|
Code generation. |
WriteCornerNeighbours(corner)
Signature: corner:uint32 -> unit
|
Code generation. |
Static members
Static member | Description |
BoxOfSpherical(x)
Signature: x:float -> float
|
|
ForBits(bits)
Signature: bits:int -> V3fCoder
|
|
RasterForBits(bits)
Signature: bits:int -> uint32
|
Calculate the maximal raster for a given number of bits. Currently maximal 32 bits are supported. |
SphericalOfBox(x)
Signature: x:float -> float
|