hi,
i'm trying to implement ageia physX in my application using blitzmax/irrlicht/rubux. the first test are working very well, but i am pretty new to blitzmax and i am stuck now at some casting problem(i think) regarding setting a userdata struct to a physX body.
the code i'm trying to get to work:
the problem is that
expects data to be an int, so i thought i'd make an int pointer to my data type and pass that, but apparently such code does no longer work in the later versions of blitzMax.
i realize that the type pointer issue has been discussed before, and i am sorry to bring this up again, but i have failed to find a solution for my case in earlier posts, so i was hoping that someone could help me shed some light on this issue, maybe a workaround or some clever way to pull this off...
for what its worth, this is the code from physX sdk that i am trying to achieve in blitzmax:
i'm trying to implement ageia physX in my application using blitzmax/irrlicht/rubux. the first test are working very well, but i am pretty new to blitzmax and i am stuck now at some casting problem(i think) regarding setting a userdata struct to a physX body.
the code i'm trying to get to work:
Type TPXData Field data1:Int = 123 Field data2:Int = 456 End Type Local data:TPXData = New TPXData pxBodySetBodyUserData(pxBody, data)
the problem is that
pxBodySetBodyUserData(pxBody, data)
expects data to be an int, so i thought i'd make an int pointer to my data type and pass that, but apparently such code does no longer work in the later versions of blitzMax.
i realize that the type pointer issue has been discussed before, and i am sorry to bring this up again, but i have failed to find a solution for my case in earlier posts, so i was hoping that someone could help me shed some light on this issue, maybe a workaround or some clever way to pull this off...
for what its worth, this is the code from physX sdk that i am trying to achieve in blitzmax:
struct MyData { int shapeColor; bool dangerous; }; NxShape * myShape = ...; MyData * data = new MyData; data->shapeColor = 3; data->dangerous = true; myShape->userData = data; //then you can define: bool isShapeDangerous(NxShape & s) { return ((MyData *)s.userData)->dangerous; }