Syntax
public const string enginedll = @"engine.dll";
public static void GetColor(Int64 owlInstanceColor, out UInt32 ambient, out UInt32 diffuse, out UInt32 emissive, out UInt32 specular)
{
System.Diagnostics.Debug.Assert(IsInstanceOfClass(owlInstanceColor, "Color"));
GetDefaultColor(GetModel(owlInstanceColor), out ambient, out diffuse, out emissive, out specular);
string[] componentNames = { "ambient", "diffuse", "emissive", "specular" };
UInt32[] componentColors = { ambient, diffuse, emissive, specular };
for (int i = 0; i < 4; i++)
{
if (componentColors[i] != 0)
{
Int64 card = 0;
IntPtr valuesPtr = IntPtr.Zero;
GetObjectProperty(owlInstanceColor, GetPropertyByName(GetModel(owlInstanceColor), componentNames[i]), out valuesPtr, out card);
if (card == 1)
{
Int64[] values = new Int64[card];
System.Runtime.InteropServices.Marshal.Copy(valuesPtr, values, 0, (int) card);
Int64 owlInstanceColorComponent = values[0];
componentColors[i] = GetColorOfComponent(owlInstanceColorComponent);
}
}
}
}
Property owlInstanceColor
Size: 64 bit / 8 byte (value)
The handle of the Color instance.
Property ambient
Size: 32 bit / 4 byte (reference)
Defines a pointer to the ambient color as a 32 bit value that will be filled by this call; 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 (reference)
Defines a pointer to the diffuse color as a 32 bit value that will be filled by this call; 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 (reference)
Defines a pointer to the emissive color as a 32 bit value that will be filled by this call; 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 (reference)
Defines a pointer to the specular color as a 32 bit value that will be filled by this call; 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.