Syntax
Result = dbPickObject(ScreenX, ScreenY, ObjectStart, ObjectEnd [, IgnoreCamera])
Description
This command will return the Object Number of the closest object at the specified screen coordinates. The objects that are tested against the 2D coordinate are only those within the Object Start and Object End range in order to speed up specific tests. If no object exists at the coordinate, a value of zero is returned. If an object number is returned, additional data will be generated and stored internally. This extra data can be retrieved using the dbGetPickVector and dbGetPickDistance commands. Be aware that there may be multiple cameras when picking objects. To make sure you are selecting the correct screen object, use the dbSetCurrentCamera command for the screen being rendered by that camera view. Do not use extreme camera range or object distances with this command, as this increases the inaccuracy of the raycast line being used internally. You can specify an optional parameter to ignore the camera orientation, which is usefulfor selecting objects that also ignore the influences of the camera.
See Also
dbGetPickDistance, dbGetPickVector, dbObjectInScreen, dbObjectScreenX, dbObjectScreenY, dbPickScreen