mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 11:40:11 +02:00
blocks spawning
This commit is contained in:
parent
b9985031da
commit
7ffcce589d
1 changed files with 11 additions and 11 deletions
|
@ -9,18 +9,18 @@ var blocks = [];
|
|||
|
||||
spawnBlocks();
|
||||
|
||||
var table = Entities.addEntity({
|
||||
type: "Box",
|
||||
position: Vec3.sum(center, {x: 0, y: -0.2, z: 0}),
|
||||
dimensions: {x: 2, y: .01, z: 2},
|
||||
color: {red: 20, green: 20, blue: 20}
|
||||
})
|
||||
// var table = Entities.addEntity({
|
||||
// type: "Box",
|
||||
// position: Vec3.sum(center, {x: 0, y: -0.2, z: 0}),
|
||||
// dimensions: {x: 2, y: .01, z: 2},
|
||||
// color: {red: 20, green: 20, blue: 20}
|
||||
// })
|
||||
function spawnBlocks() {
|
||||
for (var i = 0; i < NUM_BLOCKS; i++) {
|
||||
var block = Entities.addEntity({
|
||||
type: "Model",
|
||||
modelURL: modelUrl,
|
||||
position: center,
|
||||
position: {x: 548.3, y:495.55, z:504.4},
|
||||
shapeType: 'box',
|
||||
name: "block",
|
||||
dimensions: Vec3.sum(BASE_DIMENSIONS, {x: Math.random()/10, y: Math.random()/10, z:Math.random()/10}),
|
||||
|
@ -34,10 +34,10 @@ function spawnBlocks() {
|
|||
}
|
||||
|
||||
function cleanup() {
|
||||
Entities.deleteEntity(table);
|
||||
blocks.forEach(function(block) {
|
||||
Entities.deleteEntity(block);
|
||||
});
|
||||
// Entities.deleteEntity(table);
|
||||
// blocks.forEach(function(block) {
|
||||
// Entities.deleteEntity(block);
|
||||
// });
|
||||
}
|
||||
|
||||
Script.scriptEnding.connect(cleanup);
|
Loading…
Reference in a new issue