| 3258 | } |
| 3259 | |
| 3260 | void EveSpaceObject2::GetLocatorInObjectSpace( Vector3& position, Vector3& direction, const Locator& locator ) const |
| 3261 | { |
| 3262 | Vector3 damagelocatorDirection = (Vector3)XMVector3Rotate( Vector3( 0.f, 1.f, 0.f ), locator.direction ); |
| 3263 | // We're assuming for now that the bone 0 isn't animated for performance reasons. |
| 3264 | if( locator.boneIndex <= 0 ) |
| 3265 | { |
| 3266 | // damage locator is not attached to a bone, return the position |
| 3267 | position = locator.position; |
| 3268 | direction = damagelocatorDirection; |
| 3269 | return; |
| 3270 | } |
| 3271 | |
| 3272 | // If the damage locator is animated we extract the bone matrix and apply it to the damage locator position |
| 3273 | if( m_animationUpdater && m_animationUpdater->IsInitialized() ) |
| 3274 | { |
| 3275 | if( locator.boneIndex < m_animationUpdater->GetMeshBoneCount() ) |
| 3276 | { |
| 3277 | const Float4x3* bones = m_animationUpdater->GetMeshBoneMatrixList(); |
| 3278 | Matrix boneTF = IdentityMatrix(); |
| 3279 | TriMatrixCopyFrom3x4( &boneTF, &bones[locator.boneIndex] ); |
| 3280 | position = XMVector3TransformCoord( locator.position, boneTF ); |
| 3281 | direction = XMVector3TransformNormal( damagelocatorDirection, boneTF ); |
| 3282 | } |
| 3283 | } |
| 3284 | } |
| 3285 | |
| 3286 | Be::Result<std::string> EveSpaceObject2::GetLocalBoundingBoxFromScript( std::pair<Vector3, Vector3>& result ) |
| 3287 | { |
nothing calls this directly
no test coverage detected