Ignore:
Timestamp:
11/27/20 20:54:50 (4 years ago)
Author:
Maciej Komosinski
Message:
  • fS: comma as an intuitive separator in genotype instead of weird symbols ;'
  • other minor refactorizations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genooperators.cpp

    r1023 r1032  
    455455        return isupper(firstchar) || firstchar == '|' || firstchar == '@' || firstchar == '*';
    456456}
    457 
    458 double GenoOperators::calculateSolidVolume(Part * part)
    459 {
    460         double radiiProduct = part->scale.x * part->scale.y * part->scale.z;
    461         switch (part->shape)
    462         {
    463         case Part::Shape::SHAPE_CUBOID:
    464                 return 8.0 * radiiProduct;
    465         case Part::Shape::SHAPE_CYLINDER:
    466                 return  2.0 * M_PI * radiiProduct;
    467         case Part::Shape::SHAPE_ELLIPSOID:
    468                 return  (4.0 / 3.0) * M_PI * radiiProduct;
    469         default:
    470                 logMessage("GenoOperators", "calculateSolidVolume", LOG_ERROR, "Unsupported part shape");
    471                 return -1;
    472         }
    473 }
Note: See TracChangeset for help on using the changeset viewer.