modelConfiguration.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { IModelAnimationConfiguration } from "./modelAnimationConfiguration";
  2. export interface IModelConfiguration {
  3. id?: string;
  4. url?: string;
  5. root?: string; //optional
  6. file?: string | File; // is a file being loaded? root and url ignored
  7. loader?: string; // obj, gltf?
  8. position?: { x: number, y: number, z: number };
  9. rotation?: { x: number, y: number, z: number, w?: number };
  10. scaling?: { x: number, y: number, z: number };
  11. parentObjectIndex?: number; // the index of the parent object of the model in the loaded meshes array.
  12. castShadow?: boolean;
  13. receiveShadows?: boolean;
  14. normalize?: boolean | {
  15. center?: boolean;
  16. unitSize?: boolean;
  17. parentIndex?: number;
  18. }; // should the model be scaled to unit-size
  19. title?: string;
  20. subtitle?: string;
  21. thumbnail?: string; // URL or data-url
  22. animation?: {
  23. autoStart?: boolean | string;
  24. playOnce?: boolean;
  25. autoStartIndex?: number;
  26. };
  27. entryAnimation?: IModelAnimationConfiguration;
  28. exitAnimation?: IModelAnimationConfiguration;
  29. material?: {
  30. directEnabled?: boolean;
  31. directIntensity?: number;
  32. emissiveIntensity?: number;
  33. environmentIntensity?: number;
  34. [propName: string]: any;
  35. };
  36. /**
  37. * Rotation offset axis definition
  38. */
  39. rotationOffsetAxis?: {
  40. x: number;
  41. y: number;
  42. z: number;
  43. };
  44. /**
  45. * the offset angle
  46. */
  47. rotationOffsetAngle?: number;
  48. loaderConfiguration?: {
  49. maxLODsToLoad?: number;
  50. progressiveLoading?: boolean;
  51. };
  52. // [propName: string]: any; // further configuration, like title and creator
  53. }