| 1144 | } |
| 1145 | |
| 1146 | void NPCHazard::WaterSplash(const xVec3* dir_norm) |
| 1147 | { |
| 1148 | xVec3 pos_emit = this->pos_hazard; |
| 1149 | |
| 1150 | xVec3 up, at, rt; |
| 1151 | if (dir_norm) |
| 1152 | { |
| 1153 | up = *dir_norm; |
| 1154 | NPCC_MakePerp(&at, dir_norm); |
| 1155 | xVec3Cross(&rt, &up, &at); |
| 1156 | } |
| 1157 | else |
| 1158 | { |
| 1159 | up = *(xVec3*)Up(); |
| 1160 | at = *(xVec3*)At(); |
| 1161 | rt = *(xVec3*)Right(); |
| 1162 | } |
| 1163 | |
| 1164 | for (S32 i = 0; i < 8; i++) |
| 1165 | { |
| 1166 | xVec3 vel_emit; |
| 1167 | vel_emit = up * (0.5f * xurand() + 1.5f); |
| 1168 | |
| 1169 | F32 direction; |
| 1170 | if (xrand() & 0x800000) |
| 1171 | { |
| 1172 | direction = 1.0f; |
| 1173 | } |
| 1174 | else |
| 1175 | { |
| 1176 | direction = -1.0f; |
| 1177 | } |
| 1178 | |
| 1179 | vel_emit += at * direction * (0.5f * (2.0f * (xurand() - 0.5f)) + 1.0f); |
| 1180 | |
| 1181 | if (xrand() & 0x800000) |
| 1182 | { |
| 1183 | direction = 1.0f; |
| 1184 | } |
| 1185 | else |
| 1186 | { |
| 1187 | direction = -1.0f; |
| 1188 | } |
| 1189 | |
| 1190 | vel_emit += rt * direction * (0.5f * (2.0f * (xurand() - 0.5f)) + 1.0f); |
| 1191 | vel_emit.normalize(); |
| 1192 | vel_emit *= 10.0f; |
| 1193 | |
| 1194 | NPAR_EmitH2ODrips(&pos_emit, &vel_emit); |
| 1195 | } |
| 1196 | |
| 1197 | for (S32 i = 0; i < 8; i++) |
| 1198 | { |
| 1199 | xVec3 vel_emit; |
| 1200 | xurand(); |
| 1201 | vel_emit = up * 1.0f; |
| 1202 | |
| 1203 | F32 direction; |
nothing calls this directly
no test coverage detected