*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include "dali-scene-loader/public-api/camera-parameters.h"
#include "dali-scene-loader/public-api/utils.h"
*/
#include "dali-scene-loader/public-api/camera-parameters.h"
#include "dali-scene-loader/public-api/utils.h"
* @param[in] far The distance to the far depth clipping plane.
* @param[in] invertYAxis Whether to invert the 'Y' axis.
*/
* @param[in] far The distance to the far depth clipping plane.
* @param[in] invertYAxis Whether to invert the 'Y' axis.
*/
-void Frustum( Matrix& result, float left, float right, float bottom, float top, float nearPlane, float farPlane, bool invertYAxis )
+void Frustum(Matrix& result, float left, float right, float bottom, float top, float nearPlane, float farPlane, bool invertYAxis)
- if ((nearPlane <= 0.0f) || (farPlane <= 0.0f) || Equals(right, left) || Equals(bottom, top) || (deltaZ <= 0.0f))
+ if((nearPlane <= 0.0f) || (farPlane <= 0.0f) || Equals(right, left) || Equals(bottom, top) || (deltaZ <= 0.0f))
{
DALI_LOG_ERROR("Invalid parameters passed into Frustum!\n");
DALI_ASSERT_DEBUG("Invalid parameters passed into Frustum!");
{
DALI_LOG_ERROR("Invalid parameters passed into Frustum!\n");
DALI_ASSERT_DEBUG("Invalid parameters passed into Frustum!");
m[1] = m[2] = m[3] = 0.0f;
m[5] = -2.0f * nearPlane / deltaY;
m[4] = m[6] = m[7] = 0.0f;
m[1] = m[2] = m[3] = 0.0f;
m[5] = -2.0f * nearPlane / deltaY;
m[4] = m[6] = m[7] = 0.0f;
* @param[in] farPlane The distance to the far depth clipping plane.
* @param[in] invertYAxis Whether to invert the 'Y' axis.
*/
* @param[in] farPlane The distance to the far depth clipping plane.
* @param[in] invertYAxis Whether to invert the 'Y' axis.
*/
-void Perspective( Matrix& result, float fovy, float aspect, float nearPlane, float farPlane, bool invertYAxis )
+void Perspective(Matrix& result, float fovy, float aspect, float nearPlane, float farPlane, bool invertYAxis)
- Frustum( result, -frustumW, frustumW, -frustumH, frustumH, nearPlane, farPlane, invertYAxis );
+ Frustum(result, -frustumW, frustumW, -frustumH, frustumH, nearPlane, farPlane, invertYAxis);
*/
void Orthographic(Matrix& result, float left, float right, float bottom, float top, float nearPlane, float farPlane, bool invertYAxis)
{
*/
void Orthographic(Matrix& result, float left, float right, float bottom, float top, float nearPlane, float farPlane, bool invertYAxis)
{
- if (Equals(right, left) || Equals(top, bottom) || Equals(farPlane, nearPlane))
+ if(Equals(right, left) || Equals(top, bottom) || Equals(farPlane, nearPlane))
{
DALI_LOG_ERROR("Cannot create orthographic projection matrix with a zero dimension.\n");
DALI_ASSERT_DEBUG("Cannot create orthographic projection matrix with a zero dimension.");
{
DALI_LOG_ERROR("Cannot create orthographic projection matrix with a zero dimension.\n");
DALI_ASSERT_DEBUG("Cannot create orthographic projection matrix with a zero dimension.");
ViewProjection CameraParameters::GetViewProjection() const
{
ViewProjection viewProjection;
// The projection matrix.
ViewProjection CameraParameters::GetViewProjection() const
{
ViewProjection viewProjection;
// The projection matrix.
matrix.GetTransformComponents(translation, cameraOrientation, scale);
cameraOrientation *= viewQuaternion;
viewProjection.GetView().SetInverseTransformComponents(scale,
matrix.GetTransformComponents(translation, cameraOrientation, scale);
cameraOrientation *= viewQuaternion;
viewProjection.GetView().SetInverseTransformComponents(scale,
-void CameraParameters::CalculateTransformComponents(Vector3 & position, Quaternion & orientation, Vector3 & scale) const
+void CameraParameters::CalculateTransformComponents(Vector3& position, Quaternion& orientation, Vector3& scale) const
{
camera.SetProjectionMode(Camera::ORTHOGRAPHIC_PROJECTION);
camera.SetOrthographicProjection(orthographicSize.x,
{
camera.SetProjectionMode(Camera::ORTHOGRAPHIC_PROJECTION);
camera.SetOrthographicProjection(orthographicSize.x,
Quaternion camOrientation;
CalculateTransformComponents(camTranslation, camOrientation, camScale);
Quaternion camOrientation;
CalculateTransformComponents(camTranslation, camOrientation, camScale);