Class AvatarSpaceComponent
Defined in File AvatarSpaceComponent.h
Inheritance Relationships
Base Type
public csp::multiplayer::ComponentBase
(Class ComponentBase)
Class Documentation
-
class AvatarSpaceComponent : public csp::multiplayer::ComponentBase
Data representation of an AvatarSpaceComponent.
Public Functions
-
AvatarSpaceComponent(SpaceEntity *Parent)
Constructs the avatar space component, and associates it with the specified Parent space entity.
- Parameters
Parent – The Space entity that owns this component.
-
const csp::common::String &GetAvatarId() const
Gets the ID for the avatar of this avatar component.
Note
Used for selecting a specific avatar depending on the user’s preferences.
- Returns
The ID of the currently active avatar of this avatar component.
-
void SetAvatarId(const csp::common::String &Value)
Sets the ID for the avatar of this avatar component.
Note
Used for selecting a specific avatar depending on the user’s preferences.
- Parameters
Value – The ID of the currently active avatar of this avatar component.
-
const csp::common::String &GetUserId() const
Gets the ID of the user that controls this avatar.
- Returns
The ID of the user controlling this avatar.
-
void SetUserId(const csp::common::String &Value)
Sets the ID of the user that controls this avatar.
- Parameters
Value – The ID of the user controlling this avatar.
-
AvatarState GetState() const
Gets the state of the current avatar.
- Returns
The state of the current avatar.
-
void SetState(AvatarState Value)
Sets the state of the current avatar.
- Parameters
Value – The state of the current avatar.
-
AvatarPlayMode GetAvatarPlayMode() const
Gets the play mode used by this avatar.
- Returns
The play mode used by this avatar.
-
void SetAvatarPlayMode(AvatarPlayMode Value)
Sets the play mode used by this avatar.
- Parameters
Value – The play mode used by this avatar.
-
const int64_t GetAvatarMeshIndex() const
Gets the ID of the mesh of the avatar of this component.
Note
Used to establish which mesh this avatar should use among a collection of predefined meshes.
- Returns
The ID of the mesh of the avatar of this component.
-
void SetAvatarMeshIndex(int64_t Value)
Sets the ID of the mesh of the avatar of this component.
Note
Used to establish which mesh this avatar should use among a collection of predefined meshes.
- Parameters
Value – The ID of the mesh of the avatar of this component.
-
const csp::common::String &GetAgoraUserId() const
Gets the ID of the Agora user bounded to this avatar.
Note
When using voice chat, an Agora user is associated with a specific avatar component, so that it is possible to associate the person speaking via the Agora voice chat through the relative avatar.
- Returns
The ID of the Agora user associated with this avatar component.
-
void SetAgoraUserId(const csp::common::String &Value)
Sets the ID of the Agora user bounded to this avatar.
Note
When using voice chat, an Agora user is associated with a specific avatar component, so that it is possible to associate the person speaking via the Agora voice chat through the relative avatar.
- Parameters
Value – The ID of the Agora user associated with this avatar component.
-
const csp::common::String &GetCustomAvatarUrl() const
Gets the URL of a custom mesh for this avatar.
Note
This is intended for use with external avatar managers, such as ReadyPlayerMe.
- Returns
The URL of the custom mesh this avatar component uses for its avatar.
-
void SetCustomAvatarUrl(const csp::common::String &Value)
Sets the URL of a custom mesh for this avatar.
Note
This is intended for use with external avatar managers, such as ReadyPlayerMe.
- Parameters
Value – The URL of the custom mesh this avatar component uses for its avatar.
-
const bool GetIsHandIKEnabled() const
Checks if the Hands Inverse Kinematics (IK) are enabled for this avatar.
Note
Intended for use in VR or with virtual hands controllers.
- Returns
True if the avatar uses IK, false otherwise.
-
void SetIsHandIKEnabled(bool Value)
Sets if the Hands Inverse Kinematics (IK) are enabled for this avatar.
Note
Intended for use in VR or with virtual hands controllers.
- Parameters
Value – True if the avatar uses IK, false otherwise.
-
const csp::common::Vector3 &GetTargetHandIKTargetLocation() const
Gets the location of the target used for the hands IK.
Note
Used in combination with hand IK if enabled.
- Returns
The tartget location to use for the hands IK.
-
void SetTargetHandIKTargetLocation(const csp::common::Vector3 &Value)
Sets the location of the target used for the hands IK.
Note
Used in combination with hand IK if enabled.
- Parameters
Value – The tartget location to use for the hands IK.
-
const csp::common::Vector4 &GetHandRotation() const
Gets the rotation of the avatar hand.
Note
The coordinate system respects the following conventions:
Right handed coordinate system
Positive rotation is counterclockwise
The geographic North is along the positive Z axis (+Z) at an orientation of 0 degrees.
North: +Z
East: -X
South: -Z
West: +X
- Returns
The rotation of the avatar hand.
-
void SetHandRotation(const csp::common::Vector4 &Value)
Sets the rotation of the avatar hand.
Note
The coordinate system respects the following conventions:
Right handed coordinate system
Positive rotation is counterclockwise
The geographic North is along the positive Z axis (+Z) at an orientation of 0 degrees.
North: +Z
East: -X
South: -Z
West: +X
- Parameters
Value – The tartget location to use for the hands IK.
-
const csp::common::Vector4 &GetHeadRotation() const
Gets the rotation of the avatar head.
Note
The coordinate system respects the following conventions:
Right handed coordinate system
Positive rotation is counterclockwise
The geographic North is along the positive Z axis (+Z) at an orientation of 0 degrees.
North: +Z
East: -X
South: -Z
West: +X
- Returns
The rotation of the avatar head.
-
void SetHeadRotation(const csp::common::Vector4 &Value)
Sets the rotation of the avatar head.
Note
The coordinate system respects the following conventions:
Right handed coordinate system
Positive rotation is counterclockwise
The geographic North is along the positive Z axis (+Z) at an orientation of 0 degrees.
North: +Z
East: -X
South: -Z
West: +X
- Parameters
Value – The rotation of the avatar head.
-
const float GetWalkRunBlendPercentage() const
Gets blending between walk and run states expressed in percentage.
Note
Used to calculate a smooth transition between an avatar walking and an avatar running. When 0 the avatar is fully walking, when 100 the avatar is fully running.
- Returns
The percentage of the blending between walk and run states.
-
void SetWalkRunBlendPercentage(float Value)
Sets blending between walk and run states expressed in percentage.
Note
Used to calculate a smooth transition between an avatar walking and an avatar running. When 0 the avatar is fully walking, when 100 the avatar is fully running.
- Parameters
Value – The percentage of the blending between walk and run states.
-
const float GetTorsoTwistAlpha() const
Gets the angle to use to twist the avatar’s torso.
Note
To calculate the twist of the avatar torso, it is convention to evaluate the difference between the avatar’s hip forward direction and the avatar’s head forward direction. The greater the difference, the further the torso should be twisted. Positive value if the torso is turning right, negative if avatar is turning left.
- Returns
The angle to use to twist the avatar’s torso.
-
void SetTorsoTwistAlpha(float Value)
Sets the angle to use to twist the avatar’s torso.
Note
To calculate the twist of the avatar torso, it is convention to evaluate the difference between the avatar’s hip forward direction and the avatar’s head forward direction. The greater the difference, the further the torso should be twisted. Positive value if the torso is turning right, negative if avatar is turning left.
- Parameters
Value – The angle to use to twist the avatar’s torso.
-
const csp::common::Vector3 &GetMovementDirection() const
Gets a vector that represents the movement direction of the avatar.
- Returns
The vector representing the movement direction of the avatar.
-
void SetMovementDirection(const csp::common::Vector3 &Value)
Sets a vector that represents the movement direction of the avatar.
- Parameters
Value – The vector representing the movement direction of the avatar.
-
LocomotionModel GetLocomotionModel() const
Specifies which locomotion model this avatar component is using.
- Returns
The locomotion model used by this avatar component.
-
void SetLocomotionModel(LocomotionModel Value)
Sets which locomotion model this avatar component is using.
- Parameters
Value – The locomotion model used by this avatar component.
-
AvatarSpaceComponent(SpaceEntity *Parent)