Model.pkg 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $#include "Graphics/Model.h"
  2. class Model : public Resource
  3. {
  4. // SharedPtr<Model> Clone(const String cloneName = String::EMPTY) const;
  5. tolua_outside Model* ModelClone @ Clone(const String cloneName = String::EMPTY) const;
  6. void SetBoundingBox(const BoundingBox& box);
  7. void SetNumGeometries(unsigned num);
  8. bool SetNumGeometryLodLevels(unsigned index, unsigned num);
  9. bool SetGeometry(unsigned index, unsigned lodLevel, Geometry* geometry);
  10. bool SetGeometryCenter(unsigned index, const Vector3& center);
  11. const BoundingBox& GetBoundingBox() const;
  12. Skeleton& GetSkeleton();
  13. unsigned GetNumGeometries() const;
  14. unsigned GetNumGeometryLodLevels(unsigned index) const;
  15. Geometry* GetGeometry(unsigned index, unsigned lodLevel) const;
  16. const Vector3& GetGeometryCenter(unsigned index) const;
  17. unsigned GetNumMorphs() const;
  18. const ModelMorph* GetMorph(const String name) const;
  19. const ModelMorph* GetMorph(StringHash nameHash) const;
  20. const ModelMorph* GetMorph(unsigned index) const;
  21. unsigned GetMorphRangeStart(unsigned bufferIndex) const;
  22. unsigned GetMorphRangeCount(unsigned bufferIndex) const;
  23. tolua_property__get_set BoundingBox& boundingBox;
  24. tolua_readonly tolua_property__get_set Skeleton skeleton;
  25. tolua_readonly tolua_property__get_set unsigned numGeometries;
  26. tolua_readonly tolua_property__get_set unsigned numMorphs;
  27. };
  28. ${
  29. static Model* ModelClone(const Model* model, const String& cloneName = String::EMPTY)
  30. {
  31. if (!model)
  32. return 0;
  33. SharedPtr<Model> clonedModelPtr = model->Clone(cloneName);
  34. Model* clonedModel = clonedModelPtr.Get();
  35. clonedModelPtr.Detach();
  36. return clonedModel;
  37. }
  38. $}