Skip to content

Commit

Permalink
Modify default camera settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-Shen0527 committed Apr 17, 2024
1 parent 467d462 commit e4ff6b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Framework3D/source/GUI/free_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ std::pair<bool, pxr::GfMatrix4f> FirstPersonCamera::AnimateRoll(pxr::GfMatrix4f

void FirstPersonCamera::Animate(float deltaT)
{
SetPerspectiveFromAspectRatioAndFieldOfView(
m_ViewportSize[0] / m_ViewportSize[1], 130/2, FOVHorizontal);
// track mouse delta
pxr::GfVec2f mouseMove = mousePos - mousePosPrev;
mousePosPrev = mousePos;
Expand Down Expand Up @@ -168,6 +170,9 @@ void FirstPersonCamera::Animate(float deltaT)

void FirstPersonCamera::AnimateSmooth(float deltaT)
{
SetPerspectiveFromAspectRatioAndFieldOfView(
m_ViewportSize[0] / m_ViewportSize[1], 130/2, FOVHorizontal);

const float c_DampeningRate = 7.5f;
float dampenWeight = exp(-c_DampeningRate * deltaT);

Expand Down
2 changes: 1 addition & 1 deletion Framework3D/source/RCore/hd_USTC_CG/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ bool Integrator::Intersect(const GfRay& ray, SurfaceInteraction& si)
texcoord = { 0.5, 0.5 };
}

si.geometricNormal = shadingNormal;
si.geometricNormal = geometricNormal;
si.shadingNormal = shadingNormal;
si.position = hitPos;
si.barycentric = { rayHit.hit.u, rayHit.hit.v };
Expand Down

0 comments on commit e4ff6b3

Please sign in to comment.