Revision 84e9dcc2
Added by Leszek Koltunski 6 days ago
src/main/java/org/distorted/library/helpers/QuatHelper.java | ||
---|---|---|
75 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
76 | 76 |
// return quat1*(rx,ry,rz,rw) |
77 | 77 |
|
78 |
public static Static4D quatMultiply( Static4D quat1, float rx, float ry, float rz, float rw )
|
|
78 |
public static Static4D quatMultiply( Static4D quat, float rx, float ry, float rz, float rw ) |
|
79 | 79 |
{ |
80 |
float qx = quat1.get0();
|
|
81 |
float qy = quat1.get1();
|
|
82 |
float qz = quat1.get2();
|
|
83 |
float qw = quat1.get3();
|
|
80 |
float qx = quat.get0(); |
|
81 |
float qy = quat.get1(); |
|
82 |
float qz = quat.get2(); |
|
83 |
float qw = quat.get3(); |
|
84 | 84 |
|
85 | 85 |
float tx = rw*qx - rz*qy + ry*qz + rx*qw; |
86 | 86 |
float ty = rw*qy + rz*qx + ry*qw - rx*qz; |
... | ... | |
91 | 91 |
} |
92 | 92 |
|
93 | 93 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
94 |
// return (qx,qy,qz,qw)*quat2
|
|
94 |
// return (qx,qy,qz,qw)*quat |
|
95 | 95 |
|
96 |
public static Static4D quatMultiply( float qx, float qy, float qz, float qw, Static4D quat2 )
|
|
96 |
public static Static4D quatMultiply( float qx, float qy, float qz, float qw, Static4D quat ) |
|
97 | 97 |
{ |
98 |
float rx = quat2.get0();
|
|
99 |
float ry = quat2.get1();
|
|
100 |
float rz = quat2.get2();
|
|
101 |
float rw = quat2.get3();
|
|
98 |
float rx = quat.get0(); |
|
99 |
float ry = quat.get1(); |
|
100 |
float rz = quat.get2(); |
|
101 |
float rw = quat.get3(); |
|
102 | 102 |
|
103 | 103 |
float tx = rw*qx - rz*qy + ry*qz + rx*qw; |
104 | 104 |
float ty = rw*qy + rz*qx + ry*qw - rx*qz; |
Also available in: Unified diff
push objectRatio up from TwistyObjectControllable to the last layer.