working ray casting, made speed/rotation public