| 3893 | } |
| 3894 | |
| 3895 | void 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 | } |
nothing calls this directly
no test coverage detected