Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9742


Ignore:
Timestamp:
Nov 4, 2013, 3:41:53 PM (11 years ago)
Author:
wroennin
Message:

HUDRadar: set detectionrange to 10000; Math.cc: get3DProjection transformation changed

Location:
code/branches/radarDreiD/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/radarDreiD/src/libraries/util/Math.cc

    r9740 r9742  
    223223
    224224        xinvtransform.x =  (myside.y      * myorthonormal.z - myorthonormal.y * myside.z       )*invdet;
    225         xinvtransform.y = -(mydirection.y * myorthonormal.z - mydirection.z   * myorthonormal.y)*invdet;
    226         xinvtransform.z =  (mydirection.y * myside.z        - mydirection.z   * myside.y       )*invdet;
    227         yinvtransform.x = -(myside.x      * myorthonormal.z - myside.z        * myorthonormal.x)*invdet;
     225        yinvtransform.x = -(mydirection.y * myorthonormal.z - mydirection.z   * myorthonormal.y)*invdet;
     226        zinvtransform.x =  (mydirection.y * myside.z        - mydirection.z   * myside.y       )*invdet;
     227        xinvtransform.y = -(myside.x      * myorthonormal.z - myside.z        * myorthonormal.x)*invdet;
    228228        yinvtransform.y =  (mydirection.x * myorthonormal.z - mydirection.z   * myorthonormal.x)*invdet;
    229         yinvtransform.z = -(mydirection.x * myside.z        - myside.x        * mydirection.z  )*invdet;
    230         zinvtransform.x =  (myside.x      * myorthonormal.y - myorthonormal.x * myside.y       )*invdet;
    231         zinvtransform.y = -(mydirection.x * myorthonormal.y - myorthonormal.x * mydirection.y  )*invdet;
     229        zinvtransform.y = -(mydirection.x * myside.z        - myside.x        * mydirection.z  )*invdet;
     230        xinvtransform.z =  (myside.x      * myorthonormal.y - myorthonormal.x * myside.y       )*invdet;
     231        yinvtransform.z = -(mydirection.x * myorthonormal.y - myorthonormal.x * mydirection.y  )*invdet;
    232232        zinvtransform.z =  (mydirection.x * myside.y        - myside.x        * mydirection.x  )*invdet;
    233233
     
    237237        distance.z = (xinvtransform.z + yinvtransform.z + zinvtransform.z) * distance.z;
    238238
     239        // cap vector for map
     240        distance.x = clamp<float>(distance.x, -detectionlimit/5, detectionlimit/5);
     241        distance.y = clamp<float>(distance.y, -detectionlimit/5, detectionlimit/5);
     242        distance.z = clamp<float>(distance.z, -detectionlimit/5, detectionlimit/5);
     243        float distancelength = distance.length();
     244        distance = distance / distancelength;
     245
    239246        // project vector for the rotated 3DMap on screen
    240         float xcoordinate = distance.y/(2*detectionlimit);
    241         float ycoordinate = (distance.x*sin(mapangle)+distance.z*cos(mapangle))/(2*detectionlimit);
     247        float xcoordinate = distance.y;
     248        float ycoordinate = (distance.x*sin(mapangle)+distance.z*cos(mapangle));
    242249        return orxonox::Vector2(xcoordinate , ycoordinate);
    243250    }
  • code/branches/radarDreiD/src/modules/overlays/hud/HUDRadar.cc

    r9740 r9742  
    6464        this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png";
    6565        this->shapeMaterials_[RadarViewable::Square]   = "RadarSquare.png";
    66         this->setDetectionLimit( 3000.0f );
     66        this->setDetectionLimit( 10000.0f );
    6767        this->owner_ = 0;
    6868    }
Note: See TracChangeset for help on using the changeset viewer.