Revision 3c4a326c
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/Cubit.java | ||
---|---|---|
233 | 233 |
|
234 | 234 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
235 | 235 |
|
236 |
Static4D returnRotationQuat(float qx,float qy,float qz)
|
|
236 |
Static4D returnRotationQuat( Static3D axis)
|
|
237 | 237 |
{ |
238 | 238 |
int pointNum = mRotationAngle.getNumPoints(); |
239 | 239 |
|
... | ... | |
244 | 244 |
double nearestAngleInRadians = nearestAngleInDegrees*Math.PI/180; |
245 | 245 |
float sinA =-(float)Math.sin(nearestAngleInRadians*0.5); |
246 | 246 |
float cosA = (float)Math.cos(nearestAngleInRadians*0.5); |
247 |
return new Static4D(qx*sinA, qy*sinA, qz*sinA, cosA);
|
|
247 |
return new Static4D( axis.get0()*sinA, axis.get1()*sinA, axis.get2()*sinA, cosA);
|
|
248 | 248 |
} |
249 | 249 |
|
250 | 250 |
return null; |
Also available in: Unified diff
More work on making new types of RubikObjects easily creatable.