GetVolume

This function calculates the volume of an instance. For perfomance reasons it is benefitial to call it with vertex and index array when the arrays are calculated anyway or Volume and Area are needed.

There are two ways to call GetVolume:

  • vertices and indices 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.
  • vertices and indices 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 vertices and indices to 0 even if arrays are existing.

Syntax

//   Visual Studio for Windows
public:
double __declspec(dllexport) __stdcall GetVolume(
            __int64        owlInstance,
            void           * vertices,
            void           * indices
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
double GetVolume(
            int64_t        owlInstance,
            void           * vertices,
            void           * indices
        );    

Property owlInstance

Size: 64 bit / 8 byte (value)
...

Property vertices

Size: 64 bit / 8 byte (reference)
...

Property indices

Size: 64 bit / 8 byte (reference)
...