GetDistance

This function returns the shortest distance between two instances.

Syntax

//
//   Strong typing definition
//
double          GetDistance(
                        OwlInstance             firstOwlInstance,
                        OwlInstance             secondOwlInstance,
                        double                  * pointFirstInstance,
                        double                  * pointSecondInstance,
                        bool                    allowCalculateInstance
                    );

static  inline  double  GetDistance(
                                OwlInstance             firstOwlInstance,
                                OwlInstance             secondOwlInstance
                            )
{
    return  GetDistance(
                    firstOwlInstance,
                    secondOwlInstance,
                    nullptr,                            //    pointFirstInstance
                    nullptr,                            //    pointSecondInstance
                    true                                //    allowCalculateInstance
                );
}

static  inline  double  GetDistance(
                                OwlInstance             firstOwlInstance,
                                OwlInstance             secondOwlInstance,
                                double                  * pointFirstInstance,
                                double                  * pointSecondInstance
                            )
{
    return  GetDistance(
                    firstOwlInstance,
                    secondOwlInstance,
                    pointFirstInstance,
                    pointSecondInstance,
                    true                                //    allowCalculateInstance
                );
}


//
//   Weak typing definition
//
double  __declspec(dllexport) __stdcall GetDistance(
                                                int64_t                 firstOwlInstance,
                                                int64_t                 secondOwlInstance,
                                                double                  * pointFirstInstance,
                                                double                  * pointSecondInstance,
                                                bool                    allowCalculateInstance
                                            );

static  inline  double  GetDistance(
                                int64_t                 firstOwlInstance,
                                int64_t                 secondOwlInstance
                            )
{
    return  GetDistance(
                    firstOwlInstance,
                    secondOwlInstance,
                    nullptr,                            //    pointFirstInstance
                    nullptr,                            //    pointSecondInstance
                    true                                //    allowCalculateInstance
                );
}

static  inline  double  GetDistance(
                                int64_t                 firstOwlInstance,
                                int64_t                 secondOwlInstance,
                                double                  * pointFirstInstance,
                                double                  * pointSecondInstance
                            )
{
    return  GetDistance(
                    firstOwlInstance,
                    secondOwlInstance,
                    pointFirstInstance,
                    pointSecondInstance,
                    true                                //    allowCalculateInstance
                );
}
    

Property firstOwlInstance

Size: 64 bit / 8 byte (value)
The handle to the specific instance in the design tree.

Property secondOwlInstance

Size: 64 bit / 8 byte (value)
The handle to the specific instance in the design tree.

Property pointFirstInstance

Size: 64 bit / 8 byte (reference)
The pointFirstInstance is expected to be a 3 element double value allocated by the host (i.e. 24 bytes). The function will fill in X, Y, Z as the point in the shape of the first instance closest to the second instance.

Property pointSecondInstance

Size: 64 bit / 8 byte (reference)
The pointSecondInstance is expected to be a 3 element double value allocated by the host (i.e. 24 bytes). The function will fill in X, Y, Z as the point in the shape of the second instance closest to the first instance.

Property allowCalculateInstance

Size: 8 bit / 1 byte (value)
In case one or both instances require recalculation this property defines if this should be executed.