POV-Ray : Newsgroups : povray.beta-test : Possible error in 3.7.0 beta CSG Merge code Server Time
7 Jul 2024 07:09:31 EDT (-0400)
  Possible error in 3.7.0 beta CSG Merge code (Message 1 to 1 of 1)  
From: clipka
Subject: Possible error in 3.7.0 beta CSG Merge code
Date: 6 May 2009 17:30:00
Message: <web.4a020031206818ac53a485b50@news.povray.org>
I just stumbled across this strange code in CSGMerge::All_Intersections():

-----------------
  ...
  int shadow_flag = ray.IsShadowTestRay();

  for(vector<ObjectPtr>::iterator Sib1 = children.begin(); Sib1 !=
children.end(); Sib1++)
  {
    if ( Test_Ray_Flags_Shadow(ray, (*Sib1)) )
    {
    ...
-----------------

What worries me is this:

- The shadow_flag variable is set but never used.

- The CSGUnion::All_Intersections() code uses Test_Ray_Flags() instead of
Test_Ray_Flags_Shadow()

(The Test_Ray_Flags_Shadow() appears once again further inside the loop of
CSGMerge::All_Intersections().)

This leads me to believe that the code should actually use
Test_Ray_Flags_Shadow() only if shadow_flag is true, but Test_Ray_Flags()
otherwise.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.