overte/libraries/shared/src/OctalCode.h
ZappoMan 4085c94aa7 made a version of firstVertexForCode() that doesn't allocate memory, for improved performance and use
- created new copyFirstVertexForCode(code,output) which copies to the output buffer
- converted firstVertexForCode() to behave same way as before, but use copy version
2013-04-19 18:11:28 -07:00

26 lines
862 B
C

//
// OctalCode.h
// hifi
//
// Created by Stephen Birarda on 3/15/13.
//
//
#ifndef __hifi__OctalCode__
#define __hifi__OctalCode__
#include <string.h>
void printOctalCode(unsigned char * octalCode);
int bytesRequiredForCodeLength(unsigned char threeBitCodes);
bool isDirectParentOfChild(unsigned char *parentOctalCode, unsigned char * childOctalCode);
int branchIndexWithDescendant(unsigned char * ancestorOctalCode, unsigned char * descendantOctalCode);
unsigned char * childOctalCode(unsigned char * parentOctalCode, char childNumber);
// Note: copyFirstVertexForCode() is preferred because it doesn't allocate memory for the return
// but other than that these do the same thing.
float * firstVertexForCode(unsigned char * octalCode);
void copyFirstVertexForCode(unsigned char * octalCode, float* output);
#endif /* defined(__hifi__OctalCode__) */