Body
Functions for interacting with bodies.
Functions
Type | Name |
---|---|
void | vrBodyAddImpulse(vrvec3 position_vector, vrvec3 rotation_vector =vec3d::Zero) Applies delta to the camera as if the mouse was used to move it. |
void | vrBodyAddImpulseMouse(number x, number y, string mode =0) Moves the camera by simulating mouse movement. |
void | vrBodyClearImpulse(boolean b) Resets the delta of the camera. |
void | vrBodyConnectView(vrnode user =nil) Connects to a users body. |
void | vrBodyFlyTo(vrnode node, number time, boolean immersive =false, boolean addToStack =false) Flies the body to the world position of node, over time seconds. |
void | vrBodyFlyToFit(vrnode node, number time, number fillFraction =CameraFlyManager::Fill_Default, boolean immersive =false, boolean addToStack =false) Flies the body to a position where it can see the whole of node from that angle, over time seconds. |
void | vrBodyFlyToFitBounds(vrnode node, number time, number fillFraction =1.0) Flies the body to a position where it can see the whole of node, over time seconds. |
void | vrBodyFlyToFitSphere(vrvec3 center, number radius, number time, number fillFraction =1.0) Flies the body to a position where it can see the whole of a bounding sphere, over time seconds. |
void | vrBodyFlyToLookAt(vrnode node =nil, number time, vrvec3 direction) Flies the body to a position where it is looking at the selected object from the specified direction, over time seconds. |
void | vrBodyFlyToWorldPos(vrvec3 pos, vrvec3 rot, number time, boolean fadeInOut =false, boolean addToStack =false, vrnode user =nil) Flies the body to a specific position and rotation, over time seconds. |
vrnode | vrBodyGetViewConnection() Returns the object to which the view is currently connected. |
MULTI< vrvec3, vrvec3 > | vrBodyGetWorldPos(vrnode user =nil) Gets the user's body position and rotation. |
void | vrBodyLookAt(vrnode subjectNode, number time) Rotates the body so that it is looking at subjectNode, over time seconds. |
void | vrBodySetAng(vrvec3 direction) Sets the orientation of the body. |
void | vrBodySetOrbitPoint(vrvec3 orbit_vector) Sets the camera's orbit point. |
void | vrBodySetPitch(number pitch) Sets the pitch of the body. |
void | vrBodySetRoll(number roll) Sets the roll of the body. |
void | vrBodySetWorldPos(vrvec3 pos, vrvec3 rot, vrnode user =nil) Sets the body position and rotation instantly. |
void | vrBodyStepBack(number time, boolean fadeInOut) Steps back to the previous viewport or camera position. |
void | vrBodyStepForward(number time, boolean fadeInOut) Steps forward to the next viewport or camera position. |
vrnode | vrGetBody(vrnode user =nil) Gets the body currently controlling the user's view. |
vrnode | vrGetLocalBody() Gets the local body, regardless of any remote connections. |
void | vrPositionAtBody(vrnode node) Moves a node to the user's current position and orientation. |
Functions Documentation
vrBodyAddImpulse
void vrBodyAddImpulse(
vrvec3 position_vector,
vrvec3 rotation_vector =vec3d::Zero
)
Applies delta to the camera as if the mouse was used to move it.
Parameters:
- position_vector Amount of force to apply to positional movement
- rotation_vector Amount of force to apply to rotation
vrBodyAddImpulseMouse
void vrBodyAddImpulseMouse(
number x,
number y,
string mode =0
)
Moves the camera by simulating mouse movement.
Parameters:
-
x Distance of horizontal mouse movement. Negative values are left, positive are right
-
y Distance of vertical mouse movement. Positive values are up, negative are down
-
mode The mode of mouse control:
-
LOOK
-
PAN
-
ORBIT
vrBodyClearImpulse
void vrBodyClearImpulse(
boolean b
)
Resets the delta of the camera.
Parameters:
- b Bool whether to apply the reset or not
vrBodyConnectView
void vrBodyConnectView(
vrnode user =nil
)
Connects to a users body.
Parameters:
- user The user node to connect to
vrBodyFlyTo
void vrBodyFlyTo(
vrnode node,
number time,
boolean immersive =false,
boolean addToStack =false
)
Flies the body to the world position of node, over time seconds.
Parameters:
- immersive Whether or not to apply the immersive flyto animation
- addToStack Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward
vrBodyFlyToFit
void vrBodyFlyToFit(
vrnode node,
number time,
number fillFraction =CameraFlyManager::Fill_Default,
boolean immersive =false,
boolean addToStack =false
)
Flies the body to a position where it can see the whole of node from that angle, over time seconds.
Parameters:
- node The node to fly to
- time The number of seconds to fly
- fillFraction Optional, defines how much of the screen the object will take up. 0.0 to 1.0
- immersive Whether or not to apply the immersive flyto animation
- addToStack Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward
vrBodyFlyToFitBounds
void vrBodyFlyToFitBounds(
vrnode node,
number time,
number fillFraction =1.0
)
Flies the body to a position where it can see the whole of node, over time seconds.
Parameters:
- node The node to fly to
- time The number of seconds to fly
- fillFraction Optional, defines how much of the screen the object will take up. 0.0 to 1.0
vrBodyFlyToFitSphere
void vrBodyFlyToFitSphere(
vrvec3 center,
number radius,
number time,
number fillFraction =1.0
)
Flies the body to a position where it can see the whole of a bounding sphere, over time seconds.
Parameters:
- center The centre of the sphere
- radius The radius of the sphere
- time The number of seconds to fly
- fillFraction defines how much of the screen the object will take up. 0.0 to 1.0
vrBodyFlyToLookAt
void vrBodyFlyToLookAt(
vrnode node =nil,
number time,
vrvec3 direction
)
Flies the body to a position where it is looking at the selected object from the specified direction, over time seconds.
Parameters:
- node The node to fly to
- time The number of seconds to fly
- direction A unit direction vector in world coordinates
vrBodyFlyToWorldPos
void vrBodyFlyToWorldPos(
vrvec3 pos,
vrvec3 rot,
number time,
boolean fadeInOut =false,
boolean addToStack =false,
vrnode user =nil
)
Flies the body to a specific position and rotation, over time seconds.
Parameters:
- fadeInOut Whether to fade the view when moving to this location
- addToStack Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward
- user User to move (defaults to local user)
vrBodyGetViewConnection
vrnode vrBodyGetViewConnection()
Returns the object to which the view is currently connected.
vrBodyGetWorldPos
MULTI< vrvec3, vrvec3 > vrBodyGetWorldPos(
vrnode user =nil
)
Gets the user's body position and rotation.
Parameters:
- user The user to query (defaults to local user)
Return:
- User's world position
- User's world rotation
vrBodyLookAt
void vrBodyLookAt(
vrnode subjectNode,
number time
)
Rotates the body so that it is looking at subjectNode, over time seconds.
vrBodySetAng
void vrBodySetAng(
vrvec3 direction
)
Sets the orientation of the body.
Parameters:
- direction X,Y,Z rotation values in degrees
vrBodySetOrbitPoint
void vrBodySetOrbitPoint(
vrvec3 orbit_vector
)
Sets the camera's orbit point.
Parameters:
- orbit_vector The position of the orbit point
vrBodySetPitch
void vrBodySetPitch(
number pitch
)
Sets the pitch of the body.
Parameters:
- pitch Pitch in degrees
vrBodySetRoll
void vrBodySetRoll(
number roll
)
Sets the roll of the body.
Parameters:
- roll Roll in degrees
vrBodySetWorldPos
void vrBodySetWorldPos(
vrvec3 pos,
vrvec3 rot,
vrnode user =nil
)
Sets the body position and rotation instantly.
Parameters:
- pos World position
- rot World rotation
- user User to move (defaults to local user)
vrBodyStepBack
void vrBodyStepBack(
number time,
boolean fadeInOut
)
Steps back to the previous viewport or camera position.
vrBodyStepForward
void vrBodyStepForward(
number time,
boolean fadeInOut
)
Steps forward to the next viewport or camera position.
vrGetBody
vrnode vrGetBody(
vrnode user =nil
)
Gets the body currently controlling the user's view.
Parameters:
- user User's body to get (defaults to local user)
vrGetLocalBody
vrnode vrGetLocalBody()
Gets the local body, regardless of any remote connections.
vrPositionAtBody
void vrPositionAtBody(
vrnode node
)
Moves a node to the user's current position and orientation.
Parameters:
- node The node to move