Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_TexVert.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_TexVert.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp
index d6f1fe912be..935633dc636 100644
--- a/source/gameengine/Rasterizer/RAS_TexVert.cpp
+++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp
@@ -27,7 +27,12 @@
*/
#include "RAS_TexVert.h"
-#include "MT_Matrix4x4.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define SHORT(x) short(x*32767.0)
RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
const MT_Point2& uv,
@@ -35,7 +40,7 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
const MT_Vector4& tangent,
const unsigned int rgba,
const MT_Vector3& normal,
- const bool flat,
+ const short flag,
const unsigned int origindex)
{
xyz.getValue(m_localxyz);
@@ -44,7 +49,7 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
SetRGBA(rgba);
SetNormal(normal);
tangent.getValue(m_tangent);
- m_flag = (flat)? FLAT: 0;
+ m_flag = flag;
m_origindex = origindex;
m_unit = 2;
}
@@ -96,7 +101,7 @@ void RAS_TexVert::SetFlag(const short flag)
void RAS_TexVert::SetUnit(const unsigned int u)
{
- m_unit = u<=MAX_UNIT?u:MAX_UNIT;
+ m_unit = u<=TV_MAX?u:TV_MAX;
}
void RAS_TexVert::SetNormal(const MT_Vector3& normal)
@@ -104,18 +109,12 @@ void RAS_TexVert::SetNormal(const MT_Vector3& normal)
normal.getValue(m_normal);
}
-void RAS_TexVert::SetTangent(const MT_Vector3& tangent)
-{
- tangent.getValue(m_tangent);
-}
-
// compare two vertices, and return TRUE if both are almost identical (they can be shared)
bool RAS_TexVert::closeTo(const RAS_TexVert* other)
{
return (m_flag == other->m_flag &&
m_rgba == other->m_rgba &&
MT_fuzzyEqual(MT_Vector3(m_normal), MT_Vector3(other->m_normal)) &&
- MT_fuzzyEqual(MT_Vector3(m_tangent), MT_Vector3(other->m_tangent)) &&
MT_fuzzyEqual(MT_Vector2(m_uv1), MT_Vector2(other->m_uv1)) &&
MT_fuzzyEqual(MT_Vector2(m_uv2), MT_Vector2(other->m_uv2)) && // p --
MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))) ;
@@ -132,10 +131,11 @@ unsigned int RAS_TexVert::getUnit() const
return m_unit;
}
-void RAS_TexVert::Transform(const MT_Matrix4x4& mat, const MT_Matrix4x4& nmat)
+
+void RAS_TexVert::getOffsets(void* &xyz, void* &uv1, void* &rgba, void* &normal) const
{
- SetXYZ((mat*MT_Vector4(m_localxyz[0], m_localxyz[1], m_localxyz[2], 1.0)).getValue());
- SetNormal((nmat*MT_Vector4(m_normal[0], m_normal[1], m_normal[2], 1.0)).getValue());
- SetTangent((nmat*MT_Vector4(m_tangent[0], m_tangent[1], m_tangent[2], 1.0)).getValue());
+ xyz = (void *) m_localxyz;
+ uv1 = (void *) m_uv1;
+ rgba = (void *) &m_rgba;
+ normal = (void *) m_normal;
}
-