DecalSet.pkg 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. $#include "DecalSet.h"
  2. /// %Decal renderer component.
  3. class DecalSet : public Drawable
  4. {
  5. public:
  6. /// Set material. The material should use a small negative depth bias to avoid Z-fighting.
  7. void SetMaterial(Material* material);
  8. /// Set maximum number of decal vertices.
  9. void SetMaxVertices(unsigned num);
  10. /// Set maximum number of decal vertex indices.
  11. void SetMaxIndices(unsigned num);
  12. /// Add a decal at world coordinates, using a target drawable's geometry for reference. If the decal needs to move with the target, the decal component should be created to the target's node. Return true if successful.
  13. bool AddDecal(Drawable* target, const Vector3& worldPosition, const Quaternion& worldRotation, float size, float aspectRatio, float depth, const Vector2& topLeftUV, const Vector2& bottomRightUV, float timeToLive = 0.0f, float normalCutoff = 0.1f, unsigned subGeometry = M_MAX_UNSIGNED);
  14. /// Remove n oldest decals.
  15. void RemoveDecals(unsigned num);
  16. /// Remove all decals.
  17. void RemoveAllDecals();
  18. /// Return material.
  19. Material* GetMaterial() const;
  20. /// Return number of decals.
  21. unsigned GetNumDecals() const { return decals_.Size(); }
  22. /// Retur number of vertices in the decals.
  23. unsigned GetNumVertices() const { return numVertices_; }
  24. /// Retur number of vertex indices in the decals.
  25. unsigned GetNumIndices() const { return numIndices_; }
  26. /// Return maximum number of decal vertices.
  27. unsigned GetMaxVertices() const { return maxVertices_; }
  28. /// Return maximum number of decal vertex indices.
  29. unsigned GetMaxIndices() const { return maxIndices_; }
  30. };