light: add some stuff to faceextents_t

This commit is contained in:
Eric Wasylishen 2017-02-21 16:02:04 -07:00
parent 044bd4c9c0
commit b0662de90f
1 changed files with 9 additions and 0 deletions

View File

@ -135,6 +135,7 @@ public:
int width() const { return m_texsize[0] + 1; }
int height() const { return m_texsize[1] + 1; }
int numsamples() const { return width() * height(); }
glm::ivec2 texsize() const { return glm::ivec2(width(), height()); }
int indexOf(const glm::ivec2 &lm) const {
Q_assert(lm.x >= 0 && lm.x < width());
@ -171,6 +172,14 @@ public:
return glm::vec3( res[0], res[1], res[2] );
}
glm::vec2 worldToLMCoord(glm::vec3 world) const {
return TexCoordToLMCoord(worldToTexCoord(world));
}
glm::vec3 LMCoordToWorld(glm::vec2 lm) const {
return texCoordToWorld(LMCoordToTexCoord(lm));
}
};
class sample_t {