@bitefoundry/retrieviewer 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALLING.md +25 -0
- package/MOTION-TABLES.md +63 -0
- package/RELEASING.md +45 -1
- package/integrations/windows-overlay/Overlay.cs +14 -4
- package/integrations/windows-overlay/desktop.mjs +9 -3
- package/integrations/windows-overlay/worker.mjs +18 -10
- package/package.json +8 -3
- package/puppy-companion-interactions-v3.json +1 -1
- package/puppy-motion-lookup.mjs +20 -0
- package/puppy-motion-tables.generated.mjs +4 -0
- package/puppy-paper-actions-v9.json +1 -1
- package/puppy-paper-actions.mjs +5 -4
- package/puppy-paper-approach.json +1 -1
- package/puppy-paper-arrival-seat.json +1 -1
- package/puppy-paper-behaviors.json +1 -1
- package/puppy-paper-contact.mjs +10 -0
- package/puppy-paper-rear-gallop.json +1 -1
- package/puppy-paper-seat.json +14 -14
- package/puppy-paper.mjs +30 -16
- package/puppy-stable-meta.json +1606 -1606
- package/puppy-stride-meta.json +343 -343
- package/retrieviewer-config.mjs +14 -3
- package/retrieviewer-plugin.d.mts +1 -1
- package/retrieviewer-plugin.mjs +1 -1
- package/retrieviewer.mjs +6 -2
|
@@ -21,7 +21,7 @@ export interface PetPluginScheduler {
|
|
|
21
21
|
export interface PetPluginOptions {
|
|
22
22
|
host: PetPluginHost;
|
|
23
23
|
petOptions?: PetOptions;
|
|
24
|
-
/** Scheduled frame rate, default 30. */
|
|
24
|
+
/** Scheduled frame rate, default 30; 1000/2147483647 through 120 inclusive. */
|
|
25
25
|
fps?: number;
|
|
26
26
|
/** Default: performance.now() with setTimeout/clearTimeout, used only after start(). */
|
|
27
27
|
scheduler?: PetPluginScheduler;
|
package/retrieviewer-plugin.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export async function createPetPlugin({host,petOptions,fps=30,scheduler}={}){
|
|
|
11
11
|
fn(host.getSize,'host.getSize');fn(host.render,'host.render');
|
|
12
12
|
if(host.clear!==undefined)fn(host.clear,'host.clear');
|
|
13
13
|
if(host.onError!==undefined)fn(host.onError,'host.onError');
|
|
14
|
-
if(typeof fps!=='number'||!Number.isFinite(fps)||fps<=0||fps>120)throw RangeError('fps must be within
|
|
14
|
+
if(typeof fps!=='number'||!Number.isFinite(fps)||fps<=0||fps>120||1000/fps>2147483647)throw RangeError('fps must be within [1000/2147483647, 120] (bounded timer delay)');
|
|
15
15
|
if(scheduler!==undefined){
|
|
16
16
|
if(!scheduler||typeof scheduler!=='object')throw TypeError('scheduler must be an object');
|
|
17
17
|
fn(scheduler.now,'scheduler.now');fn(scheduler.schedule,'scheduler.schedule');fn(scheduler.cancel,'scheduler.cancel');
|
package/retrieviewer.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {createSnappyTrickTimings} from './puppy-paper-trick-timing.mjs';
|
|
|
5
5
|
import {createCompanionLife,FETCH_RETURN_STYLES} from './puppy-companion-life.mjs';
|
|
6
6
|
import {paintCompanionObjects} from './puppy-companion-objects.mjs';
|
|
7
7
|
import {readPackedFrames} from './puppy-frame-store.mjs';
|
|
8
|
+
import {BAKED_MOTION} from './puppy-motion-tables.generated.mjs';
|
|
8
9
|
|
|
9
10
|
// Embeddable autonomous puppy. Importing or creating has no DOM, timer, stdin/stdout
|
|
10
11
|
// or listener side effects: the host owns the loop and calls step() then frame().
|
|
@@ -121,11 +122,14 @@ export async function createPet({loadAsset=defaultLoadAsset,seed,energy,pawTrans
|
|
|
121
122
|
let lease=await acquireAssets(loadAsset,artProfile),data=lease.data;
|
|
122
123
|
const release=lease.release;lease=null;
|
|
123
124
|
let {cache,info,meta}=data;const assets={...data.assets};data=null;
|
|
125
|
+
// Baked tables describe the bundled Q5 source only. External/optional artwork
|
|
126
|
+
// keeps the general metadata-driven path instead of using an unrelated bake.
|
|
127
|
+
const motionTables=loadAsset===defaultLoadAsset&&artProfile==='q5'?BAKED_MOTION:null;
|
|
124
128
|
let animal,actor,life;
|
|
125
129
|
try{
|
|
126
130
|
if(!assets.actions.info.clips?.['lie-down']||!assets.actions.info.clips?.['lie-up'])throw Error('v9 action cache lacks lie-down/lie-up clips');
|
|
127
131
|
animal=createPaperBody();
|
|
128
|
-
actor=createPaperActor(animal,info,{manualTricks:true,trickTimings:createSnappyTrickTimings(assets.actions.info),comfortTimings:createPaperComfortTimings(assets.actions.info),walkTransitions:true,scrambleSeconds:assets.comfort.info.scramble?.duration??0,fetchMotions:assets.comfort.info.version>=4?assets.comfort.info:null});
|
|
132
|
+
actor=createPaperActor(animal,info,{manualTricks:true,trickTimings:createSnappyTrickTimings(assets.actions.info),comfortTimings:createPaperComfortTimings(assets.actions.info),walkTransitions:true,scrambleSeconds:assets.comfort.info.scramble?.duration??0,fetchMotions:assets.comfort.info.version>=4?assets.comfort.info:null,motionTables});
|
|
129
133
|
life=createCompanionLife(actor,{seed,returnStyle,...energy===undefined?{}:{energy}});
|
|
130
134
|
}catch(e){animal?.dispose?.();release();throw e;}
|
|
131
135
|
let paint=null,paintKey='',time=0,acc=0,disposed=false,lastHeldFrameKey=null;
|
|
@@ -150,7 +154,7 @@ export async function createPet({loadAsset=defaultLoadAsset,seed,energy,pawTrans
|
|
|
150
154
|
if(typeof cellAspect!=='number'||!Number.isFinite(cellAspect)||cellAspect<=0)throw RangeError('cellAspect must be a positive number');
|
|
151
155
|
if(![12,24,30].includes(poseFps))throw RangeError('poseFps must be 12, 24 or 30');
|
|
152
156
|
const width=columns*2,height=rows*4,key=`${width}x${height}`;
|
|
153
|
-
if(paintKey!==key){paint=createPaperRenderer(cache,info,meta,width,height,{...assets,pawTransport});paintKey=key;}
|
|
157
|
+
if(paintKey!==key){paint=createPaperRenderer(cache,info,meta,width,height,{...assets,pawTransport,motionTables});paintKey=key;}
|
|
154
158
|
const viewportWidth=camera?.viewportWidth??columns*cellAspect,viewportHeight=camera?.viewportHeight??rows;
|
|
155
159
|
const projection=createPaperProjection({viewportWidth,viewportHeight,rect:camera?.rect??{left:0,top:0,width:viewportWidth,height:viewportHeight},width,height});
|
|
156
160
|
const state=actor.sample(time,{poseFps}),report=life.report;
|