diff options
author | onefang | 2021-09-06 22:13:31 +1000 |
---|---|---|
committer | onefang | 2021-09-06 22:13:31 +1000 |
commit | a8e46a1a52e251a6f474590e3bda4888d6ca4cb9 (patch) | |
tree | 50bf7adc337cb7fc2eecffefbe0b74cc64d4cdaf | |
parent | Rip it a new one, the mop up. (diff) | |
download | 1ring-a8e46a1a52e251a6f474590e3bda4888d6ca4cb9.zip 1ring-a8e46a1a52e251a6f474590e3bda4888d6ca4cb9.tar.gz 1ring-a8e46a1a52e251a6f474590e3bda4888d6ca4cb9.tar.bz2 1ring-a8e46a1a52e251a6f474590e3bda4888d6ca4cb9.tar.xz |
Fix water bubbles and bobble.
Diffstat (limited to '')
-rw-r--r-- | 1AOor2.lsl | 53 |
1 files changed, 39 insertions, 14 deletions
@@ -1581,17 +1581,38 @@ checkSitters(integer del) | |||
1581 | return; | 1581 | return; |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | |||
1585 | // Particle engine, for bubbles while swimming. | ||
1586 | integer noParticles = TRUE; | ||
1587 | updateParticles() | ||
1584 | { | 1588 | { |
1585 | if (NULL_KEY != avatar) | 1589 | if (noParticles) |
1586 | { | 1590 | { |
1587 | list anims = llGetAnimationList(avatar); | 1591 | noParticles = FALSE; |
1588 | integer l = llGetListLength(anims); | 1592 | llParticleSystem( |
1589 | integer i; | 1593 | [ |
1590 | for (i = 0; i < l; i++) | 1594 | PSYS_PART_MAX_AGE, 16.0, |
1591 | { | 1595 | PSYS_PART_FLAGS, |
1592 | string anim = llList2String(anims, i); | 1596 | PSYS_PART_EMISSIVE_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_WIND_MASK, |
1593 | if (anim != "") animEnd(avatar, anim); | 1597 | PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>, |
1594 | } | 1598 | PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>, |
1599 | PSYS_PART_START_SCALE, <0.05, 0.05, 0.05>, | ||
1600 | PSYS_PART_END_SCALE, <0.1, 0.1, 0.1>, | ||
1601 | PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE, | ||
1602 | PSYS_SRC_BURST_RATE, 4.0, | ||
1603 | PSYS_SRC_ACCEL, <0.0, 0.0, 0.3>, | ||
1604 | PSYS_SRC_BURST_PART_COUNT, 1, | ||
1605 | PSYS_SRC_BURST_RADIUS, 0.2, | ||
1606 | PSYS_SRC_BURST_SPEED_MIN, 0.7, | ||
1607 | PSYS_SRC_BURST_SPEED_MAX, 0.001, | ||
1608 | PSYS_SRC_ANGLE_BEGIN, PI, | ||
1609 | PSYS_SRC_ANGLE_END, PI, | ||
1610 | PSYS_SRC_OMEGA, <0.0, -0.2, 0.0>, | ||
1611 | PSYS_SRC_MAX_AGE, 0.0, | ||
1612 | PSYS_PART_START_ALPHA, 1.0, | ||
1613 | PSYS_PART_END_ALPHA, 1.0, | ||
1614 | PSYS_SRC_TEXTURE, "soap-bubble" | ||
1615 | ]); | ||
1595 | } | 1616 | } |
1596 | } | 1617 | } |
1597 | 1618 | ||
@@ -1715,13 +1736,13 @@ checkAO() | |||
1715 | { | 1736 | { |
1716 | if (Swimming) | 1737 | if (Swimming) |
1717 | { // That's metres of water depth before it figures you don't have enough to swim in. | 1738 | { // That's metres of water depth before it figures you don't have enough to swim in. |
1718 | if ((z > water) && ((water - ground) > 1.5)) | 1739 | if ((z > water) && ((water - ground) > 0.5)) |
1719 | { // Push you back into the water. | 1740 | { // Push you back into the water. |
1720 | vector velocity = llGetVel(); | 1741 | vector velocity = llGetVel(); |
1721 | dpth = 0.1; | 1742 | dpth = 0.1; |
1722 | velocity.x = 0.0; velocity.y = 0.0; | 1743 | velocity.x = 0.0; velocity.y = 0.0; |
1723 | if (10 > velocity.z) velocity.z = 10; | 1744 | if (10 > velocity.z) velocity.z = 10; |
1724 | velocity.z *= -4; | 1745 | velocity.z *= -7; |
1725 | if ("Swimming Up" == alias("~" +nextState)) | 1746 | if ("Swimming Up" == alias("~" +nextState)) |
1726 | { | 1747 | { |
1727 | Bobbing++; | 1748 | Bobbing++; |
@@ -1744,13 +1765,17 @@ checkAO() | |||
1744 | } | 1765 | } |
1745 | else // Not in fly mode. | 1766 | else // Not in fly mode. |
1746 | Swimming = FALSE; | 1767 | Swimming = FALSE; |
1747 | // llParticleSystem([]); | 1768 | if ((!Swimming && (!noParticles))) |
1769 | { | ||
1770 | llParticleSystem([]); | ||
1771 | noParticles = TRUE; | ||
1772 | } | ||
1748 | if (Swimming) | 1773 | if (Swimming) |
1749 | { | 1774 | { |
1750 | if (Attached) AOspeed = 0.1; | 1775 | if (Attached) AOspeed = 0.1; |
1751 | else AOspeed = 0.5; | 1776 | else AOspeed = 0.5; |
1752 | newAnim = alias("~" + newAnim); | 1777 | newAnim = alias("~" + newAnim); |
1753 | // updateParticles(); | 1778 | updateParticles(); |
1754 | } | 1779 | } |
1755 | else if (-1 != flying) | 1780 | else if (-1 != flying) |
1756 | { | 1781 | { |