chore(relationships): translate renderer comments

Keep newly added documentation and inline comments in English to match the shared codebase convention.
This commit is contained in:
digua committed 2026-08-12 00:49:59 +08:00
1 parent d5ad36dee6
commit 22938e4922
2 files changed
+9 -6

No files matched your search

@@ -559,7 +559,8 @@ function addNodeLayer(model: RelationshipGalaxy3DScene) {
geometry.setAttribute('aOpacity', new THREE.BufferAttribute(opacities, 1).setUsage(THREE.DynamicDrawUsage))
geometry.setAttribute('aSeed', new THREE.BufferAttribute(seeds, 1))
// 参考诗云:一个连续衰减的着色器点同时形成小白核和彩色外辉光,避免多层 Sprite 产生光圈和糊边。
// Inspired by Shiyun: one continuously fading shader point forms both the white core and colored outer glow,
// avoiding the rings and blur produced by stacked sprites.
nodeMaterial = new THREE.ShaderMaterial({
transparent: true,
depthWrite: false,
@@ -766,7 +767,7 @@ function resolveVisibleLabelCollisions(candidates: VisibleLabel[]): VisibleLabel
)
const visible: VisibleLabel[] = []
// 核心星团即使只显示少量标签也可能重叠;按视觉优先级保留,不改变节点或标签候选数据。
// Even a small label set can overlap in the core cluster; preserve labels by visual priority without changing data.
for (const candidate of sorted) {
const candidateWidth = estimateLabelWidth(candidate)
const overlaps = visible.some((item) => {
@@ -1014,7 +1015,8 @@ function refreshActiveFocus() {
const nextSignature = buildFocusFrameSignature(focusFrame)
if (nextSignature === activeFocusFrameSignature) return
// People 邻域数据会在首次聚焦后异步补齐;从当前镜头连续飞向新终点,避免关系点扩展后留在屏幕外。
// People neighborhood data can arrive after the initial focus; continue from the current camera to keep new points
// in view while correcting the destination.
focusNode(props.selectedKey, cameraFlight ? 520 : 620)
}
@@ -2,10 +2,11 @@ import { buildRelationshipGalaxy3DViewOffset } from './relationship-galaxy-3d-ca
import type { RelationshipGalaxy3DNode, RelationshipGalaxy3DScene } from './relationship-galaxy-3d-scene'
/**
* 只描述需要重建 Three.js 几何层的空间状态。
* Describes only the spatial state that requires rebuilding the Three.js geometry layer.
*
* 选中节点、关系边和名称变化都不应改变该签名,这些状态可以在原场景内增量更新;
* 节点坐标、颜色或星团光雾变化时才需要完整重建。
* Selection, relationship edges, and display name changes must not affect this signature because those states can be
* updated incrementally within the existing scene. Rebuild the scene only when node positions, colors, or community
* glow data changes.
*/
export function buildRelationshipGalaxy3DSceneLayoutSignature(model: RelationshipGalaxy3DScene): string {
const nodes = [...model.nodes]