SetColorComponent (inline)
Syntax
// // Linux, MacOS and non-Visual Studio Windows solutions (pure C++11 / C++98) // static inline void SetColorComponent( int64_t owlInstanceColorComponent, int32_t color ) { assert(IsInstanceOfClass(owlInstanceColorComponent, "ColorComponent")); int64_t model = GetModel(owlInstanceColorComponent); const char * rgbwNames[4] = { "R", "G", "B", "W" }; double rgbwValues[4]; COLOR_GET_COMPONENTS(rgbwValues, color); for (size_t i = 0; i < 4; i++) { SetDatatypeProperty( owlInstanceColorComponent, GetPropertyByName( model, rgbwNames[i] ), &rgbwValues[i], 1 ); } } // // Visual Studio for Windows // static inline void SetColorComponent( __int64 owlInstanceColorComponent, __int32 color ) { assert(IsInstanceOfClass(owlInstanceColorComponent, "ColorComponent")); int64_t model = GetModel(owlInstanceColorComponent); const char * rgbwNames[4] = { "R", "G", "B", "W" }; double rgbwValues[4]; COLOR_GET_COMPONENTS(rgbwValues, color); for (size_t i = 0; i < 4; i++) { SetDatatypeProperty( owlInstanceColorComponent, GetPropertyByName( model, rgbwNames[i] ), &rgbwValues[i], 1 ); } }