MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / getMountTransform

Method getMountTransform

Engine/source/T3D/entity.cpp:907–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

905}
906
907void 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
937void Entity::getRenderMountTransform(F32 delta, S32 index, const MatrixF &xfm, MatrixF *outMat)
938{

Callers 12

processTickMethod · 0.45
shapeBase.cppFile · 0.45
processTickMethod · 0.45
setPositionMethod · 0.45
processTickMethod · 0.45
getTransformMethod · 0.45
entity.cppFile · 0.45
processTickMethod · 0.45
processTickMethod · 0.45
onMountMethod · 0.45
processTickMethod · 0.45

Calls 8

animateMethod · 0.45
getShapeInstanceMethod · 0.45
sizeMethod · 0.45
getShapeMethod · 0.45
mulMethod · 0.45
getPositionMethod · 0.45
convolveMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected