~ubuntu-branches/debian/jessie/yade/jessie

« back to all changes in this revision

Viewing changes to pkg/common/GravityEngines.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-08-04 19:34:58 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140804193458-cw8qhnujxe9wzi15
Tags: 1.11.0-1
* [a0600ae] Imported Upstream version 1.11.0
* [a3055e0] Do not use parallel build on kfreebsd-amd64 and s390x.
* [f86b405] Remove applied patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
                Vector2i a=readSysfsFile(hdapsDir+"/position");
78
78
                lastReading=now;
79
79
                a-=calibrate;
80
 
                if(abs(a[0]-accel[0])>updateThreshold) accel[0]=a[0];
81
 
                if(abs(a[1]-accel[1])>updateThreshold) accel[1]=a[1];
 
80
                if(std::abs(a[0]-accel[0])>updateThreshold) accel[0]=a[0];
 
81
                if(std::abs(a[1]-accel[1])>updateThreshold) accel[1]=a[1];
82
82
                Quaternionr trsf(AngleAxisr(.5*accel[0]*M_PI/180.,-Vector3r::UnitY())*AngleAxisr(.5*accel[1]*M_PI/180.,-Vector3r::UnitX()));
83
83
                gravity=trsf*zeroGravity;
84
84
        }