BoxHelper.tests.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * @author TristanVALCKE / https://github.com/Itee
  3. * @author Anonymous
  4. */
  5. /* global QUnit */
  6. import { runStdGeometryTests } from '../../utils/qunit-utils';
  7. import { BoxHelper } from '../../../../src/helpers/BoxHelper';
  8. import { BoxGeometry } from '../../../../src/geometries/BoxGeometry';
  9. import { SphereGeometry } from '../../../../src/geometries/SphereGeometry';
  10. import { Mesh } from '../../../../src/objects/Mesh';
  11. export default QUnit.module( 'Helpers', () => {
  12. QUnit.module( 'BoxHelper', ( hooks ) => {
  13. var geometries = undefined;
  14. hooks.beforeEach( function () {
  15. const parameters = {
  16. radius: 10,
  17. widthSegments: 20,
  18. heightSegments: 30,
  19. phiStart: 0.5,
  20. phiLength: 1.0,
  21. thetaStart: 0.4,
  22. thetaLength: 2.0,
  23. };
  24. // Test with a normal cube and a box helper
  25. var boxGeometry = new BoxGeometry( parameters.diameter );
  26. var box = new Mesh( boxGeometry );
  27. var boxHelper = new BoxHelper( box );
  28. // The same should happen with a comparable sphere
  29. var sphereGeometry = new SphereGeometry( parameters.diameter / 2 );
  30. var sphere = new Mesh( sphereGeometry );
  31. var sphereBoxHelper = new BoxHelper( sphere );
  32. // Note that unlike what I'd like to, these doesn't check the equivalency of the two generated geometries
  33. geometries = [ boxHelper.geometry, sphereBoxHelper.geometry ];
  34. } );
  35. // INHERITANCE
  36. QUnit.todo( "Extending", ( assert ) => {
  37. assert.ok( false, "everything's gonna be alright" );
  38. } );
  39. // INSTANCING
  40. QUnit.todo( "Instancing", ( assert ) => {
  41. assert.ok( false, "everything's gonna be alright" );
  42. } );
  43. // PUBLIC STUFF
  44. QUnit.todo( "update", ( assert ) => {
  45. assert.ok( false, "everything's gonna be alright" );
  46. } );
  47. QUnit.todo( "setFromObject", ( assert ) => {
  48. assert.ok( false, "everything's gonna be alright" );
  49. } );
  50. // OTHERS
  51. QUnit.test( 'Standard geometry tests', ( assert ) => {
  52. runStdGeometryTests( assert, geometries );
  53. } );
  54. } );
  55. } );
粤ICP备19079148号