Thanks, guys!
I actually found another answer in Tutorial guide 2, but both of those look like they work as well! Here's an excerpt from my version of the code:
camX as float
camY as float
camZ as float
pointX as float
pointY as float
pointZ as float
dist as integer
camX = GetCameraX(1)
camY = GetCameraY(1)
camZ = GetCameraZ(1)
pointX = Get3DVectorXFromScreen(GetPointerX(), GetPointerY())
pointY = Get3DVectorYFromScreen(GetPointerX(), GetPointerY())
pointZ = Get3DVectorZFromScreen(GetPointerX(), GetPointerY())
dist = 1024
didWeHitAnObject = ObjectRayCast(0, camX, camY, camZ, camX+(pointX*dist), camY+(pointY*dist), camZ+(pointZ*dist))
And I didn't even have to do the trig myself. Using the center coordinates of the screen instead of GetPointer also works, if you're not using the pointer to select things and/or not resetting the position of the pointer for the purposes of mouselook.