Skip to content

Commit 8832ee1

Browse files
committed
Bruh
1 parent a3c2674 commit 8832ee1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

3Dev/src/Camera.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ rp3d::Quaternion Camera::GetOrientation()
146146

147147
rp3d::Vector2 Camera::WorldPositionToScreen(const rp3d::Vector3& world)
148148
{
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);
149+
auto viewSpace = (m->GetView() * glm::vec4(toglm(world), 1.0));
150+
if(viewSpace.z > 0.0)
151+
return { -1000, -1000 };
152+
153+
auto clipSpace = m->GetProjection() * viewSpace;
153154
if(clipSpace.w == 0.0)
154155
return { -1000, -1000 };
155156

0 commit comments

Comments
 (0)