@hology/core 0.0.217 → 0.0.219
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/dist/effects/sequence/sequence-action.d.ts +2 -0
- package/dist/effects/sequence/sequence-data.d.ts +9 -3
- package/dist/effects/sequence/sequence-data.js +1 -1
- package/dist/effects/sequence/sequence-definitions.js +1 -1
- package/dist/effects/sequence/sequence-player.d.ts +1 -0
- package/dist/effects/sequence/sequence-player.js +1 -1
- package/dist/gameplay/actors/camera/third-person-camera-component.d.ts +4 -1
- package/dist/gameplay/actors/camera/third-person-camera-component.js +1 -1
- package/dist/rendering/outline-effect.js +1 -1
- package/dist/test/outline-effect.test.d.ts +2 -0
- package/dist/test/outline-effect.test.js +4 -0
- package/dist/test/sequence-property-parameters.test.js +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{beforeAll as e,describe as a,expect as t,it as o,vi as r}from"vitest";import{BoxGeometry as s,Color as l,Euler as n,Mesh as i,Object3D as m,ShaderMaterial as u,Vector3 as p}from"three";import{createMaterialSubTrack as c,createPropertyKeyframe as f,createPropertySubTrack as y,createSpawnTrack as v}from"../effects/sequence/sequence-data.js";import{canTrackAddSubTrack as d}from"../effects/sequence/sequence-definitions.js";import{evaluateCustomParamValueKeyframes as b}from"../effects/sequence/sequence-value-lane.js";import{SerializedParamType as g}from"../scene/model.js";import{shaderParameterUniformName as w}from"../shader/parameter.js";let B;function N(){return new B}r.mock("../gameplay/actors/builtin/index.js",()=>({builtInActors:{},default:{}})),r.mock("../gameplay/actors/index.js",()=>({CharacterAnimationComponent:class{},CharacterMovementComponent:class{}})),r.mock("../effects/vfx/vfx-actor.js",()=>({VfxActor:class{}})),r.mock("../effects/vfx/vfx-param.js",()=>({VisualEffect:class{}})),r.mock("../effects/vfx/vfx-service.js",()=>({VfxService:class{}})),r.mock("../gameplay/services/render.js",()=>({})),r.hoisted(()=>{if("undefined"==typeof HTMLCanvasElement)return;const e=new Proxy({},{get:(e,a)=>(a in e||(e[a]=r.fn()),e[a]),set:(e,a,t)=>(e[a]=t,!0)});Object.defineProperty(HTMLCanvasElement.prototype,"getContext",{configurable:!0,value:()=>e})}),e(async()=>{const e=await import("../effects/sequence/sequence-player.js");B=e.SequencePlayer},1e4),a("sequence property parameter tracks",()=>{o("allows multiple property sub-tracks on spawn tracks but rejects duplicate property paths",()=>{const e=v(),a=y({propertyPath:"settings.globalGain",propertyType:g.Vector3});t(d(e,"property",{propertyPath:"settings.globalGain"})).toBe(!0),e.subTracks.push(a),t(d(e,"property",{propertyPath:"settings.globalGain"})).toBe(!1),t(d(e,"property",{propertyPath:"settings.globalGamma"})).toBe(!0)}),o("creates material sub-tracks for uniform-backed parameters and rejects duplicates",()=>{const e=v(),a={materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:w("dissolveAmount"),uniformType:g.FloatNode,valueType:g.Number,label:"Dissolve Amount",defaultValue:{type:g.Number,value:0}},o=c(a);t(o).toMatchObject({type:"material",materialMatchMode:"asset",materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:"pu_dissolveAmount",uniformType:g.FloatNode,valueType:g.Number,label:"Dissolve Amount"}),t(d(e,"material",{material:a})).toBe(!0),e.subTracks.push(o),t(d(e,"material",{material:a})).toBe(!1),t(d(e,"material",{material:{...a,parameterName:"rimPower",uniformName:w("rimPower")}})).toBe(!0)}),o("allows name-matched material sub-tracks as an alternative to asset-specific material tracks",()=>{const e=v(),a={materialAssetId:"mat-1",parameterName:"hitGlow",uniformName:w("hitGlow"),uniformType:g.FloatNode,valueType:g.Number},o={...a,materialAssetId:null,materialMatchMode:"parameterName"},r=c(o);t(r).toMatchObject({type:"material",materialMatchMode:"parameterName",materialAssetId:null,parameterName:"hitGlow"}),t(d(e,"material",{material:o})).toBe(!0),e.subTracks.push(r),t(d(e,"material",{material:a})).toBe(!1),t(d(e,"material",{material:{...a,parameterName:"rimPower",uniformName:w("rimPower")}})).toBe(!0);const s=v();s.subTracks.push(c(a)),t(d(s,"material",{material:{...a,materialAssetId:"mat-2"}})).toBe(!0),t(d(s,"material",{material:o})).toBe(!1)}),o("interpolates number, vector, color, and Euler property keyframes",()=>{const e=b([f(0,{type:g.Number,value:0}),f(1,{type:g.Number,value:10})],.5);t(e?.value).toBeCloseTo(5);const a=b([f(0,{type:g.Vector3,value:[0,0,0]}),f(1,{type:g.Vector3,value:[2,4,6]})],.5,{min:0,max:3});t(a?.value).toEqual([1,2,3]);const o=b([f(0,{type:g.Color,value:"#000000"}),f(1,{type:g.Color,value:"#ffffff"})],.5);t(o?.value).toBe(`#${new l("#000000").lerp(new l("#ffffff"),.5).getHexString()}`);const r=b([f(0,{type:g.Euler,value:[0,0,0,"XYZ"]}),f(1,{type:g.Euler,value:[1,2,3,"XYZ"]})],.5);t(r?.value).toEqual([.5,1,1.5,"XYZ"])}),o("uses step evaluation for booleans and options-backed values",()=>{const e=b([f(0,{type:g.Boolean,value:!1}),f(1,{type:g.Boolean,value:!0})],.5,{stepOnly:!0});t(e?.value).toBe(!1);const a=b([f(0,{type:g.Number,value:1}),f(1,{type:g.Number,value:2})],.5,{stepOnly:!0});t(a?.value).toBe(1)}),o("applies nested property paths and restores an original undefined value",async()=>{const e={settings:{globalGain:void 0}},a=y({propertyPath:"settings.globalGain",propertyType:g.Vector3}),o=await N();o.applyResolvedPropertyValue(a,e,{type:g.Vector3,value:[1,2,3]}),t(e.settings.globalGain).toBeInstanceOf(p),t(e.settings.globalGain?.toArray()).toEqual([1,2,3]),o.stop(),t(Object.prototype.hasOwnProperty.call(e.settings,"globalGain")).toBe(!0),t(e.settings.globalGain).toBeUndefined()}),o("mutates existing mutable values and restores their original value",async()=>{const e=new p(9,8,7),a=new l("#112233"),o=new n(.1,.2,.3,"XYZ"),r={settings:{globalGain:e,colorTint:a,rotation:o}},s=await N();s.applyResolvedPropertyValue(y({propertyPath:"settings.globalGain",propertyType:g.Vector3}),r,{type:g.Vector3,value:[1,2,3]}),s.applyResolvedPropertyValue(y({propertyPath:"settings.colorTint",propertyType:g.Color}),r,{type:g.Color,value:"#ffffff"}),s.applyResolvedPropertyValue(y({propertyPath:"settings.rotation",propertyType:g.Euler}),r,{type:g.Euler,value:[1,2,3,"XYZ"]}),t(r.settings.globalGain).toBe(e),t(r.settings.globalGain.toArray()).toEqual([1,2,3]),t(r.settings.colorTint).toBe(a),t(r.settings.colorTint.getHexString()).toBe("ffffff"),t(r.settings.rotation).toBe(o),t(r.settings.rotation.toArray()).toEqual([1,2,3,"XYZ"]),s.stop(),t(r.settings.globalGain).toBe(e),t(r.settings.globalGain.toArray()).toEqual([9,8,7]),t(r.settings.colorTint).toBe(a),t(r.settings.colorTint.getHexString()).toBe("112233"),t(r.settings.rotation).toBe(o),t(r.settings.rotation.toArray()).toEqual([.1,.2,.3,"XYZ"])}),o("clones matched materials before animating uniforms and restores originals",async()=>{const e=w("dissolveAmount"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new i(new s,a),r=c({materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:e,uniformType:g.FloatNode,valueType:g.Number});r.keyframes=[f(0,{type:g.Number,value:0}),f(1,{type:g.Number,value:1})];const l=await N();l.evaluateParameterSubTrack(r,o,.5),t(o.material).not.toBe(a),t(a.uniforms[e].value).toBe(0),t(o.material.uniforms[e].value).toBeCloseTo(.5),l.stop(),t(o.material).toBe(a)}),o("can match material tracks by parameter name across different material assets",async()=>{const e=w("hitGlow"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new u({uniforms:{[e]:{value:0}}});o.userData.assetId="mat-2";const r=new u({uniforms:{[w("otherGlow")]:{value:0}}});r.userData.assetId="mat-3";const l=new i(new s,a),n=new i(new s,o),p=new i(new s,r),f=new m;f.add(l,n,p);const y=c({materialMatchMode:"parameterName",parameterName:"hitGlow",uniformName:e,uniformType:g.FloatNode,valueType:g.Number}),v=await N();v.applyResolvedMaterialValue(y,f,{type:g.Number,value:.75}),t(l.material).not.toBe(a),t(n.material).not.toBe(o),t(p.material).toBe(r),t(a.uniforms[e].value).toBe(0),t(o.uniforms[e].value).toBe(0),t(l.material.uniforms[e].value).toBeCloseTo(.75),t(n.material.uniforms[e].value).toBeCloseTo(.75),v.stop(),t(l.material).toBe(a),t(n.material).toBe(o)}),o("interpolates string-backed number material keyframes before applying uniforms",async()=>{const e=w("dissolveAmount"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new i(new s,a),r=c({materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:e,uniformType:g.FloatNode,valueType:g.Number});r.keyframes=[f(0,{type:g.Number,value:"0"}),f(1,{type:g.Number,value:"1"})];(await N()).evaluateParameterSubTrack(r,o,.5),t(o.material.uniforms[e].value).toBeCloseTo(.5)}),o("applies color material keyframes to vec3 uniform storage",async()=>{const e=w("rimColor"),a=new u({uniforms:{[e]:{value:new p(0,0,0)}}});a.userData.assetId="mat-1";const o=new i(new s,a),r=c({materialAssetId:"mat-1",parameterName:"rimColor",uniformName:e,uniformType:g.RgbNode,valueType:g.Color});(await N()).applyResolvedMaterialValue(r,o,{type:g.Color,value:"#336699"});const n=o.material.uniforms[e].value,m=new l("#336699");t(n.x).toBeCloseTo(m.r),t(n.y).toBeCloseTo(m.g),t(n.z).toBeCloseTo(m.b)}),o("step-evaluates boolean material keyframes",async()=>{const e=w("enabled"),a=new u({uniforms:{[e]:{value:!1}}});a.userData.assetId="mat-1";const o=new i(new s,a),r=c({materialAssetId:"mat-1",parameterName:"enabled",uniformName:e,uniformType:g.BooleanNode,valueType:g.Boolean});r.keyframes=[f(0,{type:g.Boolean,value:!1}),f(1,{type:g.Boolean,value:!0})];(await N()).evaluateParameterSubTrack(r,o,.5),t(o.material.uniforms[e].value).toBe(!1)})});/*
|
|
1
|
+
import{beforeAll as e,describe as a,expect as t,it as o,vi as r}from"vitest";import{BoxGeometry as s,Color as l,Euler as i,Mesh as n,Object3D as m,ShaderMaterial as u,Vector3 as p}from"three";import{createMaterialSubTrack as c,createPropertyKeyframe as y,createPropertySubTrack as f,createSpawnTrack as v,materialOutlineVisibilityParameterName as d}from"../effects/sequence/sequence-data.js";import{canTrackAddSubTrack as b}from"../effects/sequence/sequence-definitions.js";import{evaluateCustomParamValueKeyframes as B}from"../effects/sequence/sequence-value-lane.js";import{SerializedParamType as g}from"../scene/model.js";import{shaderParameterUniformName as w}from"../shader/parameter.js";let N;function T(){return new N}r.mock("../gameplay/actors/builtin/index.js",()=>({builtInActors:{},default:{}})),r.mock("../gameplay/actors/index.js",()=>({CharacterAnimationComponent:class{},CharacterMovementComponent:class{}})),r.mock("../effects/vfx/vfx-actor.js",()=>({VfxActor:class{}})),r.mock("../effects/vfx/vfx-param.js",()=>({VisualEffect:class{}})),r.mock("../effects/vfx/vfx-service.js",()=>({VfxService:class{}})),r.mock("../gameplay/services/render.js",()=>({})),r.hoisted(()=>{if("undefined"==typeof HTMLCanvasElement)return;const e=new Proxy({},{get:(e,a)=>(a in e||(e[a]=r.fn()),e[a]),set:(e,a,t)=>(e[a]=t,!0)});Object.defineProperty(HTMLCanvasElement.prototype,"getContext",{configurable:!0,value:()=>e})}),e(async()=>{const e=await import("../effects/sequence/sequence-player.js");N=e.SequencePlayer},1e4),a("sequence property parameter tracks",()=>{o("allows multiple property sub-tracks on spawn tracks but rejects duplicate property paths",()=>{const e=v(),a=f({propertyPath:"settings.globalGain",propertyType:g.Vector3});t(b(e,"property",{propertyPath:"settings.globalGain"})).toBe(!0),e.subTracks.push(a),t(b(e,"property",{propertyPath:"settings.globalGain"})).toBe(!1),t(b(e,"property",{propertyPath:"settings.globalGamma"})).toBe(!0)}),o("creates material sub-tracks for uniform-backed parameters and rejects duplicates",()=>{const e=v(),a={materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:w("dissolveAmount"),uniformType:g.FloatNode,valueType:g.Number,label:"Dissolve Amount",defaultValue:{type:g.Number,value:0}},o=c(a);t(o).toMatchObject({type:"material",target:"shaderUniform",materialMatchMode:"asset",materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:"pu_dissolveAmount",uniformType:g.FloatNode,valueType:g.Number,label:"Dissolve Amount"}),t(b(e,"material",{material:a})).toBe(!0),e.subTracks.push(o),t(b(e,"material",{material:a})).toBe(!1),t(b(e,"material",{material:{...a,parameterName:"rimPower",uniformName:w("rimPower")}})).toBe(!0)}),o("creates material sub-tracks for outline visibility and rejects duplicate outline controls",()=>{const e=v(),a={target:"outlineVisibility",materialAssetId:"mat-1",parameterName:d,uniformName:d,uniformType:g.Boolean,valueType:g.Boolean,label:"Outline Visibility",defaultValue:{type:g.Boolean,value:!0}},o=c(a);t(o).toMatchObject({type:"material",target:"outlineVisibility",materialMatchMode:"asset",materialAssetId:"mat-1",parameterName:d,uniformName:d,uniformType:g.Boolean,valueType:g.Boolean,label:"Outline Visibility"}),t(b(e,"material",{material:a})).toBe(!0),e.subTracks.push(o),t(b(e,"material",{material:a})).toBe(!1),t(b(e,"material",{material:{...a,materialAssetId:"mat-2"}})).toBe(!0),t(b(e,"material",{material:{...a,materialMatchMode:"parameterName",materialAssetId:null}})).toBe(!1)}),o("allows name-matched material sub-tracks as an alternative to asset-specific material tracks",()=>{const e=v(),a={materialAssetId:"mat-1",parameterName:"hitGlow",uniformName:w("hitGlow"),uniformType:g.FloatNode,valueType:g.Number},o={...a,materialAssetId:null,materialMatchMode:"parameterName"},r=c(o);t(r).toMatchObject({type:"material",materialMatchMode:"parameterName",materialAssetId:null,parameterName:"hitGlow"}),t(b(e,"material",{material:o})).toBe(!0),e.subTracks.push(r),t(b(e,"material",{material:a})).toBe(!1),t(b(e,"material",{material:{...a,parameterName:"rimPower",uniformName:w("rimPower")}})).toBe(!0);const s=v();s.subTracks.push(c(a)),t(b(s,"material",{material:{...a,materialAssetId:"mat-2"}})).toBe(!0),t(b(s,"material",{material:o})).toBe(!1)}),o("interpolates number, vector, color, and Euler property keyframes",()=>{const e=B([y(0,{type:g.Number,value:0}),y(1,{type:g.Number,value:10})],.5);t(e?.value).toBeCloseTo(5);const a=B([y(0,{type:g.Vector3,value:[0,0,0]}),y(1,{type:g.Vector3,value:[2,4,6]})],.5,{min:0,max:3});t(a?.value).toEqual([1,2,3]);const o=B([y(0,{type:g.Color,value:"#000000"}),y(1,{type:g.Color,value:"#ffffff"})],.5);t(o?.value).toBe(`#${new l("#000000").lerp(new l("#ffffff"),.5).getHexString()}`);const r=B([y(0,{type:g.Euler,value:[0,0,0,"XYZ"]}),y(1,{type:g.Euler,value:[1,2,3,"XYZ"]})],.5);t(r?.value).toEqual([.5,1,1.5,"XYZ"])}),o("uses step evaluation for booleans and options-backed values",()=>{const e=B([y(0,{type:g.Boolean,value:!1}),y(1,{type:g.Boolean,value:!0})],.5,{stepOnly:!0});t(e?.value).toBe(!1);const a=B([y(0,{type:g.Number,value:1}),y(1,{type:g.Number,value:2})],.5,{stepOnly:!0});t(a?.value).toBe(1)}),o("applies nested property paths and restores an original undefined value",async()=>{const e={settings:{globalGain:void 0}},a=f({propertyPath:"settings.globalGain",propertyType:g.Vector3}),o=await T();o.applyResolvedPropertyValue(a,e,{type:g.Vector3,value:[1,2,3]}),t(e.settings.globalGain).toBeInstanceOf(p),t(e.settings.globalGain?.toArray()).toEqual([1,2,3]),o.stop(),t(Object.prototype.hasOwnProperty.call(e.settings,"globalGain")).toBe(!0),t(e.settings.globalGain).toBeUndefined()}),o("mutates existing mutable values and restores their original value",async()=>{const e=new p(9,8,7),a=new l("#112233"),o=new i(.1,.2,.3,"XYZ"),r={settings:{globalGain:e,colorTint:a,rotation:o}},s=await T();s.applyResolvedPropertyValue(f({propertyPath:"settings.globalGain",propertyType:g.Vector3}),r,{type:g.Vector3,value:[1,2,3]}),s.applyResolvedPropertyValue(f({propertyPath:"settings.colorTint",propertyType:g.Color}),r,{type:g.Color,value:"#ffffff"}),s.applyResolvedPropertyValue(f({propertyPath:"settings.rotation",propertyType:g.Euler}),r,{type:g.Euler,value:[1,2,3,"XYZ"]}),t(r.settings.globalGain).toBe(e),t(r.settings.globalGain.toArray()).toEqual([1,2,3]),t(r.settings.colorTint).toBe(a),t(r.settings.colorTint.getHexString()).toBe("ffffff"),t(r.settings.rotation).toBe(o),t(r.settings.rotation.toArray()).toEqual([1,2,3,"XYZ"]),s.stop(),t(r.settings.globalGain).toBe(e),t(r.settings.globalGain.toArray()).toEqual([9,8,7]),t(r.settings.colorTint).toBe(a),t(r.settings.colorTint.getHexString()).toBe("112233"),t(r.settings.rotation).toBe(o),t(r.settings.rotation.toArray()).toEqual([.1,.2,.3,"XYZ"])}),o("clones matched materials before animating uniforms and restores originals",async()=>{const e=w("dissolveAmount"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new n(new s,a),r=c({materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:e,uniformType:g.FloatNode,valueType:g.Number});r.keyframes=[y(0,{type:g.Number,value:0}),y(1,{type:g.Number,value:1})];const l=await T();l.evaluateParameterSubTrack(r,o,.5),t(o.material).not.toBe(a),t(a.uniforms[e].value).toBe(0),t(o.material.uniforms[e].value).toBeCloseTo(.5),l.stop(),t(o.material).toBe(a)}),o("clones outline materials before toggling outline visibility and restores originals",async()=>{const e=new u;e.userData.assetId="mat-1",e.userData.outlineParameters={thickness:.01,color:[0,0,0]};const a=new n(new s,e),o=c({target:"outlineVisibility",materialAssetId:"mat-1",parameterName:d,uniformName:d,uniformType:g.Boolean,valueType:g.Boolean}),r=await T();r.applyResolvedMaterialValue(o,a,{type:g.Boolean,value:!1}),t(a.material).not.toBe(e),t(e.userData.outlineParameters.visible).toBeUndefined(),t(a.material.userData.outlineParameters).not.toBe(e.userData.outlineParameters),t(a.material.userData.outlineParameters).toMatchObject({thickness:.01,visible:!1}),r.stop(),t(a.material).toBe(e),t(e.userData.outlineParameters.visible).toBeUndefined()}),o("can match outline visibility tracks by parameter name across outlined materials",async()=>{const e=new u;e.userData.assetId="mat-1",e.userData.outlineParameters={};const a=new u;a.userData.assetId="mat-2",a.userData.outlineParameters={};const o=new u;o.userData.assetId="mat-3";const r=new n(new s,e),l=new n(new s,a),i=new n(new s,o),p=new m;p.add(r,l,i);const y=c({target:"outlineVisibility",materialMatchMode:"parameterName",materialAssetId:null,parameterName:d,uniformName:d,uniformType:g.Boolean,valueType:g.Boolean}),f=await T();f.applyResolvedMaterialValue(y,p,{type:g.Boolean,value:!1}),t(r.material).not.toBe(e),t(l.material).not.toBe(a),t(i.material).toBe(o),t(r.material.userData.outlineParameters.visible).toBe(!1),t(l.material.userData.outlineParameters.visible).toBe(!1),f.stop(),t(r.material).toBe(e),t(l.material).toBe(a)}),o("can match material tracks by parameter name across different material assets",async()=>{const e=w("hitGlow"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new u({uniforms:{[e]:{value:0}}});o.userData.assetId="mat-2";const r=new u({uniforms:{[w("otherGlow")]:{value:0}}});r.userData.assetId="mat-3";const l=new n(new s,a),i=new n(new s,o),p=new n(new s,r),y=new m;y.add(l,i,p);const f=c({materialMatchMode:"parameterName",parameterName:"hitGlow",uniformName:e,uniformType:g.FloatNode,valueType:g.Number}),v=await T();v.applyResolvedMaterialValue(f,y,{type:g.Number,value:.75}),t(l.material).not.toBe(a),t(i.material).not.toBe(o),t(p.material).toBe(r),t(a.uniforms[e].value).toBe(0),t(o.uniforms[e].value).toBe(0),t(l.material.uniforms[e].value).toBeCloseTo(.75),t(i.material.uniforms[e].value).toBeCloseTo(.75),v.stop(),t(l.material).toBe(a),t(i.material).toBe(o)}),o("interpolates string-backed number material keyframes before applying uniforms",async()=>{const e=w("dissolveAmount"),a=new u({uniforms:{[e]:{value:0}}});a.userData.assetId="mat-1";const o=new n(new s,a),r=c({materialAssetId:"mat-1",parameterName:"dissolveAmount",uniformName:e,uniformType:g.FloatNode,valueType:g.Number});r.keyframes=[y(0,{type:g.Number,value:"0"}),y(1,{type:g.Number,value:"1"})];(await T()).evaluateParameterSubTrack(r,o,.5),t(o.material.uniforms[e].value).toBeCloseTo(.5)}),o("applies color material keyframes to vec3 uniform storage",async()=>{const e=w("rimColor"),a=new u({uniforms:{[e]:{value:new p(0,0,0)}}});a.userData.assetId="mat-1";const o=new n(new s,a),r=c({materialAssetId:"mat-1",parameterName:"rimColor",uniformName:e,uniformType:g.RgbNode,valueType:g.Color});(await T()).applyResolvedMaterialValue(r,o,{type:g.Color,value:"#336699"});const i=o.material.uniforms[e].value,m=new l("#336699");t(i.x).toBeCloseTo(m.r),t(i.y).toBeCloseTo(m.g),t(i.z).toBeCloseTo(m.b)}),o("step-evaluates boolean material keyframes",async()=>{const e=w("enabled"),a=new u({uniforms:{[e]:{value:!1}}});a.userData.assetId="mat-1";const o=new n(new s,a),r=c({materialAssetId:"mat-1",parameterName:"enabled",uniformName:e,uniformType:g.BooleanNode,valueType:g.Boolean});r.keyframes=[y(0,{type:g.Boolean,value:!1}),y(1,{type:g.Boolean,value:!0})];(await T()).evaluateParameterSubTrack(r,o,.5),t(o.material.uniforms[e].value).toBe(!1)})});/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|