After guys
I am currently working with the iOS ARKit, I am currently trying to implement a piece of code
func getChildBoundingBox() -> (v1: SCNVector3, v2: SCNVector3) {
let firstChild = self.childNodes[0]
return (firstChild.boundingBox.max, firstChild.boundingBox.min)
}
Using the SceneKit code, I should be able to use the
boundingBox.Min and Max
But these are hidden behind
GetBoundingBox()
Which requires refs but cannot pass itself
Should I be using Urho instead of SceneKit as according to this API page
Urho.BoundingBox/
These are exposed in the Urho Lib
Oh , sorry for my misunderstanding.
I check the documentation with swift and Objective-C
boundingBox in Objective-C which export to c#
Actually They two are the same function .
So the solution
bool getChildBoundingBox(ref SCNVector3 max , ref SCNVector3 min) { var firstChild = this.childNodes[0]; return firstChild.GetBoundingBox(ref max, ref min); }
Usage
SCNVector3 _max = new SCNVector3(); SCNVector3 _min = new SCNVector3(); getChildBoundingBox(ref _max, ref _min);
Answers
This is swift function which returns tuples . You can convert it to C# in this way .
then you can access the value by
@ColeX
Thats great but this does not exist in the xamarin library
firstChild.boundingBox.max, firstChild.boundingBox.min }
The only methods / Properties that are exposed are GetBoundingBox()
So the real question is, what am I meant to be passing as refs
And it returns a bool
so not even the values I need lol
Oh , sorry for my misunderstanding.
I check the documentation with swift and Objective-C
boundingBox in Objective-C which export to c#
boundingBox in swift
Actually They two are the same function .
So the solution
Usage
@ColeX
Cheers, that seems to of got it
Long day friday and heavy weekend did not help with my logic