mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.22.10
This commit is contained in:
parent
c54ee39c68
commit
efb8279abb
7 changed files with 83 additions and 103 deletions
|
|
@ -14,6 +14,7 @@ let Renderer, scene, camera, controls, animationFrame, material, texture,
|
|||
|
||||
// initiate 3d scene
|
||||
const create = async function(canvas, type = "viewMesh") {
|
||||
options.isOn = true;
|
||||
options.isGlobe = type === "viewGlobe";
|
||||
return options.isGlobe ? newGlobe(canvas) : newMesh(canvas);
|
||||
}
|
||||
|
|
@ -57,6 +58,8 @@ const stop = function() {
|
|||
texture = undefined;
|
||||
geometry = undefined;
|
||||
mesh = undefined;
|
||||
|
||||
ThreeD.options.isOn = false;
|
||||
}
|
||||
|
||||
const setScale = function(scale) {
|
||||
|
|
@ -81,10 +84,11 @@ const setSun = function(x, y, z) {
|
|||
}
|
||||
|
||||
const setRotation = function(speed) {
|
||||
cancelAnimationFrame(animationFrame);
|
||||
if (options.isGlobe) options.rotateGlobe = speed; else options.rotateMesh = speed;
|
||||
controls.autoRotateSpeed = speed;
|
||||
controls.autoRotate = Boolean(controls.autoRotateSpeed);
|
||||
controls.autoRotate ? animate() : cancelAnimationFrame(animationFrame);
|
||||
if (controls.autoRotate) animate();
|
||||
}
|
||||
|
||||
const toggleSky = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue