SetColor (inline)

...

Syntax

public const string enginedll = @"engine.dll";

public static void SetColor(Int64 owlInstanceColor, UInt32 ambient, UInt32 diffuse, UInt32 emissive, UInt32 specular)
        {
            System.Diagnostics.Debug.Assert(IsInstanceOfClass(owlInstanceColor, "Color"));

            {
                Int64 card = 0;
                IntPtr valuesPtr = IntPtr.Zero;
                GetObjectProperty(owlInstanceColor, GetPropertyByName(GetModel(owlInstanceColor), "ambient"), out valuesPtr, out card);

                if (card == 1)
                {
                    Int64[] values = new Int64[card];
                    System.Runtime.InteropServices.Marshal.Copy(valuesPtr, values, 0, (int) card);
                    SetColorOfComponent(values[0], ambient);
                }
                else
                {
                    SetColorOfComponent(CreateInstance(GetClassByName(GetModel(owlInstanceColor), "ColorComponent")), ambient);
                }
            }

            {
                Int64 card = 0;
                IntPtr valuesPtr = IntPtr.Zero;
                GetObjectProperty(owlInstanceColor, GetPropertyByName(GetModel(owlInstanceColor), "diffuse"), out valuesPtr, out card);

                if (card == 1)
                {
                    Int64[] values = new Int64[card];
                    System.Runtime.InteropServices.Marshal.Copy(valuesPtr, values, 0, (int) card);
                    SetColorOfComponent(values[0], diffuse);
                }
                else
                {
                    SetColorOfComponent(CreateInstance(GetClassByName(GetModel(owlInstanceColor), "ColorComponent")), diffuse);
                }
            }

            {
                Int64 card = 0;
                IntPtr valuesPtr = IntPtr.Zero;
                GetObjectProperty(owlInstanceColor, GetPropertyByName(GetModel(owlInstanceColor), "emissive"), out valuesPtr, out card);

                if (card == 1)
                {
                    Int64[] values = new Int64[card];
                    System.Runtime.InteropServices.Marshal.Copy(valuesPtr, values, 0, (int) card);
                    SetColorOfComponent(values[0], emissive);
                }
                else
                {
                    SetColorOfComponent(CreateInstance(GetClassByName(GetModel(owlInstanceColor), "ColorComponent")), emissive);
                }
            }

            {
                Int64 card = 0;
                IntPtr valuesPtr = IntPtr.Zero;
                GetObjectProperty(owlInstanceColor, GetPropertyByName(GetModel(owlInstanceColor), "specular"), out valuesPtr, out card);

                if (card == 1)
                {
                    Int64[] values = new Int64[card];
                    System.Runtime.InteropServices.Marshal.Copy(valuesPtr, values, 0, (int) card);
                    SetColorOfComponent(values[0], specular);
                }
                else
                {
                    SetColorOfComponent(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.