import{F as M}from"./KHR_interactivity-BRnQ0PPJ.js";import{e as u,f as g,h as w,c as T,g as e,b as k}from"./declarationMapper-YJJdbZ_c.js";import{M as d,V as n,ao as x,R as r}from"./index-T8LZyOXI.js";import{F as V}from"./flowGraphUnaryOperationBlock-DJO8_uax.js";import{F as D}from"./flowGraphBinaryOperationBlock-ChE5HYy3.js";import"./index-BkylzejB.js";import"./objectModelMapping-D1pI71RW.js";import"./flowGraphCachedOperationBlock-BfX4DVbZ.js";class b extends V{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),i=>i.transpose?i.transpose():d.Transpose(i),"FlowGraphTransposeBlock",t)}}r("FlowGraphTransposeBlock",b);class E extends V{constructor(t){super(e(t?.matrixType||"Matrix"),k,i=>i.determinant(),"FlowGraphDeterminantBlock",t)}}r("FlowGraphDeterminantBlock",E);class _ extends V{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),i=>i.inverse?i.inverse():d.Invert(i),"FlowGraphInvertMatrixBlock",t)}}r("FlowGraphInvertMatrixBlock",_);class v extends D{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),(i,a)=>a.multiply(i),"FlowGraphMatrixMultiplicationBlock",t)}}r("FlowGraphMatrixMultiplicationBlock",v);class R extends M{constructor(t){super(t),this.input=this.registerDataInput("input",w),this.position=this.registerDataOutput("position",u),this.rotationQuaternion=this.registerDataOutput("rotationQuaternion",g),this.scaling=this.registerDataOutput("scaling",u),this.isValid=this.registerDataOutput("isValid",T,!1)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedPosition",null),s=t._getExecutionVariable(this,"cachedRotation",null),p=t._getExecutionVariable(this,"cachedScaling",null);if(i===t.executionId&&a&&s&&p)this.position.setValue(a,t),this.rotationQuaternion.setValue(s,t),this.scaling.setValue(p,t);else{const l=this.input.getValue(t),h=a||new n,c=s||new x,m=p||new n,F=Math.round(l.m[3]*1e4)/1e4,G=Math.round(l.m[7]*1e4)/1e4,y=Math.round(l.m[11]*1e4)/1e4,B=Math.round(l.m[15]*1e4)/1e4;if(F!==0||G!==0||y!==0||B!==1){this.isValid.setValue(!1,t),this.position.setValue(n.Zero(),t),this.rotationQuaternion.setValue(x.Identity(),t),this.scaling.setValue(n.One(),t);return}const I=l.decompose(m,c,h);this.isValid.setValue(I,t),this.position.setValue(h,t),this.rotationQuaternion.setValue(c,t),this.scaling.setValue(m,t),t._setExecutionVariable(this,"cachedPosition",h),t._setExecutionVariable(this,"cachedRotation",c),t._setExecutionVariable(this,"cachedScaling",m),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixDecompose"}}r("FlowGraphMatrixDecompose",R);class O extends M{constructor(t){super(t),this.position=this.registerDataInput("position",u),this.rotationQuaternion=this.registerDataInput("rotationQuaternion",g),this.scaling=this.registerDataInput("scaling",u),this.value=this.registerDataOutput("value",w)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedMatrix",null);if(i===t.executionId&&a)this.value.setValue(a,t);else{const s=d.Compose(this.scaling.getValue(t),this.rotationQuaternion.getValue(t),this.position.getValue(t));this.value.setValue(s,t),t._setExecutionVariable(this,"cachedMatrix",s),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixCompose"}}r("FlowGraphMatrixCompose",O);export{E as FlowGraphDeterminantBlock,_ as FlowGraphInvertMatrixBlock,O as FlowGraphMatrixComposeBlock,R as FlowGraphMatrixDecomposeBlock,v as FlowGraphMatrixMultiplicationBlock,b as FlowGraphTransposeBlock};
