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

Method processTick

Engine/source/T3D/trigger.cpp:755–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753
754
755void Trigger::processTick(const Move* move)
756{
757 Parent::processTick(move);
758
759 if (!mDataBlock)
760 return;
761 if (mDataBlock->isClientSide && isServerObject())
762 return;
763 if (!mDataBlock->isClientSide && isClientObject())
764 return;
765
766 if (isMounted()) {
767 MatrixF mat;
768 mMount.object->getMountTransform( mMount.node, mMount.xfm, &mat );
769 setTransform(mat);
770 setRenderTransform(mat);
771 }
772
773 //
774 if (mObjects.size() == 0)
775 return;
776
777 if (mLastThink + mDataBlock->tickPeriodMS < mCurrTick)
778 {
779 mCurrTick = 0;
780 mLastThink = 0;
781
782 for (S32 i = S32(mObjects.size() - 1); i >= 0; i--)
783 {
784 if (testObject(mObjects[i]) == false)
785 {
786 GameBase* remove = mObjects[i];
787 mObjects.erase(i);
788 clearNotify(remove);
789
790 if (evalCmD(&mLeaveCommand))
791 {
792 String command = String("%obj = ") + remove->getIdString() + ";";
793 command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand;
794 Con::evaluate(command.c_str());
795 }
796 if (testTrippable() && testCondition())
797 mDataBlock->onLeaveTrigger_callback( this, remove );
798 mTripped = true;
799 }
800 }
801
802 if (evalCmD(&mTickCommand))
803 Con::evaluate(mTickCommand.c_str());
804
805 if (mObjects.size() != 0 && testTrippable() && testCondition())
806 mDataBlock->onTickTrigger_callback( this );
807 }
808 else
809 {
810 mCurrTick += TickMs;
811 }
812}

Callers

nothing calls this directly

Calls 7

evaluateFunction · 0.85
getIdStringMethod · 0.80
StringClass · 0.50
getMountTransformMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected