Skip to content

Commit 013656a

Browse files
authored
Merge pull request gameprogcpp#40 from chalonverse/master
Fixed bug where SegmentCast did not update closestT
2 parents 504096e + e74685c commit 013656a

5 files changed

Lines changed: 5 additions & 0 deletions

File tree

Chapter10/PhysWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool PhysWorld::SegmentCast(const LineSegment& l, CollisionInfo& outColl)
3333
// Is this closer than previous intersection?
3434
if (t < closestT)
3535
{
36+
closestT = t;
3637
outColl.mPoint = l.PointOnSegment(t);
3738
outColl.mNormal = norm;
3839
outColl.mBox = box;

Chapter11/PhysWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool PhysWorld::SegmentCast(const LineSegment& l, CollisionInfo& outColl)
3333
// Is this closer than previous intersection?
3434
if (t < closestT)
3535
{
36+
closestT = t;
3637
outColl.mPoint = l.PointOnSegment(t);
3738
outColl.mNormal = norm;
3839
outColl.mBox = box;

Chapter12/PhysWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool PhysWorld::SegmentCast(const LineSegment& l, CollisionInfo& outColl)
3333
// Is this closer than previous intersection?
3434
if (t < closestT)
3535
{
36+
closestT = t;
3637
outColl.mPoint = l.PointOnSegment(t);
3738
outColl.mNormal = norm;
3839
outColl.mBox = box;

Chapter13/PhysWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool PhysWorld::SegmentCast(const LineSegment& l, CollisionInfo& outColl)
3333
// Is this closer than previous intersection?
3434
if (t < closestT)
3535
{
36+
closestT = t;
3637
outColl.mPoint = l.PointOnSegment(t);
3738
outColl.mNormal = norm;
3839
outColl.mBox = box;

Chapter14/PhysWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool PhysWorld::SegmentCast(const LineSegment& l, CollisionInfo& outColl)
3333
// Is this closer than previous intersection?
3434
if (t < closestT)
3535
{
36+
closestT = t;
3637
outColl.mPoint = l.PointOnSegment(t);
3738
outColl.mNormal = norm;
3839
outColl.mBox = box;

0 commit comments

Comments
 (0)