mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2024-11-21 13:07:22 +00:00
don't use super-three
faster loading through geometry re-use
This commit is contained in:
parent
2a5fad3c87
commit
7bb0e46e56
@ -29,8 +29,8 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/super-three@0.116.0/build/three.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/super-three@0.116.0/examples/js/controls/OrbitControls.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/three@0.116.0/build/three.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/three@0.116.0/examples/js/controls/OrbitControls.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='lddviewer/base64-binary.js') }}"></script>
|
||||
@ -59,8 +59,8 @@
|
||||
{% endif %}
|
||||
|
||||
<script type='module'>
|
||||
import {MTLLoader} from 'https://cdn.jsdelivr.net/npm/super-three@0.116.0/examples/jsm/loaders/MTLLoader.js'
|
||||
import {OBJLoader} from 'https://cdn.jsdelivr.net/npm/super-three@0.116.0/examples/jsm/loaders/OBJLoader.js'
|
||||
import {MTLLoader} from 'https://cdn.jsdelivr.net/npm/three@0.116.0/examples/jsm/loaders/MTLLoader.js'
|
||||
import {OBJLoader} from 'https://cdn.jsdelivr.net/npm/three@0.116.0/examples/jsm/loaders/OBJLoader.js'
|
||||
//Three.js stuff
|
||||
const scene = new THREE.Scene();
|
||||
let cammatr = new THREE.Matrix4();
|
||||
@ -589,13 +589,15 @@
|
||||
for (const bri of this.scene.Bricks){
|
||||
current += 1
|
||||
for (const pa of bri.Parts){
|
||||
let geo = new Geometry(pa.designID, this.database)
|
||||
if (!(pa.designID in geometriecache)) {
|
||||
let geo = new Geometry(pa.designID, this.database)
|
||||
geometriecache[pa.designID] = geo
|
||||
let geo = 0
|
||||
if (geometriecache.hasOwnProperty(pa.designID)) {
|
||||
// console.log(`Re-use brick ${pa.designID}`)
|
||||
geo = geometriecache[pa.designID]
|
||||
}
|
||||
else {
|
||||
geo = geometriecache[pa.designID]
|
||||
// console.log(`New brick ${pa.designID}`)
|
||||
geo = new Geometry(pa.designID, this.database)
|
||||
geometriecache[pa.designID] = geo
|
||||
}
|
||||
|
||||
let ind = 0
|
||||
|
Loading…
Reference in New Issue
Block a user