using only the neeeded number of vertex positions

This commit is contained in:
devZoGok
2024-08-19 18:23:09 +03:00
parent 6ce16b0837
commit 19990e48f4
8 changed files with 145 additions and 72 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ namespace vb01{
bool skip = false;
for(int j = 0; j < 3; j++){
Vector3 rayPosToVert = (vertices[i * 3 + j].pos - rayPos);
Vector3 rayPosToVert = (*(vertices[i * 3 + j].pos) - rayPos);
float angle = rayDir.getAngleBetween(rayPosToVert.norm());
if(angle > PI / 2) angle = PI - angle;
@@ -58,7 +58,7 @@ namespace vb01{
if(skip) continue;
}
Vector3 pointA = pos + rot * vertices[indices[i * 3]].pos, pointB = pos + rot * vertices[indices[i * 3 + 1]].pos, pointC = pos + rot * vertices[indices[i * 3 + 2]].pos;
Vector3 pointA = pos + rot * *(vertices[indices[i * 3]].pos), pointB = pos + rot * *(vertices[indices[i * 3 + 1]].pos), pointC = pos + rot * *(vertices[indices[i * 3 + 2]].pos);
Vector3 hypVec = pointA - rayPos;
Vector3 perpVec = (pointB - pointA).cross(pointC - pointA).norm();
float a1 = hypVec.norm().getAngleBetween(perpVec);