| 1578 | } |
| 1579 | |
| 1580 | void NPCHazard::OilSplash(const xVec3* dir_norm) |
| 1581 | { |
| 1582 | xVec3 up; |
| 1583 | xVec3 at; |
| 1584 | xVec3 rt; |
| 1585 | |
| 1586 | if (dir_norm) |
| 1587 | { |
| 1588 | up = *dir_norm; |
| 1589 | NPCC_MakeArbPlane(dir_norm, &at, &rt); |
| 1590 | } |
| 1591 | else |
| 1592 | { |
| 1593 | up = *(xVec3*)Up(); |
| 1594 | at = *(xVec3*)At(); |
| 1595 | rt = *(xVec3*)Right(); |
| 1596 | } |
| 1597 | |
| 1598 | xVec3 pos_emit = this->pos_hazard; |
| 1599 | for (S32 i = 0; i < 16; i++) |
| 1600 | { |
| 1601 | xVec3 vel_emit; |
| 1602 | vel_emit = up; |
| 1603 | |
| 1604 | F32 direction; |
| 1605 | if (xrand() & 0x800000) |
| 1606 | { |
| 1607 | direction = 1.0f; |
| 1608 | } |
| 1609 | else |
| 1610 | { |
| 1611 | direction = -1.0f; |
| 1612 | } |
| 1613 | |
| 1614 | vel_emit += at * direction * (0.4f * (2.0f * (xurand() - 0.5f)) + 0.25f); |
| 1615 | |
| 1616 | if (xrand() & 0x800000) |
| 1617 | { |
| 1618 | direction = 1.0f; |
| 1619 | } |
| 1620 | else |
| 1621 | { |
| 1622 | direction = -1.0f; |
| 1623 | } |
| 1624 | |
| 1625 | vel_emit += rt * direction * (0.4f * (2.0f * (xurand() - 0.5f)) + 0.25f); |
| 1626 | vel_emit.normalize(); |
| 1627 | vel_emit *= 15.0f; |
| 1628 | |
| 1629 | NPAR_EmitOilSplash(&pos_emit, &vel_emit); |
| 1630 | } |
| 1631 | } |
| 1632 | |
| 1633 | void NPCHazard::Upd_OilOoze(F32 dt) |
| 1634 | { |
nothing calls this directly
no test coverage detected