MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / WaterSplash

Method WaterSplash

src/SB/Game/zNPCHazard.cpp:1146–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146void 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;

Callers

nothing calls this directly

Calls 6

NPCC_MakePerpFunction · 0.85
xVec3CrossFunction · 0.85
xurandFunction · 0.85
xrandFunction · 0.85
NPAR_EmitH2ODripsFunction · 0.85
NPAR_EmitH2ODropsFunction · 0.85

Tested by

no test coverage detected