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

Method process_client

Engine/source/afx/afxEffectron.cpp:789–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787// private
788
789void afxEffectron::process_client(F32 dt)
790{
791 effect_elapsed += dt;
792
793 U8 pending_state = effect_state;
794
795 // check for state changes
796 switch (effect_state)
797 {
798 case INACTIVE_STATE:
799 if (marks_mask & MARK_ACTIVATE)
800 pending_state = ACTIVE_STATE;
801 break;
802 case ACTIVE_STATE:
803 if (marks_mask & MARK_INTERRUPT)
804 pending_state = CLEANUP_STATE;
805 else if (marks_mask & MARK_SHUTDOWN)
806 pending_state = CLEANUP_STATE;
807 else if (state_expired())
808 pending_state = CLEANUP_STATE;
809 break;
810 case CLEANUP_STATE:
811 if (cleanup_over())
812 pending_state = DONE_STATE;
813 break;
814 }
815
816 if (effect_state != pending_state)
817 change_state_c(pending_state);
818
819 if (effect_state == INACTIVE_STATE)
820 return;
821
822 //--------------------------//
823
824 // update the listener constraint position
825 if (!listener_cons_id.undefined())
826 {
827 Point3F listener_pos;
828 listener_pos = SFX->getListener().getTransform().getPosition();
829 constraint_mgr->setReferencePoint(listener_cons_id, listener_pos);
830 }
831
832 // find local camera position
833 Point3F cam_pos;
834 SceneObject* current_cam = get_camera(&cam_pos);
835
836 // detect camera changes
837 if (!camera_cons_id.undefined() && current_cam != camera_cons_obj)
838 {
839 constraint_mgr->setReferenceObject(camera_cons_id, current_cam);
840 camera_cons_obj = current_cam;
841 }
842
843 // sample the constraints
844 constraint_mgr->sample(dt, Platform::getVirtualMilliseconds(), (current_cam) ? &cam_pos : 0);
845
846 // update active effects lists

Callers

nothing calls this directly

Calls 8

undefinedMethod · 0.80
getListenerMethod · 0.80
setReferencePointMethod · 0.60
getPositionMethod · 0.45
getTransformMethod · 0.45
setReferenceObjectMethod · 0.45
sampleMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected