change:换了背景图,去掉了固定服务器里写的sls
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
2026-09-13 15:20:25 +08:00
parent 6fa9461d2d
commit 3cf55130a7
10 changed files with 216 additions and 87 deletions

View File

@ -4,7 +4,6 @@
<script setup lang="ts">
import * as THREE from 'three'
import { type GLTF, GLTFLoader } from 'three/examples/jsm/Addons.js'
import { onMounted, onScopeDispose, useTemplateRef } from 'vue'
import { useTheming } from '@/store/theme'
@ -17,20 +16,6 @@ function isDarkMode() {
return ['dark', 'oled'].includes(themeStore.selectedTheme)
}
function loadGLTF(url: string): Promise<GLTF> {
return new Promise((res, rej) => {
const loader = new GLTFLoader()
loader.load(
url,
(data) => {
res(data)
},
undefined,
rej,
)
})
}
function createTip(position: THREE.Vector3, color: THREE.ColorRepresentation = 0x00ff00) {
const tipGeometry = new THREE.SphereGeometry(2)
const tipMaterial = new THREE.MeshBasicMaterial({ color })
@ -224,43 +209,16 @@ function main() {
scene.add(createWater(waterMaterial, new THREE.Vector3(2, -8, -10)))
scene.add(createWater(waterMaterial, new THREE.Vector3(16, -8, -26)))
async function load() {
const axlGLTF = await loadGLTF('/models/axolotl.gltf')
// 静止的下界之星(替换原动态美西螈)
const starTexture = new THREE.TextureLoader().load('/models/netherstar.png')
starTexture.colorSpace = THREE.SRGBColorSpace
const starMaterial = new THREE.SpriteMaterial({ map: starTexture, transparent: true })
const starSprite = new THREE.Sprite(starMaterial)
starSprite.scale.set(8, 8, 1)
starSprite.position.set(0, -2.5, 0)
scene.add(starSprite)
const axlModel = axlGLTF.scene
axlModel.scale.multiplyScalar(5)
axlModel.rotateY(Math.PI / 2)
axlModel.position.add(new THREE.Vector3(0, -2.5, 0))
scene.add(axlModel)
const mixer = new THREE.AnimationMixer(axlModel)
const axlSwimAnim = axlGLTF.animations.filter((a) => a.name === 'swim')[0]
if (!axlSwimAnim) return console.error('Missing animation swim')
mixer.clipAction(axlSwimAnim).play()
// // Axl Label
// const axlLabelGLTF = await loadGLTF('/models/axl_label.glb')
// const axlLabel = axlLabelGLTF.scene
// axlLabel.scale.multiplyScalar(8)
// axlLabel.rotateY(-Math.PI / 2)
// axlLabel.position.set(0, 5.2, 0)
// scene.add(axlLabel)
const originAxlModelPosition = axlModel.position.clone()
return function (deltaTime: number, elapsedTime: number) {
axlModel.position.set(
originAxlModelPosition.x,
originAxlModelPosition.y + Math.sin(elapsedTime),
originAxlModelPosition.z,
)
axlModel.rotation.y = Math.sin(elapsedTime * 0.3) * 0.2 + (Math.PI * 100) / 180
mixer.update(deltaTime)
}
}
let updateGLTF = (_deltaTime: number, _elapsedTime: number) => {}
load().then((updateFn) => {
if (updateFn) updateGLTF = updateFn
})
const circleMaterial = createCircleMaterial()
circleMaterial.uniforms.color.value = new THREE.Color(accentColor).multiplyScalar(

View File

@ -51,7 +51,6 @@ import type {
} from '@/helpers/worlds.ts'
import {
getWorldIdentifier,
PROTECTED_SERVER_ADDRESS,
set_world_display_status,
} from '@/helpers/worlds.ts'
@ -149,9 +148,6 @@ const managed = computed(() => props.managed)
const shortcutInstanceId = computed(() => props.shortcutInstanceId ?? props.instanceId)
const homePinTarget = computed(() => props.shortcutInstanceId ?? props.instanceId)
const pinnedToHome = computed(() => props.world.display_status === 'favorite')
const protectedServer = computed(
() => props.world.type === 'server' && props.world.address === PROTECTED_SERVER_ADDRESS,
)
async function updateHomePin() {
if (!homePinTarget.value) return
@ -519,8 +515,8 @@ const messages = defineMessages({
{
id: 'edit',
action: () => emit('edit'),
shown: !instanceId && !protectedServer,
disabled: locked || managed || protectedServer,
shown: !instanceId,
disabled: locked || managed,
tooltip: locked
? formatMessage(messages.worldInUse)
: managed
@ -538,7 +534,7 @@ const messages = defineMessages({
},
{
id: pinnedToHome ? 'unpin-home' : 'pin-home',
shown: !!homePinTarget && !protectedServer,
shown: !!homePinTarget,
action: updateHomePin,
},
{
@ -555,8 +551,8 @@ const messages = defineMessages({
color: 'red',
hoverFilled: true,
action: () => emit('delete'),
shown: !instanceId && !protectedServer,
disabled: locked || managed || protectedServer,
shown: !instanceId,
disabled: locked || managed,
tooltip: locked
? formatMessage(messages.worldInUse)
: managed