MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / transform

Method transform

Engine/source/math/mPolyhedron.impl.h:51–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template< typename Base >
51void 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

Callers 15

addPlaneMethod · 0.45
planeMethod · 0.45
addPlaneMethod · 0.45
planeMethod · 0.45
addPlaneMethod · 0.45
planeMethod · 0.45
isInterestedInPlaneMethod · 0.45
insertPlaneMethod · 0.45
addPlaneMethod · 0.45
planeMethod · 0.45
addPlaneMethod · 0.45
planeMethod · 0.45

Calls 7

mulPMethod · 0.80
getNumPointsMethod · 0.45
getPointsMethod · 0.45
convolveMethod · 0.45
getNumPlanesMethod · 0.45
getPlanesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected