Compare commits
2 Commits
grouped-me
...
aa9a6f56b6
| Author | SHA1 | Date | |
|---|---|---|---|
| aa9a6f56b6 | |||
| 106841f6ef |
@@ -56,16 +56,16 @@ export default class extends Controller {
|
|||||||
btn.classList.remove('border', 'border-2', 'border-warning');
|
btn.classList.remove('border', 'border-2', 'border-warning');
|
||||||
});
|
});
|
||||||
|
|
||||||
// AO should be turned off if clipping is enabled
|
|
||||||
toggleAmbientOcclusion(!this.enabledValue);
|
|
||||||
|
|
||||||
if (this.enabledValue) {
|
if (this.enabledValue) {
|
||||||
|
// AO should be turned off if clipping is enabled
|
||||||
|
toggleAmbientOcclusion(false);
|
||||||
trigger.className += ' border border-2 border-white';
|
trigger.className += ' border border-2 border-white';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.enabledValue) {
|
if (!this.enabledValue) {
|
||||||
resetClipping();
|
resetClipping();
|
||||||
trigger.className = trigger.className.replace(/ border.*$/g, '');
|
trigger.className = trigger.className.replace(/ border.*$/g, '');
|
||||||
|
toggleAmbientOcclusion(AppState.ambientOcclusion);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppState.clipping.enabled = this.enabledValue;
|
AppState.clipping.enabled = this.enabledValue;
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ export default class extends Controller {
|
|||||||
<i class="bi bi-chevron-down me-1"></i>${node.id}
|
<i class="bi bi-chevron-down me-1"></i>${node.id}
|
||||||
`;
|
`;
|
||||||
// Add color "swatch" only for first level groups
|
// Add color "swatch" only for first level groups
|
||||||
|
/*
|
||||||
if (node.depth === 2) {
|
if (node.depth === 2) {
|
||||||
trigger.innerHTML += html`
|
trigger.innerHTML += html`
|
||||||
<div class="d-inline-block border rounded ms-2"
|
<div class="d-inline-block border rounded ms-2"
|
||||||
@@ -200,6 +201,7 @@ export default class extends Controller {
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
const collapseDiv = document.createElement('div');
|
const collapseDiv = document.createElement('div');
|
||||||
collapseDiv.className = 'collapse';
|
collapseDiv.className = 'collapse';
|
||||||
|
|||||||
@@ -79,10 +79,12 @@ function loadNodes(nodes) {
|
|||||||
node.load(n.model);
|
node.load(n.model);
|
||||||
node.setRotation(...config.scene.initRotation);
|
node.setRotation(...config.scene.initRotation);
|
||||||
|
|
||||||
|
/*
|
||||||
node.setMaterial(new THREE.MeshPhongMaterial({
|
node.setMaterial(new THREE.MeshPhongMaterial({
|
||||||
transparent: false,
|
transparent: false,
|
||||||
color: n.color ?? '#fff',
|
color: n.color ?? '#fff',
|
||||||
}));
|
}));
|
||||||
|
*/
|
||||||
|
|
||||||
// Apply any transparency before attaching to scene
|
// Apply any transparency before attaching to scene
|
||||||
if (n.opacity !== undefined && n.opacity !== null) {
|
if (n.opacity !== undefined && n.opacity !== null) {
|
||||||
|
|||||||
@@ -31,14 +31,12 @@ function createClippingPlaneMesh (boundingSphere) {
|
|||||||
* @param {String} axis
|
* @param {String} axis
|
||||||
*/
|
*/
|
||||||
function dragClipper (planeMesh, axis) {
|
function dragClipper (planeMesh, axis) {
|
||||||
const controls = new THREE.TransformControls(
|
const controls = new THREE.DragControls(
|
||||||
|
[planeMesh],
|
||||||
ATON.Nav._camera,
|
ATON.Nav._camera,
|
||||||
ATON._renderer.domElement,
|
ATON._renderer.domElement,
|
||||||
);
|
);
|
||||||
|
|
||||||
controls.attach(planeMesh);
|
|
||||||
controls.setMode('translate');
|
|
||||||
|
|
||||||
const startPosition = new THREE.Vector3();
|
const startPosition = new THREE.Vector3();
|
||||||
// Only move along the selected axis (exlude the others)
|
// Only move along the selected axis (exlude the others)
|
||||||
const excludedAxes = ['x', 'y', 'z'].filter(a => a != axis);
|
const excludedAxes = ['x', 'y', 'z'].filter(a => a != axis);
|
||||||
|
|||||||
Reference in New Issue
Block a user