| 905 | } |
| 906 | |
| 907 | void Entity::getMountTransform(S32 index, const MatrixF &xfm, MatrixF *outMat) |
| 908 | { |
| 909 | RenderComponentInterface* renderInterface = getComponent<RenderComponentInterface>(); |
| 910 | |
| 911 | if (renderInterface) |
| 912 | { |
| 913 | renderInterface->getShapeInstance()->animate(); |
| 914 | S32 nodeCount = renderInterface->getShapeInstance()->getShape()->nodes.size(); |
| 915 | |
| 916 | if (index >= 0 && index < nodeCount) |
| 917 | { |
| 918 | MatrixF mountTransform = renderInterface->getShapeInstance()->mNodeTransforms[index]; |
| 919 | mountTransform.mul(xfm); |
| 920 | const Point3F& scale = getScale(); |
| 921 | |
| 922 | // The position of the mount point needs to be scaled. |
| 923 | Point3F position = mountTransform.getPosition(); |
| 924 | position.convolve(scale); |
| 925 | mountTransform.setPosition(position); |
| 926 | |
| 927 | // Also we would like the object to be scaled to the model. |
| 928 | outMat->mul(mObjToWorld, mountTransform); |
| 929 | return; |
| 930 | } |
| 931 | } |
| 932 | |
| 933 | // Then let SceneObject handle it. |
| 934 | Parent::getMountTransform(index, xfm, outMat); |
| 935 | } |
| 936 | |
| 937 | void Entity::getRenderMountTransform(F32 delta, S32 index, const MatrixF &xfm, MatrixF *outMat) |
| 938 | { |
no test coverage detected