Ignore:
Timestamp:
07/20/20 16:37:38 (4 years ago)
Author:
Maciej Komosinski
Message:

fS: faster collision detection, depends on "geometry" algorithms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fS/fS_general.h

    r1006 r1017  
    5454#define RZ "rz"
    5555//@}
    56 /** @name Macros and values used in collision detection */
    57 //@{
    58 #define DISJOINT 0
    59 #define COLLISION 1
    60 #define ADJACENT 2
    61 //@}
     56
    6257
    6358#define HINGE_X 'b'
     
    8782const string ALL_JOINTS = "abc";
    8883const int JOINT_COUNT = JOINTS.length();
    89 const string MODIFIERS = "IFST";
     84const string MODIFIERS = "IFS";
    9085const char SIZE_MODIFIER = 's';
    91 const vector<string> PARAMS {INGESTION, FRICTION, ROT_X, ROT_Y, ROT_Z, RX, RY, RZ, SIZE, SIZE_X, SIZE_Y, SIZE_Z,
    92                                                          STIFFNESS};
     86const vector<string> PARAMS {INGESTION, FRICTION, ROT_X, ROT_Y, ROT_Z, RX, RY, RZ, SIZE, SIZE_X, SIZE_Y, SIZE_Z};
    9387const vector<string> SIZE_PARAMS {SIZE, SIZE_X, SIZE_Y, SIZE_Z};
    9488
     
    214208        double ing = 1.0;      /// Ingestion multiplier
    215209        double s = 1.0;      /// Size multipliers
    216         double stif = 1.0;      /// Stiffness multipliers
    217210
    218211        State(State *_state); /// Derive the state from parent
     
    272265        Part *part;     /// A part object built from node. Used in building the Model
    273266        int partCodeLen; /// The length of substring that directly describes the corresponding part
    274         std::map<string, double> defaultValues;
    275267        GenotypeParams genotypeParams;
    276268
     
    335327         * @param _state state of the parent
    336328         */
    337         void getState(State *_state);
     329        void getState(State *_state, bool calculateLocation);
    338330
    339331        /**
     
    370362
    371363public:
     364        static std::map<string, double> minValues;
     365        static std::map<string, double> defaultValues;
     366        static std::map<string, double> maxValues;
    372367        char joint = DEFAULT_JOINT;           /// Set of all joints
    373368        Part::Shape partType;  /// The type of the part
     
    389384         * @return The effective size
    390385         */
    391         Pt3D calculateSize();
     386        void calculateSize(Pt3D &scale);
    392387
    393388        /**
     
    407402         * @return the param value
    408403         */
    409         double getParam(string key);
     404        double getParam(const string &key);
     405        double getParam(const string &key, double defaultValue);
    410406};
    411407
     
    454450        ~fS_Genotype();
    455451
    456         void getState();
     452        void getState(bool calculateLocation);
    457453
    458454        /**
Note: See TracChangeset for help on using the changeset viewer.