Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10181 in orxonox.OLD for branches/mount_points/src/lib/graphics


Ignore:
Timestamp:
Jan 6, 2007, 4:12:39 PM (18 years ago)
Author:
patrick
Message:

investigating the forward vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/lib/graphics/importer/static_model.cc

    r10165 r10181  
    116116
    117117      // now check if it is a mount point identifier
    118       if( (*groupIt)._faces.size() != 6) {        PRINTF(1)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n", groupName.c_str(), (*groupIt)._faces.size());
     118      if( (*groupIt)._faces.size() != 6) {
     119        PRINTF(1)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n",
     120                  groupName.c_str(), (*groupIt)._faces.size());
    119121      }
    120122
     
    158160      }
    159161
     162
     163      // now get the longest side of the first face, this will be the forward vector
     164      Vector forward;
     165      Vector side1 = vertices[0] - vertices[1];
     166      Vector side2 = vertices[1] - vertices[2];
     167      Vector side3 = vertices[2] - vertices[3];
     168
     169      if( fabs(side1.len()) > fabs(side2.len()) && fabs(side1.len()) > fabs(side3.len()))
     170        forward = side1;
     171      else if( fabs(side2.len()) > fabs(side1.len()) && fabs(side2.len()) > fabs(side3.len()))
     172        forward = side2;
     173      else if( fabs(side3.len()) > fabs(side1.len()) && fabs(side3.len()) > fabs(side2.len()))
     174        forward = side3;
     175
    160176      // now get the center of the object
    161177      Vector center;
     
    171187      PRINTF(0)("Center\n");
    172188      center.debug();
     189
     190      PRINTF(0)("Forward\n");
     191      forward.debug();
    173192
    174193    }
Note: See TracChangeset for help on using the changeset viewer.