| 49 | |
| 50 | template< typename Base > |
| 51 | void PolyhedronImpl< Base >::transform( const MatrixF& matrix, const Point3F& scale ) |
| 52 | { |
| 53 | // Transform points. |
| 54 | |
| 55 | const U32 numPoints = this->getNumPoints(); |
| 56 | typename Base::PointType* points = this->getPoints(); |
| 57 | |
| 58 | for( U32 i = 0; i < numPoints; ++ i ) |
| 59 | { |
| 60 | matrix.mulP( points[ i ] ); |
| 61 | points[ i ].convolve( scale ); |
| 62 | } |
| 63 | |
| 64 | // Transform planes. |
| 65 | |
| 66 | const U32 numPlanes = this->getNumPlanes(); |
| 67 | typename Base::PlaneType* planes = this->getPlanes(); |
| 68 | |
| 69 | PlaneTransformer transformer; |
| 70 | transformer.set( matrix, scale ); |
| 71 | |
| 72 | for( U32 i = 0; i < numPlanes; ++ i ) |
| 73 | { |
| 74 | const typename Base::PlaneType& plane = planes[ i ]; |
| 75 | |
| 76 | PlaneF result; |
| 77 | transformer.transform( plane, result ); |
| 78 | planes[ i ] = result; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | //----------------------------------------------------------------------------- |
| 83 |
no test coverage detected