|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Updates the current user's position inside an MMORoom. More...
#include <SetUserPositionRequest.h>
Public Member Functions | |
| SetUserPositionRequest (entities::Vec3D position, std::shared_ptr< entities::Room > room=nullptr) | |
Updates the current user's position inside an MMORoom.
MMORooms represent virtual environments and can host any number of users. Based on their position, the system lets users within a certain range of each other (their Area of Interest) interact. This request updates the position of the current user, which in turn triggers a PROXIMITY_LIST_UPDATE event for every user whose AoI he entered or left.
NOTE: the coordinates must use the same numeric mode (integer or float) as the Room's area of interest, which is what fixes the Room's coordinates system when it is created. A mismatch is refused by the server.
sfs.send(requests::SetUserPositionRequest(entities::Vec3D::ofInt(120, 50)));
|
inline |
| position | the user's new position |
| room | the MMORoom where the position should be set; if nullptr, the last Room joined by the current user is used |