Hi,
I am trying to write a similar function to pick object, but that returns if the mouse is over the specified object instead of all objects.
float SelectedObject;
int InGameMouseOverObject(int obj) {
dbPickScreen(dbMouseX(),dbMouseY(),0.1);
float X1=dbGetPickVectorX()+dbCameraPositionX();
float Y1=dbGetPickVectorY()+dbCameraPositionY();
float Z1=dbGetPickVectorZ()+dbCameraPositionZ();
dbPickScreen(dbMouseX(),dbMouseY(),1000);
float X2=dbGetPickVectorX()+dbCameraPositionX();
float Y2=dbGetPickVectorY()+dbCameraPositionY();
float Z2=dbGetPickVectorZ()+dbCameraPositionZ();
SelectedObject=dbIntersectObject(obj,X1,Y1,Z1,X1,Y1,Z1);
return SelectedObject;
}
So in theory this just return more than 0 if the mouse is over the speicifed object.
But it only returns 0.
Any idea why?
Thanks,
Alex