| 133 | } |
| 134 | |
| 135 | float SquaredDistMorphToBase( int index, bool dataIsDeltas, uint8_t* pVertices, MorphToBaseData baseData, uint8_t* pMorphSrc, MorphToBaseData morphData ) |
| 136 | { |
| 137 | Vector3 vertex; |
| 138 | ConvertDataToVector3( baseData.declType, pVertices + baseData.positionByteOffset + index * baseData.bytesPerVertex, &vertex ); |
| 139 | |
| 140 | Vector3 morphVertex; |
| 141 | ConvertDataToVector3( morphData.declType, pMorphSrc + morphData.positionByteOffset + index * morphData.bytesPerVertex, &morphVertex ); |
| 142 | |
| 143 | Vector3 diff; |
| 144 | if( dataIsDeltas ) |
| 145 | { |
| 146 | diff = morphVertex; |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | diff = morphVertex - vertex; |
| 151 | } |
| 152 | |
| 153 | return Dot( diff, diff ); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 |
no test coverage detected