Draft groups in layers menu

TODO: don't use Bootstrap's switches!!
This commit is contained in:
2026-05-15 17:32:06 +02:00
parent 87245233b7
commit 11acecd33d
7 changed files with 88 additions and 31 deletions

View File

@@ -31,12 +31,14 @@ function createClippingPlaneMesh (boundingSphere) {
* @param {String} axis
*/
function dragClipper (planeMesh, axis) {
const controls = new THREE.DragControls(
[planeMesh],
const controls = new THREE.TransformControls(
ATON.Nav._camera,
ATON._renderer.domElement,
);
controls.attach(planeMesh);
controls.setMode('translate');
const startPosition = new THREE.Vector3();
// Only move along the selected axis (exlude the others)
const excludedAxes = ['x', 'y', 'z'].filter(a => a != axis);

View File

@@ -66,11 +66,11 @@ function traverseTree(node, flatList, depth = 1, inheritedColor = null) {
* Create a flat list of nodes from
* the nested structure in config
* @param {Array} nodes
* @returns {{flat: NormalizedSceneNode[], normNode: object}} A flat list of nodes
* @returns {{flat: NormalizedSceneNode[], tree: NormalizedSceneNode[]}} A flat list of nodes
**/
export function normalizeNodes (nodes) {
let flatList = [];
const normNode = traverseTree(nodes, flatList);
return {flat: flatList, normNode};
return {flat: flatList, tree: normNode.children};
}