Restore pixel perfect camera code.
This commit is contained in:
@@ -56,6 +56,20 @@ float_t Camera::getAspect() {
|
||||
return rt->getWidth() / rt->getHeight();
|
||||
}
|
||||
|
||||
float_t Camera::lookAtPixelPerfect(
|
||||
const glm::vec3 &position,
|
||||
const glm::vec3 &look,
|
||||
const float_t &scale
|
||||
) {
|
||||
return this->getItem()->lookAtPixelPerfect(
|
||||
position,
|
||||
look,
|
||||
this->getRenderTarget()->getHeight(),
|
||||
this->fov,
|
||||
scale
|
||||
);
|
||||
}
|
||||
|
||||
void Camera::setRenderTarget(std::shared_ptr<RenderTarget> renderTarget) {
|
||||
onResizeListener();
|
||||
this->renderTarget = renderTarget;
|
||||
|
@@ -57,6 +57,20 @@ namespace Dawn {
|
||||
*/
|
||||
glm::mat4 getProjection();
|
||||
|
||||
/**
|
||||
* Shorthand for getItem()->lookAtPixelPerfect()
|
||||
*
|
||||
* @param position Position to look from.
|
||||
* @param look Position to look at.
|
||||
* @param scale Scale to use. At scale 1 then the centerest pixel is 1:1.
|
||||
* @return The Z distance that was calculated.
|
||||
*/
|
||||
float_t lookAtPixelPerfect(
|
||||
const glm::vec3 &position,
|
||||
const glm::vec3 &look,
|
||||
const float_t &scale = 1.0f
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the render target for this camera.
|
||||
*
|
||||
|
Reference in New Issue
Block a user