KiCad PCB EDA Suite
Loading...
Searching...
No Matches
mortoncodes.cpp File Reference

Implements Morton Codes base on the implementation of Fabian “ryg” Giesen https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/. More...

#include "mortoncodes.h"

Go to the source code of this file.

Functions

uint32_t Part1By1 (uint32_t x)
 
uint32_t Part1By2 (uint32_t x)
 
uint32_t Compact1By1 (uint32_t x)
 
uint32_t Compact1By2 (uint32_t x)
 
uint32_t EncodeMorton2 (uint32_t x, uint32_t y)
 
uint32_t EncodeMorton3 (uint32_t x, uint32_t y, uint32_t z)
 
uint32_t DecodeMorton2X (uint32_t code)
 
uint32_t DecodeMorton2Y (uint32_t code)
 
uint32_t DecodeMorton3X (uint32_t code)
 
uint32_t DecodeMorton3Y (uint32_t code)
 
uint32_t DecodeMorton3Z (uint32_t code)
 

Detailed Description

Implements Morton Codes base on the implementation of Fabian “ryg” Giesen https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/.

Definition in file mortoncodes.cpp.

Function Documentation

◆ Compact1By1()

uint32_t Compact1By1 ( uint32_t  x)

Definition at line 61 of file mortoncodes.cpp.

Referenced by DecodeMorton2X(), and DecodeMorton2Y().

◆ Compact1By2()

uint32_t Compact1By2 ( uint32_t  x)

Definition at line 74 of file mortoncodes.cpp.

Referenced by DecodeMorton3X(), DecodeMorton3Y(), and DecodeMorton3Z().

◆ DecodeMorton2X()

uint32_t DecodeMorton2X ( uint32_t  code)

Definition at line 98 of file mortoncodes.cpp.

References Compact1By1().

Referenced by RENDER_3D_RAYTRACE::initializeBlockPositions().

◆ DecodeMorton2Y()

uint32_t DecodeMorton2Y ( uint32_t  code)

Definition at line 104 of file mortoncodes.cpp.

References Compact1By1().

Referenced by RENDER_3D_RAYTRACE::initializeBlockPositions().

◆ DecodeMorton3X()

uint32_t DecodeMorton3X ( uint32_t  code)

Definition at line 110 of file mortoncodes.cpp.

References Compact1By2().

◆ DecodeMorton3Y()

uint32_t DecodeMorton3Y ( uint32_t  code)

Definition at line 116 of file mortoncodes.cpp.

References Compact1By2().

◆ DecodeMorton3Z()

uint32_t DecodeMorton3Z ( uint32_t  code)

Definition at line 122 of file mortoncodes.cpp.

References Compact1By2().

◆ EncodeMorton2()

uint32_t EncodeMorton2 ( uint32_t  x,
uint32_t  y 
)

Definition at line 86 of file mortoncodes.cpp.

References Part1By1().

◆ EncodeMorton3()

uint32_t EncodeMorton3 ( uint32_t  x,
uint32_t  y,
uint32_t  z 
)

Definition at line 92 of file mortoncodes.cpp.

References Part1By2().

◆ Part1By1()

uint32_t Part1By1 ( uint32_t  x)

Definition at line 35 of file mortoncodes.cpp.

Referenced by EncodeMorton2().

◆ Part1By2()

uint32_t Part1By2 ( uint32_t  x)

Definition at line 48 of file mortoncodes.cpp.

Referenced by EncodeMorton3().