| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 // decompose the matrix into its component parts | 248 // decompose the matrix into its component parts |
| 249 typedef struct { | 249 typedef struct { |
| 250 double scaleX, scaleY, scaleZ; | 250 double scaleX, scaleY, scaleZ; |
| 251 double skewXY, skewXZ, skewYZ; | 251 double skewXY, skewXZ, skewYZ; |
| 252 double quaternionX, quaternionY, quaternionZ, quaternionW; | 252 double quaternionX, quaternionY, quaternionZ, quaternionW; |
| 253 double translateX, translateY, translateZ; | 253 double translateX, translateY, translateZ; |
| 254 double perspectiveX, perspectiveY, perspectiveZ, perspectiveW; | 254 double perspectiveX, perspectiveY, perspectiveZ, perspectiveW; |
| 255 } DecomposedType; | 255 } DecomposedType; |
| 256 | 256 |
| 257 bool decompose(DecomposedType& decomp) const; | 257 bool decompose(DecomposedType&) const WARN_UNUSED_RETURN; |
| 258 void recompose(const DecomposedType& decomp); | 258 void recompose(const DecomposedType&); |
| 259 | 259 |
| 260 void blend(const TransformationMatrix& from, double progress); | 260 void blend(const TransformationMatrix& from, double progress); |
| 261 | 261 |
| 262 bool isAffine() const | 262 bool isAffine() const |
| 263 { | 263 { |
| 264 return (m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 && | 264 return (m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 && |
| 265 m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() ==
0 && m44() == 1); | 265 m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() ==
0 && m44() == 1); |
| 266 } | 266 } |
| 267 | 267 |
| 268 // Throw away the non-affine parts of the matrix (lossy!) | 268 // Throw away the non-affine parts of the matrix (lossy!) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 if (m && m != m_matrix) | 360 if (m && m != m_matrix) |
| 361 memcpy(m_matrix, m, sizeof(Matrix4)); | 361 memcpy(m_matrix, m, sizeof(Matrix4)); |
| 362 } | 362 } |
| 363 | 363 |
| 364 Matrix4 m_matrix; | 364 Matrix4 m_matrix; |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 } // namespace blink | 367 } // namespace blink |
| 368 | 368 |
| 369 #endif // TransformationMatrix_h | 369 #endif // TransformationMatrix_h |
| OLD | NEW |