codex/aiprovider-foundation #4
@@ -7,6 +7,27 @@ This project follows the repository versioning rule:
|
||||
- `feature` -> `+0.1.0`
|
||||
- `bugfix` -> `+0.0.1`
|
||||
|
||||
## 0.22.13
|
||||
|
||||
Released: 2026-04-07
|
||||
|
||||
### Highlights
|
||||
|
||||
- Added zoom-aware drag sensitivity on Earth interaction so drag distance naturally becomes finer when zoomed in and faster when zoomed out.
|
||||
- Shipped as a focused bugfix release (`+0.0.1`) to improve operation feel without changing existing data/visual layers.
|
||||
|
||||
### Improved
|
||||
|
||||
- Improved [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) by replacing fixed drag rotation gain with a dynamic factor derived from current zoom level.
|
||||
- Improved [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) by introducing `getDragRotationFactor()` so interaction tuning stays centralized instead of mixing formulas in pointer handlers.
|
||||
- Improved [constants.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/constants.js) by adding explicit drag tuning knobs:
|
||||
`dragRotationFactorBase`, `dragRotationScaleMin`, and `dragRotationScaleMax`.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed the previous interaction mismatch where drag traveled the same angular distance regardless of zoom level, making close-up inspection too jumpy and far-view browsing too slow.
|
||||
- Fixed maintainability drift where drag sensitivity had a hardcoded literal in logic code instead of configurable constants.
|
||||
|
||||
## 0.22.12
|
||||
|
||||
Released: 2026-04-02
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "planet-frontend",
|
||||
"version": "0.22.12",
|
||||
"version": "0.22.13",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
|
||||
@@ -7,6 +7,9 @@ export const CONFIG = {
|
||||
maxZoom: 5.0,
|
||||
earthRadius: 100,
|
||||
rotationSpeed: 0.0005,
|
||||
dragRotationFactorBase: 0.005,
|
||||
dragRotationScaleMin: 0.28,
|
||||
dragRotationScaleMax: 2.0,
|
||||
};
|
||||
|
||||
// Earth coordinate constants
|
||||
|
||||
@@ -108,6 +108,7 @@ import {
|
||||
getShowTerrain,
|
||||
setAutoRotate,
|
||||
resetView,
|
||||
getZoomLevel,
|
||||
teardownControls,
|
||||
} from "./controls.js";
|
||||
import {
|
||||
@@ -170,7 +171,6 @@ const scratchBGPDirection = new THREE.Vector3();
|
||||
const scratchBGPWorldPosition = new THREE.Vector3();
|
||||
|
||||
const cleanupFns = [];
|
||||
const DRAG_ROTATION_FACTOR = 0.005;
|
||||
const DRAG_SMOOTHING_FACTOR = 0.18;
|
||||
const INERTIA_DAMPING = 0.92;
|
||||
const INERTIA_MIN_VELOCITY = 0.00008;
|
||||
@@ -201,6 +201,16 @@ function isEventOnHud(event) {
|
||||
return HUD_INTERACTIVE_SELECTORS.some((selector) => target.closest(selector));
|
||||
}
|
||||
|
||||
function getDragRotationFactor() {
|
||||
const zoom = Math.max(getZoomLevel(), 0.01);
|
||||
const scale = THREE.MathUtils.clamp(
|
||||
1 / zoom,
|
||||
CONFIG.dragRotationScaleMin,
|
||||
CONFIG.dragRotationScaleMax,
|
||||
);
|
||||
return CONFIG.dragRotationFactorBase * scale;
|
||||
}
|
||||
|
||||
function disposeMaterial(material) {
|
||||
if (!material) return;
|
||||
if (Array.isArray(material)) {
|
||||
@@ -1142,8 +1152,9 @@ function onMouseMove(event) {
|
||||
|
||||
const deltaX = event.clientX - previousMousePosition.x;
|
||||
const deltaY = event.clientY - previousMousePosition.y;
|
||||
const rotationDeltaY = deltaX * DRAG_ROTATION_FACTOR;
|
||||
const rotationDeltaX = deltaY * DRAG_ROTATION_FACTOR;
|
||||
const dragRotationFactor = getDragRotationFactor();
|
||||
const rotationDeltaY = deltaX * dragRotationFactor;
|
||||
const rotationDeltaX = deltaY * dragRotationFactor;
|
||||
|
||||
targetRotation.y += rotationDeltaY;
|
||||
targetRotation.x += rotationDeltaX;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "planet"
|
||||
version = "0.22.12"
|
||||
version = "0.22.13"
|
||||
description = "智能星球计划 - 态势感知系统"
|
||||
requires-python = ">=3.14"
|
||||
dependencies = [
|
||||
|
||||
Reference in New Issue
Block a user