Skip to content

armgit / andee

Public Imported from GitHub
0

Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。

feat(ball): a cuter Andee, and thinking eyes that stay on the ball

booboosui87725e9293ef
diff --git a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/BallLook.kt b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/BallLook.kt
index 36f7c47..132afc2 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/BallLook.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/BallLook.kt
@@ -1113,7 +1113,7 @@ val BAJIE = BallLook(
*/
val ANDEE = BallLook(
name = "andee",
- bodyBase = floatArrayOf(0.200f, 0.560f, 1.000f),
+ bodyBase = floatArrayOf(0.250f, 0.460f, 0.870f),
bodyTint = 0.10f,
bodyAlbedo = 1.00f,
bodyGrad = 0.26f,
@@ -1121,40 +1121,40 @@ val ANDEE = BallLook(
bodyDiff = 0.20f,
// Soft, like the picture — a velvety plush, not lacquer. Low enough that
// the crown does not grow a white blob that would fight the catchlights.
- bodyGloss = 0.22f,
+ bodyGloss = 0.05f,
bodyScale = 0.870f,
faceZ = 0.876f,
- eyeX = 0.338f,
+ eyeX = 0.345f,
// Raised 0.12 from the picture's own −0.03, after the horns were raised twice:
// with horns that tall the sphere read as a forehead dome with a face stuck on
// the bottom of it — 1.7 eye-diameters of blank above the eyes against the
// picture's 1.4. Eyes, mouth, cheeks and the sleep bubble all moved together so
// the face is the same face, one notch higher.
- eyeY = 0.090f,
- eyeRadius = 0.175f,
+ eyeY = 0.070f,
+ eyeRadius = 0.215f,
eyeCyl = 0.012f,
- mouthR = 0.136f,
- mouthTube = 0.024f,
+ mouthR = 0.115f,
+ mouthTube = 0.028f,
mouthY = -0.285f,
mouthThick = 0.140f,
- eyeColor = floatArrayOf(0.030f, 0.065f, 0.230f),
+ eyeColor = floatArrayOf(0.035f, 0.080f, 0.280f),
pupilR = 0f,
- glintR = 0.038f,
- glint2R = 0.034f,
+ glintR = 0.065f,
+ glint2R = 0.050f,
glint2Color = floatArrayOf(0.45f, 0.70f, 1.00f),
gestures = true,
// 0.09 now, from 0.17: the eyes already sit 0.12 higher, so the same lift would
// put them well clear of the ledge and leave the peeking ball with no forehead.
- clingLift = 0.09f,
+ clingLift = 0.16f,
smileRoll = 0f,
mouthInk = floatArrayOf(0.025f, 0.045f, 0.140f),
arcScale = 1.5f,
scanGain = 0.12f,
- rimTint = floatArrayOf(1.0f, 0.52f, 0.42f),
- rimTintMix = 0.55f,
+ rimTint = floatArrayOf(1.0f, 0.62f, 0.50f),
+ rimTintMix = 1.0f,
// Light droplet on a mid-dark body, the same side of the split as [BEAR].
bubbleX = 0.085f,
- bubbleY = 0.090f,
+ bubbleY = 0.070f,
bubbleR = 0.085f,
bubbleColor = floatArrayOf(0.88f, 0.93f, 1.00f),
bubblePow = 3.0f,
@@ -1167,12 +1167,12 @@ val ANDEE = BallLook(
blushBlendNormal = true,
blushSize = 0.40f,
blushX = 0.440f,
- blushY = 0.010f,
+ blushY = -0.010f,
// A light rim, like the imp's and bear's: a dark outline on a mid-dark body
// is a smudge.
rimDark = false,
- rimGain = 0.80f,
- rimPow = 4.4f,
+ rimGain = 1.30f,
+ rimPow = 3.0f,
// See the class note: fitted to the picture's horn, then raised twice on request
// — the second time (0.477 → 0.53, tilt 50 → 38, bend −80 → −62, a longer horn)
@@ -1183,17 +1183,17 @@ val ANDEE = BallLook(
// mixed half and half is a dull lilac, so it goes nearly all the way (0.9) over
// the last ~40% of the horn: the very end is peach, and only the short stretch
// between is the in-between colour.
- hornH = 0.520f,
- hornR = 0.290f,
+ hornH = 0.420f,
+ hornR = 0.265f,
hornX = 0.400f,
- hornY = 0.530f,
- hornZ = 0.450f,
- hornTilt = 38f,
- hornBend = -62f,
+ hornY = 0.540f,
+ hornZ = 0.220f,
+ hornTilt = 30f,
+ hornBend = -50f,
hornTaper = 0.9f,
hornShade = 1.00f,
hornTipColor = floatArrayOf(1.00f, 0.70f, 0.58f),
- hornTipMix = 0.90f,
+ hornTipMix = 0.00f,
// 1.5 rather than 1: measured on the device, a wiggle at 1 moves the horns about
// 10 px against the eyes on a 420 dp ball, which is about 3° and at the real
// 168 dp size is a pixel and a half — present, and not visible.
diff --git a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionBallRenderer.kt b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionBallRenderer.kt
index 8a83be9..d73f75f 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionBallRenderer.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionBallRenderer.kt
@@ -263,9 +263,9 @@ class EmotionBallRenderer {
*/
val eye: Mesh =
if (look.eyeCut > 0f)
- Eye.build(look.eyeRadius, look.eyeCyl, look.eyeCut, 4, 12)
- else Capsule.build(look.eyeRadius, look.eyeCyl, 4, 12)
- val mouth: Mesh = Torus.build(look.mouthR, look.mouthTube, 8, 24, PI.toFloat())
+ Eye.build(look.eyeRadius, look.eyeCyl, look.eyeCut, 10, 48)
+ else Capsule.build(look.eyeRadius, look.eyeCyl, 10, 48)
+ val mouth: Mesh = Torus.build(look.mouthR, look.mouthTube, 10, 48, PI.toFloat())
/**
* The eye with its top sliced flat, for a look with [BallLook.gestures] —
@@ -284,7 +284,7 @@ class EmotionBallRenderer {
*/
val eyeCut: Mesh? =
if (look.gestures)
- Eye.build(look.eyeRadius, look.eyeCyl, max(GESTURE_LID_CUT, look.eyeCut), 4, 12)
+ Eye.build(look.eyeRadius, look.eyeCyl, max(GESTURE_LID_CUT, look.eyeCut), 10, 48)
else null
val horn: Mesh? =
if (look.hornH > 0f)
@@ -292,8 +292,8 @@ class EmotionBallRenderer {
look.hornR, look.hornH, look.hornBend / DEG,
// A rounded profile packs its curvature into the last rings,
// so it needs more of them than the straight thorn does.
- segs = if (look.hornTaper != 1f) 12 else 7,
- radialSegs = 12,
+ segs = if (look.hornTaper != 1f) 20 else 7,
+ radialSegs = 28,
taper = look.hornTaper,
)
else null
@@ -460,15 +460,15 @@ class EmotionBallRenderer {
// to crown the eye instead of leaning off to one side — that rotation
// is EYE_ARC_ROT_Z. Its size does not come from the look, so unlike the
// round eye and the mouth there is only ever one of it.
- eyeArcMesh = Torus.build(0.1f, 0.03f, 6, 20, EYE_ARC_SPAN)
+ eyeArcMesh = Torus.build(0.1f, 0.03f, 10, 48, EYE_ARC_SPAN)
lookMeshes = BallLooks.ALL.map { LookMeshes(it) }
// Low subdivision on purpose: a paw is ~18 dp across on screen, where
// subdiv 2 is already smooth and subdiv 4 is 16x the triangles for
// nothing. It gets drawn eight times a frame.
- handMesh = IcoSphere.build(2)
+ handMesh = IcoSphere.build(3)
// Pupils and glints. Same unit blob as a paw part, and the same order of
// cost: four of them a frame, each about 4 dp wide on screen.
- dotMesh = IcoSphere.build(2)
+ dotMesh = IcoSphere.build(3)
bubbleSphere = IcoSphere.build(4)
starMesh = Puff.build(Puff.roundStar(5, 0.54f, 1.3f), 0.55f)
shieldMesh = Puff.build(Puff.shield(), 0.42f, rings = 5)
diff --git a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionState.kt b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionState.kt
index bee64f2..2cc99d8 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionState.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/EmotionState.kt
@@ -483,7 +483,9 @@ class EmotionState {
// purpose, so an actual tool call still lands as an event on top of it
// rather than disappearing into the bob.
val workBob = cling * sin(t * 3.4f) * 0.04f
- rotY = sin(t * 0.22f) * 0.12f + jx * 0.012f + gaze * 0.09f + actRotY
+ // The slow sway and the thinking drift together are capped: past ~0.10 rad the outer eye of a big-eyed look
+ // (Andee) rolls over the edge of the head. Actions (a shake, a look around) are not capped — they are brief.
+ rotY = (sin(t * 0.22f) * 0.12f + jx * 0.012f + gaze * 0.04f).coerceIn(-0.10f, 0.10f) + actRotY
rotX = sin(t * 0.17f) * 0.06f + jy * 0.009f + actRotX + workBob
rotZ = tilt + th * sin(t * 0.51f) * 0.09f - clingLean
@@ -593,8 +595,11 @@ class EmotionState {
val peek = cling * (LOOK.clingLift + grip * 0.02f)
eyeLY = LOOK.eyeY - browL * 0.06f + peek + lookY * 0.08f
eyeRY = LOOK.eyeY - browR * 0.06f + peek + lookY * 0.08f
- eyeLX = -LOOK.eyeX + jx * 0.014f + gaze * 0.075f + lookX * 0.06f
- eyeRX = LOOK.eyeX + jx * 0.014f + gaze * 0.075f + lookX * 0.06f
+ // The thinking drift moves the eyes across the face; 0.075 carried the larger eyes past the edge of the head
+ // (up to 0.11 on top of a 0.345 + 0.215 eye). 0.03 here and 0.04 on the head turn (rotY, was 0.09) keep the
+ // drift visible and the eyes on the ball.
+ eyeLX = -LOOK.eyeX + jx * 0.014f + gaze * 0.03f + lookX * 0.06f
+ eyeRX = LOOK.eyeX + jx * 0.014f + gaze * 0.03f + lookX * 0.06f
// Eye roll. Two terms, and they are on the same axis on purpose:
//
// * the look's own resting tilt, mirrored per side, which is what makes
diff --git a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/Pose.kt b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/Pose.kt
index 3612216..3811893 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/ui/ball/Pose.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/ui/ball/Pose.kt
@@ -133,7 +133,7 @@ val POSES: Map<Mood, Pose> = mapOf(
// think.webp — eyes up and to the side, and the gaze drift the rim and scan light
// ride on.
- Mood.THINKING to Pose(lookX = 0.5f, lookY = 0.9f, hornLean = -8f),
+ Mood.THINKING to Pose(lookX = 0.12f, lookY = 0.7f, hornLean = -8f),
// The mouth is the talk envelope's, which opens the thin smile rather than
// swapping it for another shape. No pose, so the face is clear while it is