the camera rotates with the thing yo wt
This commit is contained in:
@@ -40,7 +40,7 @@ RayField RaySource::getInitialRays(bool MSAA)
|
||||
const float aspect = mReferenceCamera->getRayViewport().x / mReferenceCamera->getRayViewport().y;
|
||||
float scale = tan(mReferenceCamera->FOV / 2.0f * helpers::PI / 180.0f);
|
||||
|
||||
glm::mat4 cameraToWorld = mReferenceCamera->getViewMatrix();
|
||||
glm::mat4 cameraToWorld = mReferenceCamera->getCameraLook();
|
||||
glm::vec3 origin = mReferenceCamera->Position;
|
||||
|
||||
for (int x = 0; x < mReferenceCamera->getRayViewport().x; x++)
|
||||
@@ -51,7 +51,7 @@ RayField RaySource::getInitialRays(bool MSAA)
|
||||
|
||||
Ray* ray = new Ray;
|
||||
ray->Origin = origin;
|
||||
ray->Direction = glm::normalize(glm::vec4(Px, Py, -1.0f, 1.0f) * cameraToWorld);
|
||||
ray->Direction = glm::normalize((glm::vec4(Px, Py, -1.0f, 1.0f) * cameraToWorld));
|
||||
|
||||
field.push_back(ray);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user