SetColor (inline)
Syntax
// // Strong typing definition // static inline void SetColor( OwlInstance owlInstanceColor, uint32_t ambient, uint32_t diffuse, uint32_t emissive, uint32_t specular ) { assert(IsInstanceOfClass(owlInstanceColor, "Color")); { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "ambient" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), ambient ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "diffuse" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), diffuse ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "emissive" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), emissive ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "specular" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), specular ); } } // // Weak typing definition // static inline void SetColor( int64_t owlInstanceColor, uint32_t ambient, uint32_t diffuse, uint32_t emissive, uint32_t specular ) { assert(IsInstanceOfClass(owlInstanceColor, "Color")); { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "ambient" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), ambient ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "diffuse" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), diffuse ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "emissive" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), emissive ); } { OwlInstance * values = nullptr; int64_t card = 0; GetObjectProperty( owlInstanceColor, GetPropertyByName( GetModel(owlInstanceColor), "specular" ), &values, &card ); SetColorOfComponent( (card == 1) ? values[0] : CreateInstance( GetClassByName( GetModel(owlInstanceColor), "ColorComponent" ) ), specular ); } }