| 5657 | } |
| 5658 | |
| 5659 | void Player::getRenderEyeTransform(MatrixF* mat) |
| 5660 | { |
| 5661 | getRenderEyeBaseTransform(mat, true); |
| 5662 | |
| 5663 | // Use the first image that is set to use the eye node |
| 5664 | for (U32 i=0; i<ShapeBase::MaxMountedImages; ++i) |
| 5665 | { |
| 5666 | MountedImage& image = mMountedImageList[i]; |
| 5667 | if (image.dataBlock) |
| 5668 | { |
| 5669 | ShapeBaseImageData& data = *image.dataBlock; |
| 5670 | U32 shapeIndex = getImageShapeIndex(image); |
| 5671 | if ( data.useEyeNode && isFirstPerson() && data.eyeMountNode[shapeIndex] != -1 && data.eyeNode[shapeIndex] != -1 ) |
| 5672 | { |
| 5673 | // Get the eye node's position relative to the eye mount node |
| 5674 | MatrixF mountTransform = image.shapeInstance[shapeIndex]->mNodeTransforms[data.eyeMountNode[shapeIndex]]; |
| 5675 | Point3F eyeMountNodePos = mountTransform.getPosition(); |
| 5676 | mountTransform = image.shapeInstance[shapeIndex]->mNodeTransforms[data.eyeNode[shapeIndex]]; |
| 5677 | Point3F eyeNodePos = mountTransform.getPosition() - eyeMountNodePos; |
| 5678 | |
| 5679 | // Now transform to the image's eye node (position only) |
| 5680 | MatrixF xfm(true); |
| 5681 | xfm.setPosition(eyeNodePos); |
| 5682 | mat->mul(xfm); |
| 5683 | |
| 5684 | return; |
| 5685 | } |
| 5686 | } |
| 5687 | } |
| 5688 | } |
| 5689 | |
| 5690 | void Player::getRenderEyeBaseTransform(MatrixF* mat, bool includeBank) |
| 5691 | { |
no test coverage detected