gltf_accessor.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**************************************************************************/
  2. /* gltf_accessor.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef GLTF_ACCESSOR_H
  31. #define GLTF_ACCESSOR_H
  32. #include "core/resource.h"
  33. #include "gltf_document.h"
  34. struct GLTFAccessor : public Resource {
  35. GDCLASS(GLTFAccessor, Resource);
  36. friend class GLTFDocument;
  37. private:
  38. GLTFBufferViewIndex buffer_view = 0;
  39. int byte_offset = 0;
  40. int component_type = 0;
  41. bool normalized = false;
  42. int count = 0;
  43. GLTFDocument::GLTFType type = GLTFDocument::TYPE_SCALAR;
  44. PoolVector<float> min;
  45. PoolVector<float> max;
  46. int sparse_count = 0;
  47. int sparse_indices_buffer_view = 0;
  48. int sparse_indices_byte_offset = 0;
  49. int sparse_indices_component_type = 0;
  50. int sparse_values_buffer_view = 0;
  51. int sparse_values_byte_offset = 0;
  52. protected:
  53. static void _bind_methods();
  54. public:
  55. GLTFBufferViewIndex get_buffer_view();
  56. void set_buffer_view(GLTFBufferViewIndex p_buffer_view);
  57. int get_byte_offset();
  58. void set_byte_offset(int p_byte_offset);
  59. int get_component_type();
  60. void set_component_type(int p_component_type);
  61. bool get_normalized();
  62. void set_normalized(bool p_normalized);
  63. int get_count();
  64. void set_count(int p_count);
  65. int get_type();
  66. void set_type(int p_type);
  67. PoolVector<float> get_min();
  68. void set_min(PoolVector<float> p_min);
  69. PoolVector<float> get_max();
  70. void set_max(PoolVector<float> p_max);
  71. int get_sparse_count();
  72. void set_sparse_count(int p_sparse_count);
  73. int get_sparse_indices_buffer_view();
  74. void set_sparse_indices_buffer_view(int p_sparse_indices_buffer_view);
  75. int get_sparse_indices_byte_offset();
  76. void set_sparse_indices_byte_offset(int p_sparse_indices_byte_offset);
  77. int get_sparse_indices_component_type();
  78. void set_sparse_indices_component_type(int p_sparse_indices_component_type);
  79. int get_sparse_values_buffer_view();
  80. void set_sparse_values_buffer_view(int p_sparse_values_buffer_view);
  81. int get_sparse_values_byte_offset();
  82. void set_sparse_values_byte_offset(int p_sparse_values_byte_offset);
  83. };
  84. #endif // GLTF_ACCESSOR_H