StaticModel.pkg 1.2 KB

123456789101112131415161718192021222324252627282930
  1. $#include "StaticModel.h"
  2. /// Static model component.
  3. class StaticModel : public Drawable
  4. {
  5. public:
  6. /// Set model.
  7. void SetModel(Model* model);
  8. /// Set material on all geometries.
  9. void SetMaterial(Material* material);
  10. /// Set material on one geometry. Return true if successful.
  11. bool SetMaterial(unsigned index, Material* material);
  12. /// Set occlusion LOD level. By default (M_MAX_UNSIGNED) same as visible.
  13. void SetOcclusionLodLevel(unsigned level);
  14. /// Return model.
  15. Model* GetModel() const { return model_; }
  16. /// Return model's bounding box.
  17. const BoundingBox& GetBoundingBox() const { return boundingBox_; }
  18. /// Return number of geometries.
  19. unsigned GetNumGeometries() const { return geometries_.Size(); }
  20. /// Return material by geometry index.
  21. Material* GetMaterial(unsigned index) const;
  22. /// Return occlusion LOD level.
  23. unsigned GetOcclusionLodLevel() const { return occlusionLodLevel_; }
  24. /// Determines if the given world space point is within the model geometry.
  25. bool IsInside(const Vector3& point) const;
  26. /// Determines if the given local space point is within the model geometry.
  27. bool IsInsideLocal(const Vector3& point) const;
  28. };