Drawable.pkg 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. $#include "Drawable.h"
  2. static const unsigned DRAWABLE_GEOMETRY;
  3. static const unsigned DRAWABLE_LIGHT;
  4. static const unsigned DRAWABLE_ZONE;
  5. static const unsigned DRAWABLE_ANY;
  6. static const unsigned DEFAULT_VIEWMASK;
  7. static const unsigned DEFAULT_LIGHTMASK;
  8. static const unsigned DEFAULT_SHADOWMASK;
  9. static const unsigned DEFAULT_ZONEMASK;
  10. static const int DRAWABLES_PER_WORK_ITEM;
  11. static const int MAX_VERTEX_LIGHTS;
  12. static const float ANIMATION_LOD_BASESCALE;
  13. enum UpdateGeometryType
  14. {
  15. UPDATE_NONE = 0,
  16. UPDATE_MAIN_THREAD,
  17. UPDATE_WORKER_THREAD
  18. };
  19. class Drawable : public Component
  20. {
  21. void SetDrawDistance(float distance);
  22. void SetShadowDistance(float distance);
  23. void SetLodBias(float bias);
  24. void SetViewMask(unsigned mask);
  25. void SetLightMask(unsigned mask);
  26. void SetShadowMask(unsigned mask);
  27. void SetZoneMask(unsigned mask);
  28. void SetMaxLights(unsigned num);
  29. void SetCastShadows(bool enable);
  30. void SetOccluder(bool enable);
  31. void SetOccludee(bool enable);
  32. void MarkForUpdate();
  33. const BoundingBox& GetBoundingBox() const;
  34. const BoundingBox& GetWorldBoundingBox();
  35. unsigned char GetDrawableFlags() const;
  36. float GetDrawDistance() const;
  37. float GetShadowDistance() const;
  38. float GetLodBias() const;
  39. unsigned GetViewMask() const;
  40. unsigned GetLightMask() const;
  41. unsigned GetShadowMask() const;
  42. unsigned GetZoneMask() const;
  43. unsigned GetMaxLights() const;
  44. bool GetCastShadows() const;
  45. bool IsOccluder() const;
  46. bool IsOccludee() const;
  47. void SetZone(Zone* zone, bool temporary = false);
  48. void SetSortValue(float value);
  49. void SetMinMaxZ(float minZ, float maxZ);
  50. void MarkInView(const FrameInfo& frame, bool mainView = true);
  51. void ClearLights();
  52. void AddLight(Light* light);
  53. void AddVertexLight(Light* light);
  54. void LimitLights();
  55. void LimitVertexLights();
  56. void SetBasePass(unsigned batchIndex);
  57. Octant* GetOctant() const;
  58. Zone* GetZone() const;
  59. Zone* GetLastZone() const;
  60. bool IsZoneDirty() const;
  61. float GetDistance() const;
  62. float GetLodDistance() const;
  63. float GetSortValue() const;
  64. bool IsInView(unsigned frameNumber) const;
  65. bool IsInView(const FrameInfo& frame, bool mainView = true) const;
  66. bool HasBasePass(unsigned batchIndex) const;
  67. Light* GetFirstLight() const;
  68. float GetMinZ() const;
  69. float GetMaxZ() const;
  70. tolua_readonly tolua_property__get_set BoundingBox& worldBoundingBox;
  71. tolua_readonly tolua_property__get_set unsigned char drawableFlags;
  72. tolua_property__get_set float drawDistance;
  73. tolua_property__get_set float shadowDistance;
  74. tolua_property__get_set float lodBias;
  75. tolua_property__get_set unsigned viewMask;
  76. tolua_property__get_set unsigned lightMask;
  77. tolua_property__get_set unsigned shadowMask;
  78. tolua_property__get_set unsigned zoneMask;
  79. tolua_property__get_set unsigned maxLights;
  80. tolua_property__get_set bool castShadows;
  81. tolua_property__is_set bool occluder;
  82. tolua_property__is_set bool occludee;
  83. tolua_readonly tolua_property__get_set Octant* octant;
  84. tolua_property__get_set Zone* zone;
  85. tolua_readonly tolua_property__get_set Zone* lastZone;
  86. tolua_readonly tolua_property__is_set bool zoneDirty;
  87. tolua_readonly tolua_property__get_set float distance;
  88. tolua_readonly tolua_property__get_set float lodDistance;
  89. tolua_property__get_set float sortValue;
  90. tolua_readonly tolua_property__get_set Light* firstLight;
  91. tolua_readonly tolua_property__get_set float minZ;
  92. tolua_readonly tolua_property__get_set float maxZ;
  93. };