Skip to content

Commit

Permalink
Fix hit point displacement calculation resulting from animation (#339)
Browse files Browse the repository at this point in the history
Remove unnecessary scale vector multiplication
  • Loading branch information
msz-rai authored Oct 17, 2024
1 parent f859bba commit 756eb12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gpu/optixPrograms.cu
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ extern "C" __global__ void __closesthit__()
const Vec3f& vA = objectToWorld.rotation() * entityData.vertexDisplacementSincePrevFrame[triangleIndices.x()];
const Vec3f& vB = objectToWorld.rotation() * entityData.vertexDisplacementSincePrevFrame[triangleIndices.y()];
const Vec3f& vC = objectToWorld.rotation() * entityData.vertexDisplacementSincePrevFrame[triangleIndices.z()];
displacementFromSkinning = objectToWorld.scaleVec() * Vec3f((1 - u - v) * vA + u * vB + v * vC);
displacementFromSkinning = Vec3f((1 - u - v) * vA + u * vB + v * vC);
}

absPointVelocity = (displacementFromTransformChange + displacementFromSkinning) /
Expand Down

0 comments on commit 756eb12

Please sign in to comment.