| 84 | } |
| 85 | |
| 86 | Float3 FoliageType::GetRandomScale() const |
| 87 | { |
| 88 | Float3 result; |
| 89 | float tmp; |
| 90 | switch (PaintScaling) |
| 91 | { |
| 92 | case FoliageScalingModes::Uniform: |
| 93 | result.X = Math::Lerp(PaintScaleMin.X, PaintScaleMax.X, Random::Rand()); |
| 94 | result.Y = result.X; |
| 95 | result.Z = result.X; |
| 96 | break; |
| 97 | case FoliageScalingModes::Free: |
| 98 | result.X = Math::Lerp(PaintScaleMin.X, PaintScaleMax.X, Random::Rand()); |
| 99 | result.Y = Math::Lerp(PaintScaleMin.Y, PaintScaleMax.Y, Random::Rand()); |
| 100 | result.Z = Math::Lerp(PaintScaleMin.Z, PaintScaleMax.Z, Random::Rand()); |
| 101 | break; |
| 102 | case FoliageScalingModes::LockXY: |
| 103 | tmp = Random::Rand(); |
| 104 | result.X = Math::Lerp(PaintScaleMin.X, PaintScaleMax.X, tmp); |
| 105 | result.Y = Math::Lerp(PaintScaleMin.Y, PaintScaleMax.Y, tmp); |
| 106 | result.Z = Math::Lerp(PaintScaleMin.Z, PaintScaleMax.Z, Random::Rand()); |
| 107 | break; |
| 108 | case FoliageScalingModes::LockXZ: |
| 109 | tmp = Random::Rand(); |
| 110 | result.X = Math::Lerp(PaintScaleMin.X, PaintScaleMax.X, tmp); |
| 111 | result.Y = Math::Lerp(PaintScaleMin.Y, PaintScaleMax.Y, Random::Rand()); |
| 112 | result.Z = Math::Lerp(PaintScaleMin.Z, PaintScaleMax.Z, tmp); |
| 113 | break; |
| 114 | case FoliageScalingModes::LockYZ: |
| 115 | tmp = Random::Rand(); |
| 116 | result.X = Math::Lerp(PaintScaleMin.X, PaintScaleMax.X, Random::Rand()); |
| 117 | result.Y = Math::Lerp(PaintScaleMin.Y, PaintScaleMax.Y, tmp); |
| 118 | result.Z = Math::Lerp(PaintScaleMin.Z, PaintScaleMax.Z, tmp); |
| 119 | break; |
| 120 | } |
| 121 | return result; |
| 122 | } |
| 123 | |
| 124 | void FoliageType::OnModelChanged() |
| 125 | { |