Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 2:17:39 PM (14 years ago)
Author:
kmaurus
Message:

Reflectin improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.cc

    r8244 r8279  
    222222        if( item->getVelocity().dotProduct(normal) > 0 ) // greife nur ein, falls
    223223        {
     224            float dampingFactor = 0.5;
     225       
    224226            normal.normalise();
    225227            Vector3 velocity = item->getVelocity();
     
    229231            /*
    230232            Vector3 rotationAxis = velocity.crossProduct(normal);
    231             Ogre::Radian angle = velocity.angleBetween(normal);
     233            Ogre::Radian angle = 2 * velocity.angleBetween(normal);
    232234            item->setOrientation(Ogre::Quaternion::Quaternion(angle, rotationAxis));
    233235            */
    234             item->setAcceleration(acceleration);
    235             item->setVelocity(velocity);
     236            /*
     237            Ogre::Quaternion orientation = item->getOrientation();
     238            orientation = -1.0 * orientation;
     239            item->setOrientation(orientation);
     240            */
     241            //item->setOrientation(item->getOrientation().UnitInverse() );
     242           
     243            item->lookAt( velocity + this->getPosition() );
     244
     245            item->setAcceleration(acceleration * dampingFactor);
     246            item->setVelocity(velocity * dampingFactor);
    236247        }
    237248    }
Note: See TracChangeset for help on using the changeset viewer.