Terrain.pkg 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. $#include "Terrain.h"
  2. class Terrain : public Component
  3. {
  4. void SetPatchSize(int size);
  5. void SetSpacing(const Vector3& spacing);
  6. void SetSmoothing(bool enable);
  7. bool SetHeightMap(Image* image);
  8. void SetMaterial(Material* material);
  9. void SetDrawDistance(float distance);
  10. void SetShadowDistance(float distance);
  11. void SetLodBias(float bias);
  12. void SetViewMask(unsigned mask);
  13. void SetLightMask(unsigned mask);
  14. void SetShadowMask(unsigned mask);
  15. void SetZoneMask(unsigned mask);
  16. void SetMaxLights(unsigned num);
  17. void SetCastShadows(bool enable);
  18. void SetOccluder(bool enable);
  19. void SetOccludee(bool enable);
  20. void ApplyHeightMap();
  21. int GetPatchSize() const;
  22. const Vector3& GetSpacing() const;
  23. const IntVector2& GetNumVertices() const;
  24. const IntVector2& GetNumPatches() const;
  25. bool GetSmoothing() const;
  26. Image* GetHeightMap() const;
  27. Material* GetMaterial() const;
  28. TerrainPatch* GetPatch(unsigned index) const;
  29. TerrainPatch* GetPatch(int x, int z) const;
  30. float GetHeight(const Vector3& worldPosition) const;
  31. Vector3 GetNormal(const Vector3& worldPosition) const;
  32. IntVector2 WorldToHeightMap(const Vector3& worldPosition) const;
  33. SharedArrayPtr<float> GetHeightData() const;
  34. float GetDrawDistance() const;
  35. float GetShadowDistance() const;
  36. float GetLodBias() const;
  37. unsigned GetViewMask() const;
  38. unsigned GetLightMask() const;
  39. unsigned GetShadowMask() const;
  40. unsigned GetZoneMask() const;
  41. unsigned GetMaxLights() const;
  42. bool IsVisible() const;
  43. bool GetCastShadows() const;
  44. bool IsOccluder() const;
  45. bool IsOccludee() const;
  46. tolua_property__get_set int patchSize;
  47. tolua_property__get_set Vector3& spacing;
  48. tolua_readonly tolua_property__get_set IntVector2& numVertices;
  49. tolua_readonly tolua_property__get_set IntVector2& numPatches;
  50. tolua_property__get_set bool smoothing;
  51. tolua_property__get_set Image* heightMap;
  52. tolua_property__get_set Material* material;
  53. tolua_property__get_set float drawDistance;
  54. tolua_property__get_set float shadowDistance;
  55. tolua_property__get_set float lodBias;
  56. tolua_property__get_set unsigned viewMask;
  57. tolua_property__get_set unsigned lightMask;
  58. tolua_property__get_set unsigned shadowMask;
  59. tolua_property__get_set unsigned zoneMask;
  60. tolua_property__get_set unsigned maxLights;
  61. tolua_readonly tolua_property__is_set bool visible;
  62. tolua_property__get_set bool castShadows;
  63. tolua_property__is_set bool occluder;
  64. tolua_property__is_set bool occludee;
  65. };