new Editor(world, options)
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
world |
module:core/World~World
|
World to edit | ||||||||||
options |
object
|
Options to configure editor
|
Examples
const Voxelcss = require('voxelcss');
let scene = new Voxelcss.Scene();
let world = new Voxelcss.World(scene);
scene.attach(document.body);
let editor = new Voxelcss.Editor(world);
let position = [10, 10, 10];
let size = 100;
editor.add(new Voxelcss.Voxel(position, size));
let mesh = Voxelcss.meshes.grass;
let grass = new Voxelcss.Voxel(position, size, {mesh});
editor.add(grass);