MCPcopy Create free account
hub / github.com/assimp/assimp / GetColor

Method GetColor

code/AssetLib/AMF/AMFImporter_Postprocess.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57namespace Assimp {
58
59aiColor4D AMFImporter::SPP_Material::GetColor(const float /*pX*/, const float /*pY*/, const float /*pZ*/) const {
60 // Check if stored data are supported.
61 if (!Composition.empty()) {
62 throw DeadlyImportError("IME. GetColor for composition");
63 }
64
65 if (Color->Composed) {
66 throw DeadlyImportError("IME. GetColor, composed color");
67 }
68
69 aiColor4D tcol = Color->Color;
70
71 // Check if default color must be used
72 if ((tcol.r == 0) && (tcol.g == 0) && (tcol.b == 0) && (tcol.a == 0)) {
73 tcol.r = 0.5f;
74 tcol.g = 0.5f;
75 tcol.b = 0.5f;
76 tcol.a = 1;
77 }
78
79 return tcol;
80}
81
82void AMFImporter::PostprocessHelper_CreateMeshDataArray(const AMFMesh &nodeElement, std::vector<aiVector3D> &vertexCoordinateArray,
83 std::vector<AMFColor *> &pVertexColorArray) const {

Callers 5

TESTFunction · 0.80
EncodeLightsPropertyMethod · 0.80
CompareScenesMethod · 0.80
TESTFunction · 0.80

Calls 2

DeadlyImportErrorFunction · 0.85
emptyMethod · 0.45

Tested by 3

TESTFunction · 0.64
CompareScenesMethod · 0.64
TESTFunction · 0.64