Source: Core/GeometryAttributes.js

  1. /*global define*/
  2. define([
  3. './defaultValue'
  4. ], function(
  5. defaultValue) {
  6. 'use strict';
  7. /**
  8. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  9. * {@link GeometryAttribute} containing the attribute's data.
  10. * <p>
  11. * Attributes are always stored non-interleaved in a Geometry.
  12. * </p>
  13. *
  14. * @alias GeometryAttributes
  15. * @constructor
  16. */
  17. function GeometryAttributes(options) {
  18. options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  19. /**
  20. * The 3D position attribute.
  21. * <p>
  22. * 64-bit floating-point (for precision). 3 components per attribute.
  23. * </p>
  24. *
  25. * @type GeometryAttribute
  26. *
  27. * @default undefined
  28. */
  29. this.position = options.position;
  30. /**
  31. * The normal attribute (normalized), which is commonly used for lighting.
  32. * <p>
  33. * 32-bit floating-point. 3 components per attribute.
  34. * </p>
  35. *
  36. * @type GeometryAttribute
  37. *
  38. * @default undefined
  39. */
  40. this.normal = options.normal;
  41. /**
  42. * The 2D texture coordinate attribute.
  43. * <p>
  44. * 32-bit floating-point. 2 components per attribute
  45. * </p>
  46. *
  47. * @type GeometryAttribute
  48. *
  49. * @default undefined
  50. */
  51. this.st = options.st;
  52. /**
  53. * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping.
  54. * <p>
  55. * 32-bit floating-point. 3 components per attribute.
  56. * </p>
  57. *
  58. * @type GeometryAttribute
  59. *
  60. * @default undefined
  61. */
  62. this.binormal = options.binormal;
  63. /**
  64. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  65. * <p>
  66. * 32-bit floating-point. 3 components per attribute.
  67. * </p>
  68. *
  69. * @type GeometryAttribute
  70. *
  71. * @default undefined
  72. */
  73. this.tangent = options.tangent;
  74. /**
  75. * The color attribute.
  76. * <p>
  77. * 8-bit unsigned integer. 4 components per attribute.
  78. * </p>
  79. *
  80. * @type GeometryAttribute
  81. *
  82. * @default undefined
  83. */
  84. this.color = options.color;
  85. }
  86. return GeometryAttributes;
  87. });