Face engine
The face engine is DeskBot's primary expressive system. It renders a complete face on one display and coordinates emotion, gaze, blinking, mouth animation, overlays, accessories, and body-language hints.
Components
FaceModel: immutable snapshot of the complete face.EmotionEngine: maps an emotion name to aFaceModeland body-language hint.FaceRenderer: display-independent drawing.FaceAnimator: animation loop and state transitions.FaceOrchestrator: connects face animation to application events.face.themes: six visual themes.face.animations: reusable speaking, wake, and thinking-dot animations.
Emotions
The current emotion catalogue is:
neutral, happy, curious, thinking, sleepy, embarrassed,
excited, sad, surprised, angry.
Each emotion is more than a facial label. It can specify eyes, eyelids, eyebrows, mouth, cheeks, overlays, and a high-level body-language hint.
Themes
The renderer currently supports:
- Vector
- Minimal
- Cute
- Pixel
- Retro LCD
- Wireframe
Select one with:
Face model
FaceModel contains:
- left and right eyes
- eyelids
- left and right eyebrows
- mouth
- cheeks
- overlay
- accessory
- colour palette
- bounce/squash transform
- body-language hint
The model is frozen. Animators create new snapshots rather than mutating the current one.
Animation
FaceAnimator renders at the configured display frame rate, normally 30 FPS.
The animation framework supplies easing, timelines, and scheduling.
The face also reacts to streamed LLM output. FaceOrchestrator consumes
LLMTokenReceived events and changes the face between thinking and speaking
states.
Rendering order
The renderer composes the face from background through transforms, cheeks, eyes, eyelids, irises, pupils, highlights, eyebrows, mouth, overlays, and accessories.
The renderer does not require a physical display. A mock display can capture frames during tests.
Adding an emotion
- Add the emotion name to
EmotionNameinrobot.events.events. - Add its definition to
robot.face.emotions.EMOTION_DEFS. - Define the face components and optional
BodyLanguageHint. - Add/update tests.
- Update the documentation if the public catalogue changes.