------------------------------------------------------------------------------------------------ Get a RGBA color in [0...1] range
| 137 | // ------------------------------------------------------------------------------------------------ |
| 138 | // Get a RGBA color in [0...1] range |
| 139 | void GetMaterialColor(const std::vector<PLY::PropertyInstance> &avList, unsigned int positions[4], EDataType types[4], |
| 140 | aiColor4D *clrOut) { |
| 141 | ai_assert(nullptr != clrOut); |
| 142 | |
| 143 | if (NotSet == positions[0]) { |
| 144 | clrOut->r = 0.0f; |
| 145 | } else { |
| 146 | clrOut->r = NormalizeColorValue(GetProperty(avList, positions[0]).avList.front(), types[0]); |
| 147 | } |
| 148 | |
| 149 | if (NotSet == positions[1]) { |
| 150 | clrOut->g = 0.0f; |
| 151 | } else { |
| 152 | clrOut->g = NormalizeColorValue(GetProperty(avList, positions[1]).avList.front(), types[1]); |
| 153 | } |
| 154 | |
| 155 | if (NotSet == positions[2]) { |
| 156 | clrOut->b = 0.0f; |
| 157 | } else { |
| 158 | clrOut->b = NormalizeColorValue(GetProperty(avList, positions[2]).avList.front(), types[2]); |
| 159 | } |
| 160 | |
| 161 | // assume 1.0 for the alpha channel ifit is not set |
| 162 | if (NotSet == positions[3]) { |
| 163 | clrOut->a = 1.0f; |
| 164 | } else { |
| 165 | clrOut->a = NormalizeColorValue(GetProperty(avList, positions[3]).avList.front(), types[3]); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | } // namespace |
| 170 |
no test coverage detected