Implement Owen Animation System with core classes, loaders, and state handlers
- Added OwenSystemFactory for creating the animation system. - Introduced OwenAnimationContext to manage animations and states. - Created AnimationLoader and GLTFAnimationLoader for loading animations. - Developed state handlers: WaitStateHandler, ReactStateHandler, TypeStateHandler, SleepStateHandler. - Implemented StateFactory for managing state handlers. - Defined constants for clip types, states, and emotions. - Added type definitions for TypeScript support. - Configured Vite for building and serving the project. - Added licenses (dual) to project.
This commit is contained in:
78
src/constants.js
Normal file
78
src/constants.js
Normal file
@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @fileoverview Animation system constants and enumerations
|
||||
* @module constants
|
||||
*/
|
||||
|
||||
/**
|
||||
* Animation clip types based on naming convention
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
export const ClipTypes = {
|
||||
/** Loop animation */
|
||||
LOOP: 'L',
|
||||
/** Quirk animation */
|
||||
QUIRK: 'Q',
|
||||
/** Nested loop animation */
|
||||
NESTED_LOOP: 'NL',
|
||||
/** Nested quirk animation */
|
||||
NESTED_QUIRK: 'NQ',
|
||||
/** Nested in transition */
|
||||
NESTED_IN: 'IN_NT',
|
||||
/** Nested out transition */
|
||||
NESTED_OUT: 'OUT_NT',
|
||||
/** Transition animation */
|
||||
TRANSITION: 'T',
|
||||
};
|
||||
|
||||
/**
|
||||
* Character animation states
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
export const States = {
|
||||
/** Waiting/idle state */
|
||||
WAIT: 'wait',
|
||||
/** Reacting to input state */
|
||||
REACT: 'react',
|
||||
/** Typing response state */
|
||||
TYPE: 'type',
|
||||
/** Sleep/inactive state */
|
||||
SLEEP: 'sleep',
|
||||
};
|
||||
|
||||
/**
|
||||
* Character emotional states
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
export const Emotions = {
|
||||
/** Neutral emotion */
|
||||
NEUTRAL: '',
|
||||
/** Angry emotion */
|
||||
ANGRY: 'an',
|
||||
/** Shocked emotion */
|
||||
SHOCKED: 'sh',
|
||||
/** Happy emotion */
|
||||
HAPPY: 'ha',
|
||||
/** Sad emotion */
|
||||
SAD: 'sa',
|
||||
};
|
||||
|
||||
/**
|
||||
* Default configuration values
|
||||
* @readonly
|
||||
* @type {Object}
|
||||
*/
|
||||
export const Config = {
|
||||
/** Default fade in duration for animations (ms) */
|
||||
DEFAULT_FADE_IN: 0.3,
|
||||
/** Default fade out duration for animations (ms) */
|
||||
DEFAULT_FADE_OUT: 0.3,
|
||||
/** Default quirk interval (ms) */
|
||||
QUIRK_INTERVAL: 5000,
|
||||
/** Default inactivity timeout (ms) */
|
||||
INACTIVITY_TIMEOUT: 60000,
|
||||
/** Quirk probability threshold */
|
||||
QUIRK_PROBABILITY: 0.3,
|
||||
};
|
||||
Reference in New Issue
Block a user