Polyphase Game Engine
Loading...
Searching...
No Matches
Voxel3d_Lua.h
Go to the documentation of this file.
1#pragma once
2
3#include "EngineTypes.h"
4#include "Log.h"
5#include "Engine.h"
6
7#include "Nodes/3D/Voxel3d.h"
8
11
12#if LUA_ENABLED
13
14#define VOXEL_3D_LUA_NAME "Voxel3D"
15#define VOXEL_3D_LUA_FLAG "cfVoxel3D"
16#define CHECK_VOXEL_3D(L, arg) static_cast<Voxel3D*>(CheckNodeLuaType(L, arg, VOXEL_3D_LUA_NAME, VOXEL_3D_LUA_FLAG));
17
18struct Voxel3D_Lua
19{
20 // Voxel access
21 static int SetVoxel(lua_State* L);
22 static int GetVoxel(lua_State* L);
23 static int GetVoxelWorldPosition(lua_State* L);
24 static int RayTest(lua_State* L);
25 static int RayTestScreen(lua_State* L);
26 static int RayTestCenterCamera(lua_State* L);
27 static int GetVoxelAtWorldPosition(lua_State* L);
28
29 // Bulk operations
30 static int Fill(lua_State* L);
31 static int FillRegion(lua_State* L);
32 static int FillSphere(lua_State* L);
33 static int FillCylinder(lua_State* L);
34
35 // Shape queries
36 static int GetVoxelsInSphere(lua_State* L);
37 static int GetVoxelsInBox(lua_State* L);
38 static int GetVoxelsInCylinder(lua_State* L);
39 static int GetVoxelNeighbors(lua_State* L);
40
41 // Mesh control
42 static int MarkDirty(lua_State* L);
43 static int RebuildMesh(lua_State* L);
44 static int IsDirty(lua_State* L);
45
46 // Dimensions
47 static int GetDimensions(lua_State* L);
48
49 // Atlas texturing
50 static int SetAtlasTexture(lua_State* L);
51 static int GetAtlasTexture(lua_State* L);
52 static int SetAtlasEnabled(lua_State* L);
53 static int IsAtlasEnabled(lua_State* L);
54 static int SetMaterialTexture(lua_State* L);
55 static int SetMaterialTint(lua_State* L);
56 static int DisableMaterialTexture(lua_State* L);
57
58 static void Bind();
59};
60
61#endif