FUi_CardLayoutImpl.cpp
FUiInputConnection.cpp
# FUi_InputConnectionImpl.cpp
- FUi_Matrix3Df.cpp
+ FUi_Matrix4f.pp
FUi_TouchEventManagerImpl.cpp
FUiTouchEventManager.cpp
FUiSystemUtil.cpp
//
/**
- * @file FUi_Matrix3Df.cpp
+ * @file FUi_Matrix4f.cpp
* @brief Header file of _Matrix3Df class
*
* This file contains declarations _Matrix3Df class.
#include <math.h>
#include "FUi_Math.h"
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
#define PI 3.141592653f
namespace Tizen { namespace Ui { namespace Animations
{
-_Matrix3Df::_Matrix3Df(void)
+_Matrix4f::_Matrix4f(void)
{
LoadIdentity();
}
-_Matrix3Df::_Matrix3Df(const float* pValues)
+_Matrix4f::_Matrix4f(const float* pValues)
{
memcpy(__m, pValues, sizeof(__m));
__complexity = GenericMatrix;
}
-_Matrix3Df&
-_Matrix3Df::Assign(const _Matrix3Df& rhs)
+_Matrix4f&
+_Matrix4f::Assign(const _Matrix4f& rhs)
{
memcpy(__m, rhs.__m, sizeof(__m));
__complexity = rhs.__complexity;
return *this;
}
-_Matrix3Df&
-_Matrix3Df::operator =(const _Matrix3Df& rhs)
+_Matrix4f&
+_Matrix4f::operator =(const _Matrix4f& rhs)
{
if (&rhs != this)
return Assign(rhs);
}
bool
-_Matrix3Df::operator ==(const _Matrix3Df& rhs) const
+_Matrix4f::operator ==(const _Matrix4f& rhs) const
{
return (__m[0][0] == rhs.__m[0][0] &&
__m[0][1] == rhs.__m[0][1] &&
}
bool
-_Matrix3Df::operator !=(const _Matrix3Df& rhs) const
+_Matrix4f::operator !=(const _Matrix4f& rhs) const
{
return (__m[0][0] != rhs.__m[0][0] ||
__m[0][1] != rhs.__m[0][1] ||
}
void
-_Matrix3Df::Optimize(void)
+_Matrix4f::Optimize(void)
{
if (__m[3][3] != 1.0f)
{
__complexity = ScaleMatrix;
}
-_Matrix3Df&
-_Matrix3Df::operator *=(const _Matrix3Df& rhs)
+_Matrix4f&
+_Matrix4f::operator *=(const _Matrix4f& rhs)
{
if (__complexity == IdentityMatrix)
{
return *this;
}
-_Matrix3Df&
-_Matrix3Df::MultiplyMatrix(const _Matrix3Df& matrix)
+_Matrix4f&
+_Matrix4f::MultiplyMatrix(const _Matrix4f& matrix)
{
*this = *this * matrix;
return *this;
}
-_Matrix3Df&
-_Matrix3Df::Concatenate(const _Matrix3Df* matrix)
+_Matrix4f&
+_Matrix4f::Concatenate(const _Matrix4f* matrix)
{
return Concatenate(*matrix);
}
-_Matrix3Df&
-_Matrix3Df::Concatenate(const _Matrix3Df& matrix)
+_Matrix4f&
+_Matrix4f::Concatenate(const _Matrix4f& matrix)
{
*this = matrix * *this;
}
float
-_Matrix3Df::GetDeterminant(void) const
+_Matrix4f::GetDeterminant(void) const
{
float a0, a1, a2, a3, a4, a5;
float b0, b1, b2, b3, b4, b5;
}
bool
-_Matrix3Df::IsInvertible(void) const
+_Matrix4f::IsInvertible(void) const
{
if (__complexity == IdentityMatrix)
return true;
}
bool
-_Matrix3Df::Invert(void)
+_Matrix4f::Invert(void)
{
// TODO:
// Optimize using NEON
}
void
-_Matrix3Df::LoadIdentity(void)
+_Matrix4f::LoadIdentity(void)
{
memcpy(__m, identityTransform, sizeof(__m));
__complexity = IdentityMatrix;
}
void
-_Matrix3Df::Transpose(void)
+_Matrix4f::Transpose(void)
{
int i, j;
float tmp;
}
void
-_Matrix3Df::Translate(float tx, float ty, float tz)
+_Matrix4f::Translate(float tx, float ty, float tz)
{
if (__complexity == IdentityMatrix)
{
}
void
-_Matrix3Df::Scale(float sx, float sy, float sz)
+_Matrix4f::Scale(float sx, float sy, float sz)
{
#ifndef GEM_SIMD
if (sx != 1.0f)
}
void
-_Matrix3Df::Shear(float xy, float yz, float zx, float yx, float zy, float xz)
+_Matrix4f::Shear(float xy, float yz, float zx, float yx, float zy, float xz)
{
- _Matrix3Df ShearMatrix;
+ _Matrix4f ShearMatrix;
// refer: http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q43
}
void
-_Matrix3Df::Rotate(float angle, float x, float y, float z)
+_Matrix4f::Rotate(float angle, float x, float y, float z)
{
#if 1
if (angle == 0.0f)
mat[3][3] = 1.0f;
}
- *this *= _Matrix3Df((const float*)mat);
+ *this *= _Matrix4f((const float*)mat);
#else
_Matrix3Df rotMat;
float sinAngle, cosAngle;
}
void
-_Matrix3Df::MakeOrthogonal(float left, float right, float bottom, float top, float n, float f)
+_Matrix4f::MakeOrthogonal(float left, float right, float bottom, float top, float n, float f)
{
- _Matrix3Df mat;
+ _Matrix4f mat;
float w, h, d;
//memcpy(mat.__m, identityTransform, sizeof(mat.__m));
}
void
-_Matrix3Df::MakeFrustum(float left, float right, float bottom, float top, float nearZ, float farZ)
+_Matrix4f::MakeFrustum(float left, float right, float bottom, float top, float nearZ, float farZ)
{
- _Matrix3Df mat;
+ _Matrix4f mat;
float w, h, d;
//memcpy(mat.__m, identityTransform, sizeof(mat.__m));
}
void
-_Matrix3Df::MakePerspective(float fovy, float aspect, float nearZ, float farZ)
+_Matrix4f::MakePerspective(float fovy, float aspect, float nearZ, float farZ)
{
float frustumW, frustumH;
}
void
-_Matrix3Df::MakeLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
+_Matrix4f::MakeLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
{
- _Matrix3Df mat;
+ _Matrix4f mat;
float x[3], y[3], z[3];
float mag;
Translate(-eyeX, -eyeY, -eyeZ);
}
-_Matrix3Df&
-_Matrix3Df::MakeTransformAtAnchor(float x, float y, float z)
+_Matrix4f&
+_Matrix4f::MakeTransformAtAnchor(float x, float y, float z)
{
*this = _Matrix3DfTr(x, y, z) * (*this) * _Matrix3DfTr(-x, -y, -z);
}
float
-_Matrix3Df::Normalize(void)
+_Matrix4f::Normalize(void)
{
float w;
}
void
-_Matrix3Df::Transform(float* pX, float* pY, float* pZ) const
+_Matrix4f::Transform(float* pX, float* pY, float* pZ) const
{
#ifndef GEM_SIMD
float x, y, z, w;
}
void
-_Matrix3Df::CopyFrom(const Tizen::Graphics::FloatMatrix4& matrix)
+_Matrix4f::CopyFrom(const Tizen::Graphics::FloatMatrix4& matrix)
{
__m[0][0] = matrix.matrix[0][0]; __m[0][1] = matrix.matrix[0][1]; __m[0][2] = matrix.matrix[0][2]; __m[0][3] = matrix.matrix[0][3];
__m[1][0] = matrix.matrix[1][0]; __m[1][1] = matrix.matrix[1][1]; __m[1][2] = matrix.matrix[1][2]; __m[1][3] = matrix.matrix[1][3];
#include <FUiAnimBezierTimingFunction.h>
#include "FUi_ControlImpl.h"
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
#include "FUiAnim_FrameAnimatorImpl.h"
#include "FUiAnim_VisualElementAnimationImpl.h"
}
void
-_GlRenderManager::_RenderObject::SetObject(_GlNode* pNode, const _Matrix3Df& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask)
+_GlRenderManager::_RenderObject::SetObject(_GlNode* pNode, const _Matrix4f& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask)
{
int vertexIndex = 0, textureIndex = 0;
__colorMask = colorMask;
- __modelview = _GlRenderManager::GetInstance()->__view * _Matrix3Df(pNode->__transform);
+ __modelview = _GlRenderManager::GetInstance()->__view * _Matrix4f(pNode->__transform);
__invModelview.Assign(__modelview);
__invModelview.Invert();
}
int
-_GlRenderManager::FindRenderObject(_GlNode* pNode, const _Matrix3Df& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask)
+_GlRenderManager::FindRenderObject(_GlNode* pNode, const _Matrix4f& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask)
{
if (unlikely(__queueCount == 0))
{
{
int index;
- _Matrix3Df mvp = __viewProjection * _Matrix3Df(pNode->__transform);
+ _Matrix4f mvp = __viewProjection * _Matrix4f(pNode->__transform);
index = FindRenderObject(pNode, mvp, useStencil, stencilIndex, colorMask);
FloatMatrix4 viewMatrix = pRoot->GetViewMatrix();
FloatMatrix4 projMatrix = pRoot->GetProjectionMatrix();
- _Matrix3Df proj(projMatrix);
- _Matrix3Df view(viewMatrix);
+ _Matrix4f proj(projMatrix);
+ _Matrix4f view(viewMatrix);
__viewProjection = proj * view;
#include "FUiAnim_Waiter.h"
#include "FUi_Colorf.h"
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
#include "FUi_Rectanglef.h"
namespace Tizen { namespace Ui { namespace Animations
bool Animate(void);
- int FindRenderObject(_GlNode* pNode, const _Matrix3Df& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask);
+ int FindRenderObject(_GlNode* pNode, const _Matrix4f& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask);
void EnqueueRenderObject(_GlNode* pNode, bool useStencil, unsigned int stencilIndex, bool colorMask);
void FlushRenderQueue(void);
result Construct(void);
result Release(void);
- void SetObject(_GlNode* pNode, const _Matrix3Df& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask);
+ void SetObject(_GlNode* pNode, const _Matrix4f& mvp, bool useStencil, unsigned int stencilIndex, bool colorMask);
void ResetObject(void);
void AddVertices(_GlNode* pNode);
bool __isMesh;
- _Matrix3Df __mvp;
- _Matrix3Df __modelview;
- _Matrix3Df __invModelview;
+ _Matrix4f __mvp;
+ _Matrix4f __modelview;
+ _Matrix4f __invModelview;
_Colorf __objectColor;
float __opacity;
pid_t __threadId;
_GlContext* __pGlContext;
- _Matrix3Df __view;
- _Matrix3Df __viewProjection;
+ _Matrix4f __view;
+ _Matrix4f __viewProjection;
_RenderObject* __pRenderQueue;
int __queueCount;
#include "FUiAnim_VisualElementImpl.h"
#include "FBaseLog.h"
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
#include "FUiAnim_NativeLayer.h"
#include "FUiAnim_RootVisualElement.h"
#include "FUiAnim_VisualElementSharedData.h"
frame.x = 0.0f;
frame.y = 0.0f;
- _Matrix3Df viewport;
+ _Matrix4f viewport;
viewport.MakeOrthogonal(0.0f, bounds.width, 0.0f, bounds.height, -bounds.height, bounds.height);
viewport.Translate(0.0f, bounds.height, 0.0f);
viewport.Scale(1.0f, -1.0f, 1.0f);
}
_ViewMatrix4f::_ViewMatrix4f(const _ViewMatrix4f& rhs)
- : _Matrix3Df(rhs)
+ : _Matrix4f(rhs)
{
__isCustomView = rhs.__isCustomView;
__needUpdatMatrix = rhs.__needUpdatMatrix;
_ViewMatrix4f&
_ViewMatrix4f::operator =(const _ViewMatrix4f & rhs)
{
- _Matrix3Df::operator= (rhs);
+ _Matrix4f::operator= (rhs);
__isCustomView = rhs.__isCustomView;
__needUpdatMatrix = true;
}
_ProjectionMatrix4f::_ProjectionMatrix4f(const _ProjectionMatrix4f& rhs)
- : _Matrix3Df(rhs)
+ : _Matrix4f(rhs)
{
__type = rhs.__type;
__needUpdatMatrix = rhs.__needUpdatMatrix;
_ProjectionMatrix4f&
_ProjectionMatrix4f::operator =(const _ProjectionMatrix4f & rhs)
{
- _Matrix3Df::operator= (rhs);
+ _Matrix4f::operator= (rhs);
__type = rhs.__type;
__needUpdatMatrix = true;
#include "FUiAnim_MeshImpl.h"
#include "FUiAnim_VisualElementSharedData.h"
#include "FUiAnim_RootVisualElement.h"
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
#include "FGrpFloatRectangle.h"
#include "FUiAnim_NativeLayer.h"
#include "math/FUiAnim_MathVector3.h"
#include "FUiAnim_Ray.h"
#include "FUiAnim_Plane.h"
#include "FUiAnimBoundingVolume.h"
-//#include "FUi_Matrix3Df.h"
+//#include "FUi_Matrix4f.h"
//#include "FGrpFloatRectangle.h"
//#include "FUiAnim_NativeLayer.h"
#include <FGrpFloatPoint3.h>
#include <FGrpFloatMatrix4.h>
-#include "FUi_Matrix3Df.h"
+#include "FUi_Matrix4f.h"
namespace Tizen { namespace Ui { namespace Animations {
}; // _TransformMatrix3Df
-class _ViewMatrix4f : public _Matrix3Df
+class _ViewMatrix4f : public _Matrix4f
{
public:
_ViewMatrix4f(void);
float __upZ;
};
-class _ProjectionMatrix4f : public _Matrix3Df
+class _ProjectionMatrix4f : public _Matrix4f
{
public:
//
/**
- * @file FUi_Matrix3Df.h
+ * @file FUi_Matrix4f.h
* @brief Header file of _Matrix3Df class
*
* This file contains declarations _Matrix3Df class.
namespace Tizen { namespace Ui { namespace Animations
{
-class _OSP_EXPORT_ _Matrix3Df
+class _OSP_EXPORT_ _Matrix4f
{
public:
enum
GenericMatrix = 0x0008
};
- _Matrix3Df(void);
- _Matrix3Df(const _Matrix3Df& rhs)
+ _Matrix4f(void);
+ _Matrix4f(const _Matrix4f& rhs)
{
memcpy(__m, rhs.__m, sizeof(__m));
__complexity = rhs.__complexity;
}
- _Matrix3Df(const Tizen::Graphics::FloatMatrix4& rhs)
+ _Matrix4f(const Tizen::Graphics::FloatMatrix4& rhs)
{
memcpy(__m, rhs.matrix, sizeof(__m));
__complexity = GenericMatrix;
}
- explicit _Matrix3Df(const float* pValues);
+ explicit _Matrix4f(const float* pValues);
- _Matrix3Df& Assign(const _Matrix3Df& rhs);
+ _Matrix4f& Assign(const _Matrix4f& rhs);
- bool operator ==(const _Matrix3Df& rhs) const;
- bool operator !=(const _Matrix3Df& rhs) const;
- virtual _Matrix3Df& operator =(const _Matrix3Df& rhs);
- virtual _Matrix3Df& operator *=(const _Matrix3Df& rhs);
+ bool operator ==(const _Matrix4f& rhs) const;
+ bool operator !=(const _Matrix4f& rhs) const;
+ virtual _Matrix4f& operator =(const _Matrix4f& rhs);
+ virtual _Matrix4f& operator *=(const _Matrix4f& rhs);
- friend _Matrix3Df operator *(const _Matrix3Df& matrix1, const _Matrix3Df& matrix2);
+ friend _Matrix4f operator *(const _Matrix4f& matrix1, const _Matrix4f& matrix2);
void Optimize(void);
bool IsIdentity(void) const { return __complexity == IdentityMatrix;}
void LoadIdentity(void);
void Transpose(void);
- _Matrix3Df& MultiplyMatrix(const _Matrix3Df& matrix);
- _Matrix3Df& Concatenate(const _Matrix3Df* matrix);
- _Matrix3Df& Concatenate(const _Matrix3Df& matrix);
+ _Matrix4f& MultiplyMatrix(const _Matrix4f& matrix);
+ _Matrix4f& Concatenate(const _Matrix4f* matrix);
+ _Matrix4f& Concatenate(const _Matrix4f& matrix);
float GetDeterminant(void) const;
bool IsInvertible(void) const;
void MakeFrustum(float left, float right, float bottom, float top, float n, float f);
void MakePerspective(float fovy, float aspect, float nearZ, float farZ);
void MakeLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ);
- _Matrix3Df& MakeTransformAtAnchor(float x, float y, float z);
+ _Matrix4f& MakeTransformAtAnchor(float x, float y, float z);
float Normalize(void);
void Transform(float* pX, float* pY, float* pZ) const;
}; // _Matrix3Df
-inline _Matrix3Df
-operator *(const _Matrix3Df& matrix1, const _Matrix3Df& matrix2)
+inline _Matrix4f
+operator *(const _Matrix4f& matrix1, const _Matrix4f& matrix2)
{
- if (matrix1.__complexity == _Matrix3Df::IdentityMatrix)
+ if (matrix1.__complexity == _Matrix4f::IdentityMatrix)
return matrix2;
- if (matrix2.__complexity == _Matrix3Df::IdentityMatrix)
+ if (matrix2.__complexity == _Matrix4f::IdentityMatrix)
return matrix1;
- if (matrix1.__complexity == _Matrix3Df::TranslationMatrix)
+ if (matrix1.__complexity == _Matrix4f::TranslationMatrix)
{
- if (matrix2.__complexity == _Matrix3Df::TranslationMatrix)
+ if (matrix2.__complexity == _Matrix4f::TranslationMatrix)
{
- _Matrix3Df ret;
+ _Matrix4f ret;
ret.__m[3][0] = matrix2.__m[3][0] + matrix1.__m[3][0] * matrix2.__m[3][3];
ret.__m[3][1] = matrix2.__m[3][1] + matrix1.__m[3][1] * matrix2.__m[3][3];
ret.__m[3][2] = matrix2.__m[3][2] + matrix1.__m[3][2] * matrix2.__m[3][3];
ret.__m[3][3] = matrix1.__m[3][3] * matrix2.__m[3][3];
- ret.__complexity = _Matrix3Df::TranslationMatrix;
+ ret.__complexity = _Matrix4f::TranslationMatrix;
return ret;
}
(matrix1.__m[2][3] * matrix2.__m[3][2]) +
(matrix1.__m[3][3] * matrix2.__m[3][3]);
- return _Matrix3Df((const float*)m);
+ return _Matrix4f((const float*)m);
}
-class _Matrix3DfTr : public _Matrix3Df
+class _Matrix3DfTr : public _Matrix4f
{
public:
_Matrix3DfTr(float tx, float ty, float tz)
}
}; // _Matrix3DfTr
-class _Matrix3DfRot : public _Matrix3Df
+class _Matrix3DfRot : public _Matrix4f
{
public:
_Matrix3DfRot(float angle, float x, float y, float z)