BsMeshImportOptions.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsImportOptions.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Importer
  9. * @{
  10. */
  11. /** Controls what type of collision mesh should be imported during mesh import. */
  12. enum class CollisionMeshType
  13. {
  14. None, /**< No collision mesh will be imported. */
  15. Normal, /**< Normal triangle mesh will be imported. */
  16. Convex /**< A convex hull will be generated from the source mesh. */
  17. };
  18. /**
  19. * Contains import options you may use to control how is a mesh imported from some external format into engine format.
  20. */
  21. class BS_CORE_EXPORT MeshImportOptions : public ImportOptions
  22. {
  23. public:
  24. MeshImportOptions();
  25. /** Sets whether the texture data is also stored in CPU memory. */
  26. void setCPUReadable(bool readable) { mCPUReadable = readable; }
  27. /** Retrieves whether the texture data is also stored in CPU memory. */
  28. bool getCPUReadable() const { return mCPUReadable; }
  29. /** Sets a value that controls should mesh normals be imported if available. */
  30. void setImportNormals(bool import) { mImportNormals = import; }
  31. /** Retrieves a value that controls should mesh normals be imported if available. */
  32. bool getImportNormals() const { return mImportNormals; }
  33. /** Sets a value that controls should mesh tangents/bitangents be imported if available. */
  34. void setImportTangents(bool import) { mImportTangents = import; }
  35. /** Retrieves a value that controls should mesh tangent/bitangent be imported if available. */
  36. bool getImportTangents() const { return mImportTangents; }
  37. /** Sets a value that controls should mesh blend shapes be imported if available. */
  38. void setImportBlendShapes(bool import) { mImportBlendShapes = import; }
  39. /** Retrieves a value that controls should mesh blend shapes be imported if available. */
  40. bool getImportBlendShapes() const { return mImportBlendShapes; }
  41. /**
  42. * Sets a value that controls should mesh skin data like bone weights, indices and bind poses be imported if
  43. * available.
  44. */
  45. void setImportSkin(bool import) { mImportSkin = import; }
  46. /**
  47. * Retrieves a value that controls should mesh skin data like bone weights, indices and bind poses be imported if
  48. * available.
  49. */
  50. bool getImportSkin() const { return mImportSkin; }
  51. /** Sets a value that controls should animation clips be imported if available. */
  52. void setImportAnimation(bool import) { mImportAnimation = import; }
  53. /** Retrieves a value that controls should animation clips be imported if available. */
  54. bool getImportAnimation() const { return mImportAnimation; }
  55. /** Sets a value that will uniformly scale the imported mesh by the specified value. */
  56. void setImportScale(float import) { mImportScale = import; }
  57. /** Retrieves a value that will uniformly scale the imported mesh by the specified value. */
  58. float getImportScale() const { return mImportScale; }
  59. /** Sets a value that controls what type (if any) of collision mesh should be imported. */
  60. void setCollisionMeshType(CollisionMeshType type) { mCollisionMeshType = type; }
  61. /** Retrieves a value that controls what type (if any) of collision mesh should be imported. */
  62. CollisionMeshType getCollisionMeshType() const { return mCollisionMeshType; }
  63. /************************************************************************/
  64. /* SERIALIZATION */
  65. /************************************************************************/
  66. public:
  67. friend class MeshImportOptionsRTTI;
  68. static RTTITypeBase* getRTTIStatic();
  69. virtual RTTITypeBase* getRTTI() const override;
  70. private:
  71. bool mCPUReadable;
  72. bool mImportNormals;
  73. bool mImportTangents;
  74. bool mImportBlendShapes;
  75. bool mImportSkin;
  76. bool mImportAnimation;
  77. float mImportScale;
  78. CollisionMeshType mCollisionMeshType;
  79. };
  80. /** @} */
  81. }