| 787 | // private |
| 788 | |
| 789 | void 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 |
nothing calls this directly
no test coverage detected