FBXLoader.tests.js 767 B

123456789101112131415161718192021222324252627282930
  1. import { FBXLoader } from '../../../../examples/jsm/loaders/FBXLoader.js';
  2. export default QUnit.module( 'Addons', () => {
  3. QUnit.module( 'Loaders', () => {
  4. QUnit.module( 'FBXLoader', () => {
  5. QUnit.test( 'morphAttributes length match geometry position length', ( assert ) => {
  6. const fbxLoader = new FBXLoader();
  7. const done = assert.async();
  8. fbxLoader.load( '/examples/models/fbx/morph_test.fbx', ( fbx ) => {
  9. const mesh = fbx.children[ 0 ];
  10. const baseGeometryLength = mesh.geometry.attributes.position.count;
  11. const morphAttributesLength = mesh.geometry.morphAttributes.position[ 0 ].count;
  12. assert.ok( baseGeometryLength === morphAttributesLength, 'length is the same' );
  13. done();
  14. } );
  15. } );
  16. } );
  17. } );
  18. } );
粤ICP备19079148号