vector3Mapper
Maps a Vector3 object to one of its components (x, y, or z) based on the specified dimension.
Return
the component value corresponding to the specified dimension
Parameters
v
the Vector3 object whose component is to be retrieved
dimension
the index representing the component to be retrieved (0 for x, 1 for y, others for z)