Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8657 for code/branches


Ignore:
Timestamp:
May 29, 2011, 1:12:28 PM (13 years ago)
Author:
dafrick
Message:

Fixing singularity bug in SpaceBoundaries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/modules/objects/SpaceBoundaries.cc

    r8645 r8657  
    112112            Vector3 normalisedVec = (position - this->getPosition()).normalisedCopy(); /* Vektor von Kugelmitte nach aussen */
    113113            tmp->setCommonDirection ( -1.0 * normalisedVec );
    114             tmp->setCommonUpVector( Vector3::UNIT_Z );
     114            Vector3 upVector = Vector3(normalisedVec.z, normalisedVec.z, -(normalisedVec.x+normalisedVec.y));
     115            upVector.normalise();
     116            tmp->setCommonUpVector( upVector );
    115117            billboardAdministration tmp2 = { true, tmp };
    116118            this->billboards_.push_back( tmp2 );
     
    121123            Vector3 normalisedVec = (position - this->getPosition()).normalisedCopy(); /* Vektor von Kugelmitte nach aussen */
    122124            current->billy->setCommonDirection ( -1.0 * normalisedVec );
    123             current->billy->setCommonUpVector( Vector3::UNIT_Z );
     125            Vector3 upVector = Vector3(normalisedVec.z, normalisedVec.z, -(normalisedVec.x+normalisedVec.y));
     126            upVector.normalise();
     127            current->billy->setCommonUpVector( upVector );
    124128        }
    125129    }
Note: See TracChangeset for help on using the changeset viewer.