aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvopart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llvopart.cpp')
-rw-r--r--linden/indra/newview/llvopart.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/linden/indra/newview/llvopart.cpp b/linden/indra/newview/llvopart.cpp
index 5e471be..6b38cf9 100644
--- a/linden/indra/newview/llvopart.cpp
+++ b/linden/indra/newview/llvopart.cpp
@@ -654,7 +654,7 @@ void LLVOPart::setParticleCountdownStateWaitingDead(const U32 particleNumber)
654 654
655 frequency = mSpawnFrequency; 655 frequency = mSpawnFrequency;
656 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs 656 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
657 mParticleState[particleNumber].remainingLifetime = -(((mSpawnFrequencyRange * 2.0f)*frand(1.f)) + frequency - mSpawnFrequencyRange); 657 mParticleState[particleNumber].remainingLifetime = -(((mSpawnFrequencyRange * 2.0f)*ll_frand()) + frequency - mSpawnFrequencyRange);
658} 658}
659 659
660//Can override later 660//Can override later
@@ -672,9 +672,9 @@ void LLVOPart::spawnParticle(const U32 particleNumber)
672 mDeadArr[particleNumber] = 0; // not dead yet! 672 mDeadArr[particleNumber] = 0; // not dead yet!
673 673
674 //j = pos_offset_i(particleNumber); 674 //j = pos_offset_i(particleNumber);
675 mParticleState[particleNumber].position[0] = 2.f*mSpawnRange*(frand(1.f)) - mSpawnRange; 675 mParticleState[particleNumber].position[0] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
676 mParticleState[particleNumber].position[1] = 2.f*mSpawnRange*(frand(1.f)) - mSpawnRange; 676 mParticleState[particleNumber].position[1] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
677 mParticleState[particleNumber].position[2] = 2.f*mSpawnRange*(frand(1.f)) - mSpawnRange; 677 mParticleState[particleNumber].position[2] = 2.f*mSpawnRange*(ll_frand()) - mSpawnRange;
678 678
679 //mParticleStateArray[j] = (pos_ranges[1] - pos_ranges[0])*(F32)rand()/((F32)RAND_MAX) + pos_ranges[0]; 679 //mParticleStateArray[j] = (pos_ranges[1] - pos_ranges[0])*(F32)rand()/((F32)RAND_MAX) + pos_ranges[0];
680 //j++; 680 //j++;
@@ -687,12 +687,12 @@ void LLVOPart::spawnParticle(const U32 particleNumber)
687 //Create the ranged direction vector first - then rotate by the actual direction and then scale 687 //Create the ranged direction vector first - then rotate by the actual direction and then scale
688 //Creating a random value about 1,0,0 688 //Creating a random value about 1,0,0
689 //1. pick a random angle YZ orientation through full circle. 689 //1. pick a random angle YZ orientation through full circle.
690 randomUnitValue = (frand(1.f)); 690 randomUnitValue = (ll_frand());
691 direction.mV[VY] = sinf(randomUnitValue * 2.0 * F_PI); 691 direction.mV[VY] = sinf(randomUnitValue * 2.0 * F_PI);
692 direction.mV[VZ] = cosf(randomUnitValue * 2.0 * F_PI); 692 direction.mV[VZ] = cosf(randomUnitValue * 2.0 * F_PI);
693 693
694 //2. pick a rotation to this angle to project into z which is scaled by mSpawnDirectionRange 694 //2. pick a rotation to this angle to project into z which is scaled by mSpawnDirectionRange
695 randomUnitValue = (frand(1.f)); 695 randomUnitValue = (ll_frand());
696 randomUnitValue *= mSpawnDirectionRange; 696 randomUnitValue *= mSpawnDirectionRange;
697 direction.mV[VY] = direction.mV[VY] * sinf(randomUnitValue * F_PI); 697 direction.mV[VY] = direction.mV[VY] * sinf(randomUnitValue * F_PI);
698 direction.mV[VZ] = direction.mV[VZ] * sinf(randomUnitValue * F_PI); 698 direction.mV[VZ] = direction.mV[VZ] * sinf(randomUnitValue * F_PI);
@@ -804,7 +804,7 @@ void LLVOPart::spawnParticle(const U32 particleNumber)
804 804
805 805
806 //4. scale the vector by a random scale by mSpawnVelocityRange and offset by mSpawnVelocity 806 //4. scale the vector by a random scale by mSpawnVelocityRange and offset by mSpawnVelocity
807 randomUnitValue = (frand(1.f)); 807 randomUnitValue = (ll_frand());
808 randomUnitValue = (randomUnitValue * mSpawnVelocityRange) + mSpawnVelocity; 808 randomUnitValue = (randomUnitValue * mSpawnVelocityRange) + mSpawnVelocity;
809 809
810 mParticleState[particleNumber].velocity[0] = direction.mV[VX] * randomUnitValue; 810 mParticleState[particleNumber].velocity[0] = direction.mV[VX] * randomUnitValue;
@@ -822,16 +822,16 @@ void LLVOPart::spawnParticle(const U32 particleNumber)
822 822
823 mParticleState[particleNumber].acceleration[2] = 0.0f; 823 mParticleState[particleNumber].acceleration[2] = 0.0f;
824 824
825 mParticleState[particleNumber].scale[0] = (mScale_range[1] - mScale_range[0])*frand(1.f) + mScale_range[0]; 825 mParticleState[particleNumber].scale[0] = (mScale_range[1] - mScale_range[0])*ll_frand() + mScale_range[0];
826 mParticleState[particleNumber].scale[1] = (mScale_range[3] - mScale_range[2])*frand(1.f) + mScale_range[2]; 826 mParticleState[particleNumber].scale[1] = (mScale_range[3] - mScale_range[2])*ll_frand() + mScale_range[2];
827 mParticleState[particleNumber].scale[2] = 0.0f; 827 mParticleState[particleNumber].scale[2] = 0.0f;
828 828
829 mParticleState[particleNumber].alpha[0] = (mAlpha_range[1] - mAlpha_range[0])*frand(1.f) + mAlpha_range[0]; 829 mParticleState[particleNumber].alpha[0] = (mAlpha_range[1] - mAlpha_range[0])*ll_frand() + mAlpha_range[0];
830 mParticleState[particleNumber].alpha[1] = (mAlpha_range[3] - mAlpha_range[2])*frand(1.f) + mAlpha_range[2]; 830 mParticleState[particleNumber].alpha[1] = (mAlpha_range[3] - mAlpha_range[2])*ll_frand() + mAlpha_range[2];
831 mParticleState[particleNumber].alpha[2] = 0.0f; 831 mParticleState[particleNumber].alpha[2] = 0.0f;
832 832
833 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs 833 // **** Hack! remainingLifetime counts up from negative, to avoid subtracts! - djs
834 mParticleState[particleNumber].remainingLifetime = -((mIndividualLifetimeRange*2.0f)*frand(1.f) + mIndividualLifetime - mIndividualLifetimeRange); 834 mParticleState[particleNumber].remainingLifetime = -((mIndividualLifetimeRange*2.0f)*ll_frand() + mIndividualLifetime - mIndividualLifetimeRange);
835 835
836 //rest of the state - 0 for now 836 //rest of the state - 0 for now
837 mParticleState[particleNumber].deathOffset = 0.0f; 837 mParticleState[particleNumber].deathOffset = 0.0f;