Skip to content

Commit d148aa1

Browse files
committed
raytrace: Do not copy vectors if not needed
1 parent 2fdfa73 commit d148aa1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

raytrace/raytrace.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,14 +719,12 @@ float RayTracingEnvironment::CalculateCostsOfSplit(
719719
split_value=min_coord;
720720

721721
// now, perform surface area/cost check to determine whether this split was worth it
722-
Vector LeftMins=MinBound;
723722
Vector LeftMaxes=MaxBound;
724723
Vector RightMins=MinBound;
725-
Vector RightMaxes=MaxBound;
726724
LeftMaxes[split_plane]=split_value;
727725
RightMins[split_plane]=split_value;
728-
float SA_L=BoxSurfaceArea(LeftMins,LeftMaxes);
729-
float SA_R=BoxSurfaceArea(RightMins,RightMaxes);
726+
float SA_L=BoxSurfaceArea(MinBound,LeftMaxes);
727+
float SA_R=BoxSurfaceArea(RightMins,MaxBound);
730728
float ISA=1.0f/BoxSurfaceArea(MinBound,MaxBound);
731729
float cost_of_split=COST_OF_TRAVERSAL+COST_OF_INTERSECTION*(nboth+
732730
(SA_L*ISA*(nleft))+(SA_R*ISA*(nright)));

0 commit comments

Comments
 (0)