Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2014, 11:16:16 AM (11 years ago)
Author:
muemart
Message:

Fix rotation if parent is already rotated. Everything hopefully now works as expected. It's a giant mess right now, so still have to clean it up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/turretFS14/src/modules/objects/Turret.cc

    r10039 r10042  
    113113        this->localAngularAcceleration_ = physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_;
    114114
     115        //physics don't work when attached :(
     116        //this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
    115117
    116         pitch(Degree(localAngularAcceleration_.x()/10000), WorldEntity::World);
    117         yaw(Degree(localAngularAcceleration_.y()/10000), WorldEntity::World);
    118         roll(Degree(localAngularAcceleration_.z()/10000), WorldEntity::World);
     118        pitch(Degree(localAngularAcceleration_.x()*dt/1000), WorldEntity::World);
     119        yaw(Degree(localAngularAcceleration_.y()*dt/1000), WorldEntity::World);
     120        roll(Degree(localAngularAcceleration_.z()*dt/1000), WorldEntity::World);
    119121
    120122        this->localAngularAcceleration_.setValue(0, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.