-
Notifications
You must be signed in to change notification settings - Fork 23
Create Voxels
Lucas Damian Johnson edited this page Feb 13, 2023
·
23 revisions
In order to add a voxel to DVE you will need to register three things.
- The textures the voxel will use. This is done in the
Renderthread. - The data for the voxel. This is done in the
Worldthread. - An object that will construct the voxel. This is done in the
Constructorthread.
Here is an example of adding one voxel to the engine:
DVER.textures.registerTexture([
{
type: "#dve_solid",
id: "debug",
frames: 0,
variations: {
top: { frames: 0 },
bottom: { frames: 0 },
north: { frames: 0 },
south: { frames: 0 },
east: { frames: 0 },
west: { frames: 0 },
},
}
]); DVEW.voxelManager.registerVoxelData([
{
id: "dve_debugbox",
tags: [
["#dve_substance", "#dve_solid"],
["#dve_shape_id", "#dve_box"],
["#dve_is_light_source", true],
["#dve_light_value", [15, 15, 15]],
["#dve_collider_id", "#dve_box"],
["#dve_check_collisions", true],
["#dve_material", "stone"],
],
}
]); DVEC.voxelManager.registerVoxel([
DVEC.voxelManager.defaults.box.simple("dve_debugbox", {
top: ["#dve_solid", "debug", "top"],
bottom: ["#dve_solid", "debug", "bottom"],
north: ["#dve_solid", "debug", "north"],
south: ["#dve_solid", "debug", "south"],
east: ["#dve_solid", "debug", "east"],
west: ["#dve_solid", "debug", "west"],
})
]);