14 m_position = position;
15 m_weightsData = weightsData;
32 return m_textureIndex != -1 && m_normalIndex != -1;
35 bool hasSameTextureAndNormal(
int textureIndexOther,
int normalIndexOther) {
36 return textureIndexOther == m_textureIndex && normalIndexOther == m_normalIndex;
39 void setTextureIndex(
int textureIndex) {
40 m_textureIndex = textureIndex;
43 void setNormalIndex(
int normalIndex) {
44 m_normalIndex = normalIndex;
51 int getTextureIndex() {
52 return m_textureIndex;
55 int getNormalIndex() {
59 Vertex* getDuplicateVertex() {
60 return m_duplicateVertex;
63 void setDuplicateVertex(
Vertex* duplicateVertex) {
64 m_duplicateVertex = duplicateVertex;
71 void addTangent(
vec3 tangent) {
72 m_tangents.push_back(tangent);
75 void averageTangents() {
76 if (m_tangents.empty()) {
79 for (
vec3 tangent : m_tangents) {
80 m_avgTangent += tangent;
82 m_avgTangent.Normalize();
85 const vec3& getAvgTangent()
const {
92 int m_textureIndex = -1;
93 int m_normalIndex = -1;
95 Vertex* m_duplicateVertex =
nullptr;
100 std::vector<vec3> m_tangents;
101 vec3 m_avgTangent =
vec3{ 0, 0, 0 };