GetCenter
There are two ways to call GetCenter:
vertexBuffer and indexBuffer are both zero: in this case the instance will be
recalculated when needed. It is expected the client does not
need the arrays itself or there is no performance issue.
vertexBuffer and indexBuffer are both given: the call is placed directly after
updateBuffer calls and no structural change to depending instances have
been done in between. The transformationMatrix array is not needed,
even if it is being used due to not giving any performance gain to this
operation.
Note: internally the call does not store its results, any optimization based on known
dependancies between instances need to be implemented on the client.
Note: in case precision is important and vertex array is 32 bit it is advised to
set vertexBuffer and indexBuffer to 0 even if arrays are existing.
Syntax
public const string enginedll = @"engine.dll"; [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref float vertexBuffer, ref Int32 indexBuffer, out double center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref float vertexBuffer, ref Int32 indexBuffer, double[] center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref float vertexBuffer, ref Int64 indexBuffer, out double center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref float vertexBuffer, ref Int64 indexBuffer, double[] center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref double vertexBuffer, ref Int32 indexBuffer, out double center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref double vertexBuffer, ref Int32 indexBuffer, double[] center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref double vertexBuffer, ref Int64 indexBuffer, out double center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, ref double vertexBuffer, ref Int64 indexBuffer, double[] center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, IntPtr vertexBuffer, IntPtr indexBuffer, out double center); [DllImport(enginedll, EntryPoint = "GetCenter")] public static extern void GetCenter(Int64 owlInstance, IntPtr vertexBuffer, IntPtr indexBuffer, double[] center); public static void GetCenter(Int64 owlInstance, out double center) { GetCenter(owlInstance, IntPtr.Zero, IntPtr.Zero, out center); }