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

Method updateActionThread

Engine/source/T3D/player.cpp:3895–4035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3893}
3894
3895void Player::updateActionThread()
3896{
3897 PROFILE_START(UpdateActionThread);
3898
3899 // Select an action animation sequence, this assumes that
3900 // this function is called once per tick.
3901 if(mActionAnimation.action != PlayerData::NullAnimation)
3902 {
3903 if (mActionAnimation.forward)
3904 mActionAnimation.atEnd = mShapeInstance->getPos(mActionAnimation.thread) == 1;
3905 else
3906 mActionAnimation.atEnd = mShapeInstance->getPos(mActionAnimation.thread) == 0;
3907 }
3908
3909 // Only need to deal with triggers on the client
3910 if( isGhost() )
3911 {
3912 bool triggeredLeft = false;
3913 bool triggeredRight = false;
3914
3915 F32 offset = 0.0f;
3916 if( mShapeInstance->getTriggerState( 1 ) )
3917 {
3918 triggeredLeft = true;
3919 offset = -mDataBlock->decalOffset * getScale().x;
3920 }
3921 else if(mShapeInstance->getTriggerState( 2 ) )
3922 {
3923 triggeredRight = true;
3924 offset = mDataBlock->decalOffset * getScale().x;
3925 }
3926
3927 process_client_triggers(triggeredLeft, triggeredRight);
3928 if ((triggeredLeft || triggeredRight) && !noFootfallFX)
3929 {
3930 Point3F rot, pos;
3931 RayInfo rInfo;
3932 MatrixF mat = getRenderTransform();
3933 mat.getColumn( 1, &rot );
3934 mat.mulP( Point3F( offset, 0.0f, 0.0f), &pos );
3935
3936 if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ),
3937 Point3F( pos.x, pos.y, pos.z - 2.0f ),
3938 STATIC_COLLISION_TYPEMASK | VehicleObjectType, &rInfo ) )
3939 {
3940 Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 );
3941
3942 // Put footprints on surface, if appropriate for material.
3943
3944 if( material && material->mShowFootprints
3945 && mDataBlock->decalData && !footfallDecalOverride )
3946 {
3947 Point3F normal;
3948 Point3F tangent;
3949 mObjToWorld.getColumn( 0, &tangent );
3950 mObjToWorld.getColumn( 2, &normal );
3951 gDecalManager->addDecal( rInfo.point, normal, tangent, mDataBlock->decalData, getScale().y );
3952 }

Callers

nothing calls this directly

Calls 15

mFabsFunction · 0.85
getTriggerStateMethod · 0.80
getColumnMethod · 0.80
mulPMethod · 0.80
setColorsMethod · 0.80
deleteWhenEmptyMethod · 0.80
mulVMethod · 0.80
Point3FClass · 0.50
warnfFunction · 0.50
mDotFunction · 0.50
getPosMethod · 0.45
castRayMethod · 0.45

Tested by

no test coverage detected