| 94 | } |
| 95 | |
| 96 | FLinearColor IslandColor(int32 IslandId, bool bAwake, float SleepValueScale, float SleepSaturationScale) |
| 97 | { |
| 98 | // Match MuJoCo's islandColor() exactly. Upstream special-cases seed=-1 |
| 99 | // (body not in any island and no tree fallback) to neutral grey 0.7. |
| 100 | if (IslandId < 0) |
| 101 | { |
| 102 | float V = 0.7f; |
| 103 | if (!bAwake) |
| 104 | V *= SleepValueScale; |
| 105 | return FLinearColor(V, V, V); |
| 106 | } |
| 107 | // seed = id+1; Halton bases 7/3/5 -> HSV. |
| 108 | const int32 Seed = IslandId + 1; |
| 109 | const float H = Halton(Seed, 7); |
| 110 | float S = 0.5f + 0.5f * Halton(Seed, 3); |
| 111 | float V = 0.6f + 0.4f * Halton(Seed, 5); |
| 112 | if (!bAwake) |
| 113 | { |
| 114 | V *= SleepValueScale; |
| 115 | S *= SleepSaturationScale; |
| 116 | } |
| 117 | return HSVToRGB(H, S, V); |
| 118 | } |
| 119 | |
| 120 | FLinearColor InstanceSegmentationColor(uint32 ArticulationHash, int32 BodyIndex, bool bAwake, float SleepValueScale, float SleepSaturationScale) |
| 121 | { |