We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3c2674 commit 8832ee1Copy full SHA for 8832ee1
3Dev/src/Camera.cpp
@@ -146,10 +146,11 @@ rp3d::Quaternion Camera::GetOrientation()
146
147
rp3d::Vector2 Camera::WorldPositionToScreen(const rp3d::Vector3& world)
148
{
149
- auto asdf = (m->GetView() * glm::vec4(toglm(world), 1.0));
150
- if(asdf.z > 0.0) return { -1000, -1000 };
151
- std::cout << asdf.x << " " << asdf.y << " " << asdf.z << " " << asdf.w << std::endl;
152
- auto clipSpace = m->GetProjection() * m->GetView() * glm::vec4(toglm(world), 1.0);
+ auto viewSpace = (m->GetView() * glm::vec4(toglm(world), 1.0));
+ if(viewSpace.z > 0.0)
+ return { -1000, -1000 };
+
153
+ auto clipSpace = m->GetProjection() * viewSpace;
154
if(clipSpace.w == 0.0)
155
return { -1000, -1000 };
156
0 commit comments