Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 18, 2013, 4:22:09 PM (11 years ago)
Author:
wroennin
Message:

Math.cc: new function isObjectHigherThanShipOnMap, separated coordinatetransformation into a seperate function; Math.h: updated with new functions; HUDRadar.cc: added zOrder for rendering on screen; radar3D_test.oxw: canged spawn direction to 0,0,0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/radarDreiD/src/modules/overlays/hud/HUDRadar.cc

    r9787 r9792  
    166166            // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
    167167            float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     168
     169
    168170            it->second->setDimensions(size, size);
    169171
     
    171173            //Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
    172174            Vector2 coord = get3DProjection(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), 0.6435011, detectionLimit_);
    173             if(coord.y < 0)
    174                 {
    175                 orxonox::ColourValue color = it->second->getColour();
    176                 color.a = 0.5f;
    177                 it->second->setColour(color);
    178                 }
     175
     176            // set zOrder on screen
     177            bool overXZPlain = isObjectHigherThanShipOnMap(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), 0.6435011);
     178
     179            if(overXZPlain == false && (it->second->getZOrder() >  100 * this->overlay_->getZOrder())) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay
     180                it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 1);
     181            if(overXZPlain == true && (it->second->getZOrder() <= 100 * this->overlay_->getZOrder()))
     182                it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 1);
     183
     184
    179185
    180186            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
Note: See TracChangeset for help on using the changeset viewer.