Dividing 3D Space into an Octree

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 2

  • @NoTimeLeft_
    @NoTimeLeft_ 2 ปีที่แล้ว

    I noticed you divided by 2 and four instead of multiplying by .5 and .25.
    Why is that? Division is more expensive in C#. I understand what we're doing is already expensive so, should we save performance wherever possible?

    • @StevenBloomfield
      @StevenBloomfield 2 ปีที่แล้ว +2

      It's likely done to show you in an easier way to understand, leaving optimizations like that out of it. But I think the C# compiler probably does that optimization for you when dividing by a constant.