Skip to content

Commit 06e18ba

Browse files
committed
- cleanup some code
- glfw fps limit
1 parent 77298f1 commit 06e18ba

File tree

15 files changed

+55
-52
lines changed

15 files changed

+55
-52
lines changed

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.1.4
2+
- cleanup some code
3+
- glfw fps limit
4+
15
2.1.3
26
- fixed compilation on macOS thanks to Robin Rademacher
37

Demos/CouplingDemos/RigidBodyClothCouplingDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
215215
}
216216
for (unsigned int i = 0; i < nFaces; i++)
217217
{
218-
// Reduce the indices by one
219218
int posIndices[3];
220219
int texIndices[3];
221220
for (int j = 0; j < 3; j++)
222221
{
223-
posIndices[j] = faces[i].posIndices[j] - 1;
222+
posIndices[j] = faces[i].posIndices[j];
224223
if (nTexCoords > 0)
225224
{
226-
texIndices[j] = faces[i].texIndices[j] - 1;
225+
texIndices[j] = faces[i].texIndices[j];
227226
mesh.addUVIndex(texIndices[j]);
228227
}
229228
}

Demos/DistanceFieldDemos/ClothCollisionDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
189189
}
190190
for (unsigned int i = 0; i < nFaces; i++)
191191
{
192-
// Reduce the indices by one
193192
int posIndices[3];
194193
int texIndices[3];
195194
for (int j = 0; j < 3; j++)
196195
{
197-
posIndices[j] = faces[i].posIndices[j] - 1;
196+
posIndices[j] = faces[i].posIndices[j];
198197
if (nTexCoords > 0)
199198
{
200-
texIndices[j] = faces[i].texIndices[j] - 1;
199+
texIndices[j] = faces[i].texIndices[j];
201200
mesh.addUVIndex(texIndices[j]);
202201
}
203202
}

Demos/DistanceFieldDemos/DeformableCollisionDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
174174
}
175175
for (unsigned int i = 0; i < nFaces; i++)
176176
{
177-
// Reduce the indices by one
178177
int posIndices[3];
179178
int texIndices[3];
180179
for (int j = 0; j < 3; j++)
181180
{
182-
posIndices[j] = faces[i].posIndices[j] - 1;
181+
posIndices[j] = faces[i].posIndices[j];
183182
if (nTexCoords > 0)
184183
{
185-
texIndices[j] = faces[i].texIndices[j] - 1;
184+
texIndices[j] = faces[i].texIndices[j];
186185
mesh.addUVIndex(texIndices[j]);
187186
}
188187
}

Demos/DistanceFieldDemos/RigidBodyCollisionDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
172172
}
173173
for (unsigned int i = 0; i < nFaces; i++)
174174
{
175-
// Reduce the indices by one
176175
int posIndices[3];
177176
int texIndices[3];
178177
for (int j = 0; j < 3; j++)
179178
{
180-
posIndices[j] = faces[i].posIndices[j] - 1;
179+
posIndices[j] = faces[i].posIndices[j];
181180
if (nTexCoords > 0)
182181
{
183-
texIndices[j] = faces[i].texIndices[j] - 1;
182+
texIndices[j] = faces[i].texIndices[j];
184183
mesh.addUVIndex(texIndices[j]);
185184
}
186185
}

Demos/GenericConstraintsDemos/GenericRigidBodyConstraintsDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
162162
}
163163
for (unsigned int i = 0; i < nFaces; i++)
164164
{
165-
// Reduce the indices by one
166165
int posIndices[3];
167166
int texIndices[3];
168167
for (int j = 0; j < 3; j++)
169168
{
170-
posIndices[j] = faces[i].posIndices[j] - 1;
169+
posIndices[j] = faces[i].posIndices[j];
171170
if (nTexCoords > 0)
172171
{
173-
texIndices[j] = faces[i].texIndices[j] - 1;
172+
texIndices[j] = faces[i].texIndices[j];
174173
mesh.addUVIndex(texIndices[j]);
175174
}
176175
}

Demos/RigidBodyDemos/ChainDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
158158
}
159159
for (unsigned int i = 0; i < nFaces; i++)
160160
{
161-
// Reduce the indices by one
162161
int posIndices[3];
163162
int texIndices[3];
164163
for (int j = 0; j < 3; j++)
165164
{
166-
posIndices[j] = faces[i].posIndices[j] - 1;
165+
posIndices[j] = faces[i].posIndices[j];
167166
if (nTexCoords > 0)
168167
{
169-
texIndices[j] = faces[i].texIndices[j] - 1;
168+
texIndices[j] = faces[i].texIndices[j];
170169
mesh.addUVIndex(texIndices[j]);
171170
}
172171
}

Demos/RigidBodyDemos/JointDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
207207
}
208208
for (unsigned int i = 0; i < nFaces; i++)
209209
{
210-
// Reduce the indices by one
211210
int posIndices[3];
212211
int texIndices[3];
213212
for (int j = 0; j < 3; j++)
214213
{
215-
posIndices[j] = faces[i].posIndices[j] - 1;
214+
posIndices[j] = faces[i].posIndices[j];
216215
if (nTexCoords > 0)
217216
{
218-
texIndices[j] = faces[i].texIndices[j] - 1;
217+
texIndices[j] = faces[i].texIndices[j];
219218
mesh.addUVIndex(texIndices[j]);
220219
}
221220
}

Demos/SceneLoaderDemo/SceneLoaderDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
327327
}
328328
for (unsigned int i = 0; i < nFaces; i++)
329329
{
330-
// Reduce the indices by one
331330
int posIndices[3];
332331
int texIndices[3];
333332
for (int j = 0; j < 3; j++)
334333
{
335-
posIndices[j] = faces[i].posIndices[j] - 1;
334+
posIndices[j] = faces[i].posIndices[j];
336335
if (nTexCoords > 0)
337336
{
338-
texIndices[j] = faces[i].texIndices[j] - 1;
337+
texIndices[j] = faces[i].texIndices[j];
339338
mesh.addUVIndex(texIndices[j]);
340339
}
341340
}

Demos/StiffRodsDemos/DirectPositionBasedSolverForStiffRodsDemo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,14 @@ void loadObj(const std::string &filename, VertexData &vd, IndexedFaceMesh &mesh,
339339
}
340340
for (unsigned int i = 0; i < nFaces; i++)
341341
{
342-
// Reduce the indices by one
343342
int posIndices[3];
344343
int texIndices[3];
345344
for (int j = 0; j < 3; j++)
346345
{
347-
posIndices[j] = faces[i].posIndices[j] - 1;
346+
posIndices[j] = faces[i].posIndices[j];
348347
if (nTexCoords > 0)
349348
{
350-
texIndices[j] = faces[i].texIndices[j] - 1;
349+
texIndices[j] = faces[i].texIndices[j];
351350
mesh.addUVIndex(texIndices[j]);
352351
}
353352
}

0 commit comments

Comments
 (0)