UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 1.26 kB
import{F as t,aq as n,ar as o}from"./index-DFZFpUG-.esm.min.js";function s(t){return!(!t._cpuPositions||!t.morphTargets&&!t.skeleton)}function e(s){const e=s._cpuPositions;if(!e)return null;const r=new t(e);return function(t,n){const s=t.morphTargets;if(!s)return;const e=n.length/3;for(let t=0;t<e;t++){const e=3*t;o(s,n,e,e)}}(s,r),function(o,s){const e=o.skeleton;if(!e)return;const r=new t(s),i=s.length/3;for(let t=0;t<i;t++){const o=3*t;n(e.boneMatrices,e.joints,e.weights,e.joints1,e.weights1,t,r[o],r[o+1],r[o+2],1,s,o)}}(s,r),r}function r(o){const s=o._cpuNormals;if(!s)return null;const e=new t(s);return function(t,n){const o=t.morphTargets;if(!o)return;const s=n.length/3,e=Math.min(o.count,o.targets.length);for(let t=0;t<e;t++){const e=o.weights[t]??0,r=o.targets[t].normals;if(0!==e&&r)for(let t=0;t<s;t++){const o=3*t;n[o]=n[o]+r[o]*e,n[o+1]=n[o+1]+r[o+1]*e,n[o+2]=n[o+2]+r[o+2]*e}}}(o,e),function(o,s){const e=o.skeleton;if(!e)return;const r=new t(s),i=s.length/3;for(let t=0;t<i;t++){const o=3*t;n(e.boneMatrices,e.joints,e.weights,e.joints1,e.weights1,t,r[o],r[o+1],r[o+2],0,s,o)}}(o,e),e}export{r as computeDeformedNormals,e as computeDeformedPositions,s as hasCpuDeformation}; //# sourceMappingURL=deformed-geometry-DbsIywh0.esm.min.js.map