~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/itasc/kdl/joint.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    {
56
56
    }
57
57
 
58
 
    Frame Joint::pose(const double& q)const
 
58
    Frame Joint::pose(const double* q)const
59
59
    {
60
60
 
61
61
        switch(type){
62
62
        case RotX:
63
 
            return Frame(Rotation::RotX(scale*q+offset));
 
63
                        assert(q);
 
64
            return Frame(Rotation::RotX(scale*q[0]+offset));
64
65
            break;
65
66
        case RotY:
66
 
            return  Frame(Rotation::RotY(scale*q+offset));
 
67
                        assert(q);
 
68
            return  Frame(Rotation::RotY(scale*q[0]+offset));
67
69
            break;
68
70
        case RotZ:
69
 
            return  Frame(Rotation::RotZ(scale*q+offset));
 
71
                        assert(q);
 
72
            return  Frame(Rotation::RotZ(scale*q[0]+offset));
70
73
            break;
71
74
        case TransX:
72
 
            return  Frame(Vector(scale*q+offset,0.0,0.0));
 
75
                        assert(q);
 
76
            return  Frame(Vector(scale*q[0]+offset,0.0,0.0));
73
77
            break;
74
78
        case TransY:
75
 
            return Frame(Vector(0.0,scale*q+offset,0.0));
 
79
                        assert(q);
 
80
            return Frame(Vector(0.0,scale*q[0]+offset,0.0));
76
81
            break;
77
82
        case TransZ:
78
 
            return Frame(Vector(0.0,0.0,scale*q+offset));
 
83
                        assert(q);
 
84
            return Frame(Vector(0.0,0.0,scale*q[0]+offset));
79
85
            break;
80
86
                case Sphere:
81
87
                        // the joint angles represent a rotation vector expressed in the base frame of the joint
82
88
                        // (= the frame you get when there is no offset nor rotation)
83
 
                        return Frame(Rot(Vector((&q)[0], (&q)[1], (&q)[2])));
 
89
                        assert(q);
 
90
                        return Frame(Rot(Vector(q[0], q[1], q[2])));
84
91
                        break;
85
92
                case Swing:
86
93
                        // the joint angles represent a 2D rotation vector in the XZ planee of the base frame of the joint
87
94
                        // (= the frame you get when there is no offset nor rotation)
88
 
                        return Frame(Rot(Vector((&q)[0], 0.0, (&q)[1])));
 
95
                        assert(q);
 
96
                        return Frame(Rot(Vector(q[0], 0.0, q[1])));
89
97
                        break;
90
98
        default:
91
99
            return Frame::Identity();