mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 12:43:19 +02:00
Merge pull request #6432 from huffman/lod-range
Increase available range in LOD Tools
This commit is contained in:
commit
45e8ebbe8c
2 changed files with 41 additions and 1 deletions
40
examples/tests/lodTest.js
Normal file
40
examples/tests/lodTest.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// lodTest.js
|
||||
// examples/tests
|
||||
//
|
||||
// Created by Ryan Huffman on 11/19/15.
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var MIN_DIM = 0.001;
|
||||
var MAX_DIM = 2.0;
|
||||
var NUM_SPHERES = 20;
|
||||
|
||||
// Rough estimate of the width the spheres will span, not taking into account MIN_DIM
|
||||
var WIDTH = MAX_DIM * NUM_SPHERES;
|
||||
|
||||
var entities = [];
|
||||
var right = Quat.getRight(Camera.orientation);
|
||||
// Starting position will be 30 meters in front of the camera
|
||||
var position = Vec3.sum(Camera.position, Vec3.multiply(30, Quat.getFront(Camera.orientation)));
|
||||
position = Vec3.sum(position, Vec3.multiply(-WIDTH/2, right));
|
||||
|
||||
for (var i = 0; i < NUM_SPHERES; ++i) {
|
||||
var dim = (MAX_DIM - MIN_DIM) * ((i + 1) / NUM_SPHERES);
|
||||
entities.push(Entities.addEntity({
|
||||
type: "Sphere",
|
||||
dimensions: { x: dim, y: dim, z: dim },
|
||||
position: position,
|
||||
}));
|
||||
|
||||
position = Vec3.sum(position, Vec3.multiply(dim * 2, right));
|
||||
}
|
||||
|
||||
Script.scriptEnding.connect(function() {
|
||||
for (var i = 0; i < entities.length; ++i) {
|
||||
Entities.deleteEntity(entities[i]);
|
||||
}
|
||||
})
|
|
@ -24,7 +24,7 @@ const int HALF_TREE_SCALE = TREE_SCALE / 2;
|
|||
const float DEFAULT_OCTREE_SIZE_SCALE = TREE_SCALE * 400.0f;
|
||||
|
||||
// This is used in the LOD Tools to translate between the size scale slider and the values used to set the OctreeSizeScale
|
||||
const float MAX_LOD_SIZE_MULTIPLIER = 800.0f;
|
||||
const float MAX_LOD_SIZE_MULTIPLIER = 4000.0f;
|
||||
|
||||
const int NUMBER_OF_CHILDREN = 8;
|
||||
|
||||
|
|
Loading…
Reference in a new issue