MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getMuzzleVector

Method getMuzzleVector

Engine/source/T3D/player.cpp:5820–5845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5818}
5819
5820void Player::getMuzzleVector(U32 imageSlot,VectorF* vec)
5821{
5822 MatrixF mat;
5823 getMuzzleTransform(imageSlot,&mat);
5824
5825 GameConnection * gc = getControllingClient();
5826 if (gc && !gc->isAIControlled())
5827 {
5828 MountedImage& image = mMountedImageList[imageSlot];
5829
5830 bool fp = gc->isFirstPerson();
5831 if ((fp && image.dataBlock->correctMuzzleVector) ||
5832 (!fp && image.dataBlock->correctMuzzleVectorTP))
5833 {
5834 disableHeadZCalc();
5835 if (getCorrectedAim(mat, vec))
5836 {
5837 enableHeadZCalc();
5838 return;
5839 }
5840 enableHeadZCalc();
5841 }
5842 }
5843
5844 mat.getColumn(1,vec);
5845}
5846
5847void Player::renderMountedImage( U32 imageSlot, TSRenderState &rstate, SceneRenderState *state )
5848{

Callers 1

shapeBase.cppFile · 0.45

Calls 3

getColumnMethod · 0.80
isAIControlledMethod · 0.45
isFirstPersonMethod · 0.45

Tested by

no test coverage detected