The three numbers at the end describe a vector. They don't have to be just -1, 0 or 1. They can be any number and specifically, decimal points. While 0,0,1 describes a direction down the Z axis and 1,0,0 describes a direction down the X axis, 1,0,1 describes as direction half way between the X and Z axis, as does 0.5,0,0.5.
The easiest way to get your vector if you don't understand the maths is this:
Point your object in the direction you want to ray cast.
Save the object position.
Move the object forward 1.
Save the new position.
Move the object back 1 (to put it back to where it was).
Then use the old and new position to make the vector.
In code that looks like this:
rotate object playerObj,x#,y#,z# `get you player pointing in whichever direction (but he's probably already pointing in the right direction, so dont bother with this bit).
`Save position of player
x# = object position x(playerObj)
y# = object position y(playerObj)
z# = object position z(playerObj)
`Move player in direction you want to fire bullet
move object playerObj, 1
`Work out x,y,z vectors by just subtracting the old position from the new position
xvec# = object position x(playerObj) - x#
yvec# = object position y(playerObj) - y#
zvec# = object position z(playerObj) - z#
`Put the player back into the correct position
move object playerObj,-1
`Now cast your ray
temp = phy ray cast all shapes(x#,y#,z#,xvec#,yvec#,zvec#)