diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-10 14:26:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-10 14:26:39 +0400 |
commit | 250109f5ace8471451a6d8bda8f67ffc955eb4b7 (patch) | |
tree | 6228de4b3b9dd229e2b129549e69e6edf06c84be /source/gameengine/Rasterizer | |
parent | fecc3b9d68102630fc53f451a3f405f180b31384 (diff) |
add argument so recent bge function mesh.transform_uv() so you can optionally transform between UV1 / UV2
Diffstat (limited to 'source/gameengine/Rasterizer')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_TexVert.cpp | 19 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_TexVert.h | 8 |
2 files changed, 20 insertions, 7 deletions
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 6d8cbfece15..945644ff3e6 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -75,21 +75,32 @@ void RAS_TexVert::SetXYZ(const MT_Point3& xyz) xyz.getValue(m_localxyz); } -void RAS_TexVert::SetXYZ(const float *xyz) +void RAS_TexVert::SetXYZ(const float xyz[3]) { m_localxyz[0] = xyz[0]; m_localxyz[1] = xyz[1]; m_localxyz[2] = xyz[2]; } -void RAS_TexVert::SetUV(const MT_Point2& uv) +void RAS_TexVert::SetUV1(const MT_Point2& uv) { uv.getValue(m_uv1); } +void RAS_TexVert::SetUV1(const float uv[3]) +{ + m_uv1[0] = uv[0]; + m_uv1[1] = uv[1]; +} + void RAS_TexVert::SetUV2(const MT_Point2& uv) { uv.getValue(m_uv2); } +void RAS_TexVert::SetUV2(const float uv[3]) +{ + m_uv2[0] = uv[0]; + m_uv2[1] = uv[1]; +} void RAS_TexVert::SetRGBA(const unsigned int rgba) { @@ -151,9 +162,9 @@ void RAS_TexVert::Transform(const MT_Matrix4x4& mat, const MT_Matrix4x4& nmat) SetTangent((nmat*MT_Vector4(m_tangent[0], m_tangent[1], m_tangent[2], 1.0)).getValue()); } -void RAS_TexVert::TransformUV(const MT_Matrix4x4& mat) +void RAS_TexVert::TransformUV1(const MT_Matrix4x4& mat) { - SetUV((mat * MT_Vector4(m_uv1[0], m_uv1[1], 0.0, 1.0)).getValue()); + SetUV1((mat * MT_Vector4(m_uv1[0], m_uv1[1], 0.0, 1.0)).getValue()); } void RAS_TexVert::TransformUV2(const MT_Matrix4x4& mat) diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index bb151a64814..98ea4dd60aa 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -122,9 +122,11 @@ public: } void SetXYZ(const MT_Point3& xyz); - void SetXYZ(const float *xyz); - void SetUV(const MT_Point2& uv); + void SetXYZ(const float xyz[3]); + void SetUV1(const MT_Point2& uv); void SetUV2(const MT_Point2& uv); + void SetUV1(const float uv[2]); + void SetUV2(const float uv[2]); void SetRGBA(const unsigned int rgba); void SetNormal(const MT_Vector3& normal); @@ -137,7 +139,7 @@ public: void Transform(const class MT_Matrix4x4& mat, const class MT_Matrix4x4& nmat); - void TransformUV(const MT_Matrix4x4& mat); + void TransformUV1(const MT_Matrix4x4& mat); void TransformUV2(const MT_Matrix4x4& mat); // compare two vertices, to test if they can be shared, used for |