Add ModelMatrix retrieval to WindowWrapper

This commit is contained in:
Alexander Bock
2016-06-16 00:57:31 +02:00
parent f38b8856c1
commit 5cc278c97f
4 changed files with 16 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ public:
bool isRegularRendering() const override;
glm::mat4 viewProjectionMatrix() const override;
glm::mat4 modelMatrix() const override;
void setNearFarClippingPlane(float near, float far) override;
glm::ivec4 viewportPixelCoordinates() const override;

View File

@@ -131,6 +131,13 @@ public:
* \return The currently employed view-projection matrix
*/
virtual glm::mat4 viewProjectionMatrix() const;
/**
* Returns the currently employed model matrix. On default, this method will return
* the identity matrix.
* \return The currently employed model matrix
*/
virtual glm::mat4 modelMatrix() const;
/**
* Sets the near and far clipping planes of the rendering window. This method defaults

View File

@@ -115,6 +115,10 @@ bool SGCTWindowWrapper::isRegularRendering() const {
glm::mat4 SGCTWindowWrapper::viewProjectionMatrix() const {
return sgct::Engine::instance()->getCurrentModelViewProjectionMatrix();
}
glm::mat4 SGCTWindowWrapper::modelMatrix() const {
return sgct::Engine::instance()->getModelMatrix();
}
void SGCTWindowWrapper::setNearFarClippingPlane(float nearPlane, float farPlane) {
sgct::Engine::instance()->setNearAndFarClippingPlanes(nearPlane, farPlane);

View File

@@ -75,6 +75,10 @@ bool WindowWrapper::isRegularRendering() const {
glm::mat4 WindowWrapper::viewProjectionMatrix() const {
return glm::mat4(1.f);
}
glm::mat4 WindowWrapper::modelMatrix() const {
return glm::mat4(1.f);
}
void WindowWrapper::setNearFarClippingPlane(float near, float far) {}