X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FPlanet.hpp;h=3677ca4c92aeccd29e950920bc7461ca6c7c964f;hb=HEAD;hp=2034b8dc4c787b4f30e6a52eb87389402e1c1f95;hpb=0e061ce526fe46dd3e894223e5d646eb2e30f826;p=blobs.git diff --git a/src/world/Planet.hpp b/src/world/Planet.hpp index 2034b8d..3677ca4 100644 --- a/src/world/Planet.hpp +++ b/src/world/Planet.hpp @@ -41,6 +41,8 @@ public: double ElevationAt(const glm::dvec3 &p) const noexcept { return glm::length(p) - Radius(); } /// distance to planet center double DistanceAt(const glm::dvec3 &p) const noexcept { return glm::length(p); } + /// acceleration due to gravity at given point + glm::dvec3 GravityAt(const glm::dvec3 &p) const noexcept { return NormalAt(p) * (-GravitationalParameter() / glm::length2(p)); } /// get ground tile Tile &TileAt(const glm::dvec3 &) noexcept; @@ -58,7 +60,7 @@ public: // center point of tile on surface at elevation glm::dvec3 TileCenter(int surface, int x, int y, double elevation = 0.0) const noexcept; - void BuildVAO(const Set &); + void BuildVAO(); void Draw(app::Assets &, graphics::Viewport &) override; private: @@ -86,6 +88,9 @@ private: glm::vec3 position; glm::vec3 normal; glm::vec3 tex_coord; + float shiny; + float glossy; + float metallic; }; std::unique_ptr> vao;