Tune section toolbar icons and gizmo thickness
This commit is contained in:
@@ -126568,6 +126568,45 @@ class TransformControl {
|
||||
axisHandle: tubeGeometry(handleRadius, arrowLength, 20)
|
||||
};
|
||||
|
||||
const updateGeometryPositions = (geometry, cfg) => {
|
||||
if (geometry?.positions && cfg?.positions && geometry.positions.length === cfg.positions.length) {
|
||||
geometry.positions = cfg.positions;
|
||||
}
|
||||
};
|
||||
|
||||
this._guideThicknessScale = 1;
|
||||
this._setGuideThickness = (scale = 1) => {
|
||||
const nextScale = Math.max(0.5, Math.min(2.5, Number(scale) || 1));
|
||||
if (nextScale === this._guideThicknessScale) {
|
||||
return;
|
||||
}
|
||||
this._guideThicknessScale = nextScale;
|
||||
const guideTube = tubeRadius * nextScale;
|
||||
updateGeometryPositions(shapes.curve, buildTorusGeometry({
|
||||
radius: arrowLength - 0.2,
|
||||
tube: guideTube,
|
||||
radialSegments: 64,
|
||||
tubeSegments: 14,
|
||||
arc: (Math.PI * 2.0) * 0.25
|
||||
}));
|
||||
updateGeometryPositions(shapes.hoop, buildTorusGeometry({
|
||||
radius: arrowLength - 0.2,
|
||||
tube: guideTube,
|
||||
radialSegments: 64,
|
||||
tubeSegments: 8,
|
||||
arc: Math.PI * 2.0
|
||||
}));
|
||||
updateGeometryPositions(shapes.axis, buildCylinderGeometry({
|
||||
radiusTop: guideTube,
|
||||
radiusBottom: guideTube,
|
||||
radialSegments: 20,
|
||||
heightSegments: 1,
|
||||
height: arrowLength,
|
||||
openEnded: false
|
||||
}));
|
||||
rootNode.scene?.glRedraw?.();
|
||||
};
|
||||
|
||||
const colorMaterial = (rgb) => new PhongMaterial(rootNode, {
|
||||
diffuse: rgb,
|
||||
emissive: rgb,
|
||||
@@ -127051,6 +127090,9 @@ class TransformControl {
|
||||
this._styleScale = style.gizmoDiameter;
|
||||
this._applyRootScale?.();
|
||||
}
|
||||
if (style.gizmoThickness !== undefined) {
|
||||
this._setGuideThickness?.(style.gizmoThickness);
|
||||
}
|
||||
if (style.axes) {
|
||||
this._displayMeshes.x?.setColor?.(style.axes.x);
|
||||
this._displayMeshes.y?.setColor?.(style.axes.y);
|
||||
|
||||
Reference in New Issue
Block a user