// ************************************************************************************************************************
// Ruined Shack (Joined HFs) - Creates Shack_Object at <0,0,0>-<1,1,1>?
//    Input: Shack_No  (1)
// ************************************************************************************************************************
#declare HF_Shack_Object = 
   #if (Shapes_On=1)
      height_field {
         #switch (Shack_No)
            #case (1) jpeg "_Shack1.jpg" #break
            #case (2) jpeg "_Shack2.jpg" #break
         #end
         smooth water_level 60/255}
   #else
      box { <0,0,0> <1,1,1> }
   #end
#declare Shack_Scaling =
   transform {translate -0.5 rotate x*-90 scale <1.0,1,0.017> translate z*-0.50 }
#declare Shack_Transform =
   transform {
      translate y*0.4
      // scale 10
      //translate x*-10
      //translate y*-5
   }
// "Regular" HF and Regular Texture
#declare Shack_Side =
   object {HF_Shack_Object
      transform Shack_Scaling
      #if (Images_On)
         pigment {image_map {
            #switch (Shack_No)
               #case (1) jpeg "_Shack2.jpg" #break
               #case (2) jpeg "_Shack3.jpg" #break
            #end
            interpolate 2.0 map_type 0 }
            rotate x*90
            transform Shack_Scaling
            }
      #else
         pigment {color (Brown+White)/2}
      #end
      finish {ambient 0.15 reflection 0.0 /* roughness 0.4 crand 0.2 */ }
      // normal {bump_map {jpeg "_Shack2.jpg" bump_size 10} rotate x*90 transform Shack_Scaling scale <1,1,10> accuracy 1e-9} 
      // #if (Normals_On=1) normal {bump_map {jpeg "_Shack2.jpg" bump_size 2 } transform Shack_Scaling} #end // Self-Normal
      // #if (Normals_On=1) normal {agate 0.2 scale 0.02 } #end
      }

// Ruined Shack
#declare Shack_Object =
   union {
      // Front Side
      object {Shack_Side transform Shack_Transform}
      // Left Side
      object {Shack_Side scale <-1,1,1> rotate y*90 transform Shack_Transform}
      // Back Side
      object {Shack_Side rotate y*180 transform Shack_Transform}
      // Right Side
      object {Shack_Side scale <-1,1,1> rotate y*270 transform Shack_Transform }
      // translate y*-1.4
   }

   #declare HF_Saloon_Object = HF_Saloon()
   object {HF_Saloon_Object // original size: 493x460 
//    scale <11,6.45/1.07,9.4> 
//    translate <-34,-2.80,-41> 
//    translate <0,0.75+2,0> 
      }
