From 5898330f4b683315dcc990944fb866c3f1844b1e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 20 Apr 2024 12:46:01 -0400 Subject: [PATCH] Getting somewhere with proc anim --- source/animation_station/init.ts | 38 +++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/source/animation_station/init.ts b/source/animation_station/init.ts index 832c8cf9..a81c0527 100644 --- a/source/animation_station/init.ts +++ b/source/animation_station/init.ts @@ -20,6 +20,9 @@ namespace animationStation { scale: Vec3, } + /** + * Animation Register defines a basic animation for a bone. + */ interface AnimationRegister { //? If I ever feel like making longer animations, I can use this. // frames: { [key: number]: AnimationPoint; } = {}; @@ -28,9 +31,42 @@ namespace animationStation { end: AnimationPoint; } - let animationRepository: = {}; + /** + * BoneTRSStartEnd is the start and end of a bone's animation point in an animation. + */ + type BoneTRSStartEnd = { [boneName: string]: AnimationRegister; }; + /** + * Animation encapsulates the Bone Animation's for a single animation in one container. + */ + type Animation = { [animationName: string]: BoneTRSStartEnd; }; + /** + * ModelRepo holds all the animations, for all registered models. + */ + type ModelRepo = { [modelName: string]: Animation; }; + + /** + * Worker Animation Point is a piece of data which is used to reduce pressure + * on the garbage collector by reusing it's memory address over and over. + */ + let workerAnimationPoint: AnimationPoint = { + translation: vector.create3d(0, 0, 0), + rotation: vector.create3d(0, 0, 0), + scale: vector.create3d(1, 1, 1) + }; + + /** + * Animation Repository holds all the animations for all bones on all models. + */ + class AnimationRepository { + models: { [modelName: string]: Animation; } = {}; + + getStart(entity: ObjectRef): { + + }; + } let playerAnimationState: { [key: string]: PlayerAnimationState; } = {}; + let animationRepository = new AnimationRepository(); /**