SetColorOfComponent (inline)
Syntax
// // Strong typing definition // static inline void SetColorOfComponent( OwlInstance owlInstanceColorComponent, uint32_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 ); } } // // Weak typing definition // static inline void SetColorOfComponent( int64_t owlInstanceColorComponent, uint32_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 ); } }