| 897 | } |
| 898 | |
| 899 | void NPCHazard::TarTarSplash(const xVec3* dir_norm) |
| 900 | { |
| 901 | xVec3 up; |
| 902 | xVec3 at; |
| 903 | xVec3 right; |
| 904 | |
| 905 | if (dir_norm != NULL) |
| 906 | { |
| 907 | up = *dir_norm; |
| 908 | NPCC_MakeArbPlane(dir_norm, &at, &right); |
| 909 | } |
| 910 | else |
| 911 | { |
| 912 | up = *(xVec3*)Up(); |
| 913 | at = *(xVec3*)At(); |
| 914 | right = *(xVec3*)Right(); |
| 915 | } |
| 916 | |
| 917 | xVec3 pos_emit = pos_hazard; |
| 918 | for (S32 i = 0; i < 16; i++) |
| 919 | { |
| 920 | // Using initialization prevents generation of the operator= for the xVec3, |
| 921 | // So it's on the next line to generate the right instructions. |
| 922 | |
| 923 | // Scheduling meme here but matches otherwise. |
| 924 | xVec3 vel_emit; |
| 925 | vel_emit = up; |
| 926 | |
| 927 | F32 direction; |
| 928 | if (xrand() & 0x800000) |
| 929 | { |
| 930 | direction = 1.0f; |
| 931 | } |
| 932 | else |
| 933 | { |
| 934 | direction = -1.0f; |
| 935 | } |
| 936 | |
| 937 | vel_emit += at * direction * (0.4f * (2.0f * (xurand() - 0.5f)) + 0.25f); |
| 938 | |
| 939 | if (xrand() & 0x800000) |
| 940 | { |
| 941 | direction = 1.0f; |
| 942 | } |
| 943 | else |
| 944 | { |
| 945 | direction = -1.0f; |
| 946 | } |
| 947 | |
| 948 | vel_emit += at * direction * (0.4f * (2.0f * (xurand() - 0.5f)) + 0.25f); |
| 949 | vel_emit.normalize(); |
| 950 | vel_emit *= 15.0f; |
| 951 | |
| 952 | NPAR_EmitTarTarSplash(&pos_emit, &vel_emit); |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | void NPCHazard::TarTarLinger() |
nothing calls this directly
no test coverage detected