-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathVoxelDataStructures.h
65 lines (52 loc) · 1.59 KB
/
VoxelDataStructures.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//Defines data structures for voxel, hashtable-entry, hashtable-params, voxel-block
#ifndef VOXEL_DATASTRUCTURES_H
#define VOXEL_DATASTRUCTURES_H
#include<cuda.h>
#include<cuda_runtime_api.h>
#include<cuda_runtime.h>
#include "cuda_helper/helper_math.h"
#include "cuda_helper/cuda_SimpleMatrixUtil.h"
__align__(8)
struct Voxel {
float sdf;
//unsigned char weight;
//unsigned int weight;
float weight;
};
__align__(16)
struct VoxelEntry {
int3 pos;
int ptr;
int offset;
//long padding1;
//int padding2;
};
__align__(16)
struct HashTableParams {
//HashTableParams() {
//}
float4x4 global_transform;
float4x4 inv_global_transform;
unsigned int numBuckets; //= 500000;
unsigned int bucketSize; // = 10;
unsigned int attachedLinkedListSize; // = 7;
unsigned int numVoxelBlocks; // =1000000;
int voxelBlockSize; // = 8;
float voxelSize; // = 0.05f;
unsigned int numOccupiedBlocks; // = 0; //occupied blocks in view frustum
float maxIntegrationDistance; // = 4.0f;
float truncScale; // = 0.01f;
float truncation; // = 0.02f;
unsigned int integrationWeightSample; // = 10;
float integrationWeightMax; // = 255;
};
struct PtrContainer {
unsigned int* d_heap; //linear buffer with indices to all unallocated blocks
VoxelEntry* d_hashTable; //actual hashtable
VoxelEntry* d_compactifiedHashTable;
int* d_hashTableBucketMutex; //mutex that'll decide wheter further allocations in bucket can be made or not
Voxel* d_SDFBlocks; //Actual underlying 3D geometry in TSDF form. Very important.
int* d_heapCounter; //single int keeping track of numBlocks allocated
int* d_compactifiedHashCounter;
};
#endif