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
            );
    }
}    

Property owlInstanceColor

Size: 64 bit / 8 byte (value)
The handle of the Color instance.

Property ambient

Size: 32 bit / 4 byte (value)
Defines the ambient color as a 32 bit value; the 32 bit value is build up as 8 : 8 : 8 : 8 bits representing RGBA (or sometimes called RGBW), i.e. Red, Green, Blue, Alpha (transparency) each defined as a unsigned char value 0 .. 255.

Property diffuse

Size: 32 bit / 4 byte (value)
Defines the diffuse color as a 32 bit value; the 32 bit value is build up as 8 : 8 : 8 : 8 bits representing RGBA (or sometimes called RGBW), i.e. Red, Green, Blue, Alpha (transparency) each defined as a unsigned char value 0 .. 255.

Property emissive

Size: 32 bit / 4 byte (value)
Defines the emissive color as a 32 bit value; the 32 bit value is build up as 8 : 8 : 8 : 8 bits representing RGBA (or sometimes called RGBW), i.e. Red, Green, Blue, Alpha (transparency) each defined as a unsigned char value 0 .. 255.

Property specular

Size: 32 bit / 4 byte (value)
Defines the specular color as a 32 bit value; the 32 bit value is build up as 8 : 8 : 8 : 8 bits representing RGBA (or sometimes called RGBW), i.e. Red, Green, Blue, Alpha (transparency) each defined as a unsigned char value 0 .. 255.