Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2013, 8:06:44 PM (11 years ago)
Author:
jo
Message:

Adding most of the changes that were proposed in the release2012 branch.

File:
1 edited

Legend:

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

    r9667 r9941  
    117117        this->billboards_[current].usedYet = true;
    118118
    119         Vector3 directionVector = (this->getPosition() - position).normalisedCopy(); // vector from the position of the billboard to the center of the sphere
     119        Vector3 directionVector = (this->getWorldPosition() - position).normalisedCopy(); // vector from the position of the billboard to the center of the sphere
    120120        this->billboards_[current].billy->setCommonDirection(directionVector);
    121121
     
    252252        if(item != NULL)
    253253        {
    254             Vector3 itemPosition = item->getPosition();
    255             return (itemPosition.distance(this->getPosition()));
     254            Vector3 itemPosition = item->getWorldPosition();
     255            return (itemPosition.distance(this->getWorldPosition()));
    256256        } else {
    257257            return -1;
     
    267267    {
    268268
    269         Vector3 direction = item->getPosition() - this->getPosition();
     269        Vector3 direction = item->getWorldPosition() - this->getWorldPosition();
    270270        direction.normalise();
    271271
    272         Vector3 boundaryPosition = this->getPosition() + direction * this->maxDistance_;
     272        Vector3 boundaryPosition = this->getWorldPosition() + direction * this->maxDistance_;
    273273
    274274        this->positionBillboard(boundaryPosition, alpha);
     
    277277    void SpaceBoundaries::conditionalBounceBack(Pawn *item, float currentDistance, float dt)
    278278    {
    279         Vector3 normal = item->getPosition() - this->getPosition();
     279        Vector3 normal = item->getWorldPosition() - this->getWorldPosition();
    280280        normal.normalise();
    281281        Vector3 velocity = item->getVelocity();
     
    300300        acceleration = acceleration.reflect(*normal);
    301301
    302         item->lookAt( *velocity + this->getPosition() );
     302        item->lookAt( *velocity + this->getWorldPosition() );
    303303
    304304        item->setAcceleration(acceleration * dampingFactor);
    305305        item->setVelocity(*velocity * dampingFactor);
    306306
    307         item->setPosition( item->getPosition() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary.
     307        item->setPosition( item->getWorldPosition() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary.
    308308    }
    309309
Note: See TracChangeset for help on using the changeset viewer.