AgentPrivate

AgentPrivate Class

The AgentPrivate class is the full interface for interactions with avatars.

Syntax

[Sansar.Script.Interface]
public class AgentPrivate : Sansar.Script.InstanceInterface

Exceptions

Type Reason
NullReferenceException Thrown when using an AgentPrivate for a user who is no longer in the region.

Remarks

Use via AgentScript.AgentPrivate to access APIs for the agent the script is on.Agents may leave at any time. Attempting to use an Agent interface for an agent no longer in the scene will throw a NullReferenceException.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Properties

[read-only]
AgentInfo AgentInfo . Returns the Sansar.Simulation.AgentInfo for this instance.
[read-only]
Client Client . Returns the Sansar.Simulation.Client for this instance.
[read-only]
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

  GetControlPointEnabled (ControlPointType) : bool
Retrieves whether the control point is enabled.
  GetControlPointOrientation (ControlPointType) : Sansar.Quaternion
Retrieves the orientation in character relative space of the specified control point.
  GetControlPointPosition (ControlPointType) : Sansar.Vector
Retrieves the position in character relative space of the specified control point.
  GetGravityFactor () : float
Retrieves what factor of the world's gravity is applied to this agent.
  GetHeldRigidBodies () : IEnumerable<RigidBodyComponent>
Retrieves a list of Sansar.Simulation.RigidBodyComponent that this agent is currently holding.
  IgnoreCollisionWith (RigidBodyComponent, bool)
Sets whether this agent will ignore collisions with a specific Sansar.Simulation.RigidBodyComponent
  IgnoreCollisionWith (RigidBodyComponent, bool, Action<Sansar.Script.OperationCompleteEvent>)
Sets whether this agent will ignore collisions with a specific Sansar.Simulation.RigidBodyComponent
  IsCollisionIgnoredWith (RigidBodyComponent) : bool
Checks whether an agent is ignoring collisions with a specific Sansar.Simulation.RigidBodyComponent.
  OverrideAudioStream (string)
Overrides source of web audio streams.
  OverrideAudioStream (string, Action<Sansar.Script.OperationCompleteEvent>)
Overrides source of web audio streams.
  OverrideMediaSource (string)
Sets stream channel source.
  OverrideMediaSource (string, int, int)
Overrides source of media surfaces.
  OverrideMediaSource (string, int, int, Action<Sansar.Script.OperationCompleteEvent>)
Overrides source of media surfaces.
  PerformMediaAction (MediaAction)
Performs a specific action on the current media surface.
  PerformMediaAction (MediaAction, Action<Sansar.Script.OperationCompleteEvent>)
Performs a specific action on the current media surface.
  PlaySound (SoundResource, PlaySettings) : PlayHandle
Play sound to direct output.
  PlaySoundAtPosition (SoundResource, Sansar.Vector, PlaySettings) : PlayHandle
Play sound at specified position.
  PlaySoundOnComponent (SoundResource, AudioComponent, PlaySettings) : PlayHandle
Play sound on a component (and follows its position).
  PlayStream (StreamChannel, float) : PlayHandle
Play audio stream to direct output.
  PlayStreamAtPosition (StreamChannel, Sansar.Vector, float) : PlayHandle
Play web audio stream at specified position.
  PlayStreamOnComponent (StreamChannel, AudioComponent, float) : PlayHandle
Play web audio stream on this component (and follow its position).
  SendChat (string)
Sends a string message to the $className$.
  SendChat (string, Action<Sansar.Script.OperationCompleteEvent>)
Sends a string message to the AgentPrivate.
  SetGravityFactor (float)
Sets what factor of the world's gravity is applied to this agent.
  SetGravityFactor (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets what factor of the world's gravity is applied to this agent.
override
ToString () : string
A string representation of this object.

Member Details

AgentInfo Property

Returns the Sansar.Simulation.AgentInfo for this instance.

Syntax

[get: Sansar.Script.Interface]
public AgentInfo AgentInfo { get; }

Value

The Sansar.Simulation.AgentInfo for this instance

Remarks

The Sansar.Simulation.AgentInfo holds information about an agent.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Client Property

Returns the Sansar.Simulation.Client for this instance.

Syntax

[get: Sansar.Script.Interface]
public Client Client { get; }

Value

The Sansar.Simulation.Client for this instance

Remarks

The Sansar.Simulation.Client manages interactions with a client.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetControlPointEnabled Method

Retrieves whether the control point is enabled.

Syntax

[Sansar.Script.Interface]
public bool GetControlPointEnabled (ControlPointType type)

Parameters

type
See Sansar.Simulation.ControlPointType.

Returns

True if the control point is enabled. Control points are enabled when used.

Exceptions

Type Reason
ArgumentException Thrown if an invalid control point is specified.

Remarks

Control points are a representation of some spatial inputs, primarily VR controllers.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetControlPointOrientation Method

Retrieves the orientation in character relative space of the specified control point.

Syntax

[Sansar.Script.Interface]
public Sansar.Quaternion GetControlPointOrientation (ControlPointType type)

Parameters

type
See Sansar.Simulation.ControlPointType.

Returns

The orientation of the control point.

Exceptions

Type Reason
ArgumentException Thrown if an invalid control point is specified.

Remarks

Control points are a representation of some spatial inputs, primarily VR controllers.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetControlPointPosition Method

Retrieves the position in character relative space of the specified control point.

Syntax

[Sansar.Script.Interface]
public Sansar.Vector GetControlPointPosition (ControlPointType type)

Parameters

type
The control point to get the position of. See Sansar.Simulation.ControlPointType.

Returns

The position of the control point.

Exceptions

Type Reason
ArgumentException Thrown if an invalid control point is specified.

Remarks

Control points are a representation of some spatial inputs, primarily VR controllers.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetGravityFactor Method

Retrieves what factor of the world's gravity is applied to this agent.

Syntax

[Sansar.Script.Interface]
public float GetGravityFactor ()

Returns

The gravity factor.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetHeldRigidBodies Method

Retrieves a list of Sansar.Simulation.RigidBodyComponent that this agent is currently holding.

Syntax

[Sansar.Script.Interface]
public IEnumerable<RigidBodyComponent> GetHeldRigidBodies ()

Returns

a list of Sansar.Simulation.RigidBodyComponent

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

IgnoreCollisionWith Method

Sets whether this agent will ignore collisions with a specific Sansar.Simulation.RigidBodyComponent

Syntax

[Sansar.Script.Interface]
public void IgnoreCollisionWith (RigidBodyComponent rigidBodyComponent, bool ignoreBody)

Parameters

rigidBodyComponent
The RigidBodyComponent with which to change collision behavior.
ignoreBody
When true, collision will be added to the ignore list. When false, collision will removed from the ignore list.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

IgnoreCollisionWith Method

Sets whether this agent will ignore collisions with a specific Sansar.Simulation.RigidBodyComponent

Syntax

[Sansar.Script.Interface]
public void IgnoreCollisionWith (RigidBodyComponent rigidBodyComponent, bool ignoreBody, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

rigidBodyComponent
The RigidBodyComponent with which to change collision behavior.
ignoreBody
When true, collision will be added to the ignore list. When false, collision will removed from the ignore list.
handler
Handler to be called when the event completes.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

IsCollisionIgnoredWith Method

Checks whether an agent is ignoring collisions with a specific Sansar.Simulation.RigidBodyComponent.

Syntax

[Sansar.Script.Interface]
public bool IsCollisionIgnoredWith (RigidBodyComponent rigidBodyComponent)

Parameters

rigidBodyComponent
The RigidBodyComponent that could possibly be ignored.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

OverrideAudioStream Method

Overrides source of web audio streams.

Syntax

[Sansar.Script.Interface]
public void OverrideAudioStream (string url)

Parameters

url
URL to use.

Remarks

Applies to this agent only. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

OverrideAudioStream Method

Overrides source of web audio streams.

Syntax

[Sansar.Script.Interface]
public void OverrideAudioStream (string url, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

url
URL to use.
handler
Handler to be called when the event completes.

Remarks

Applies to this agent only. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

OverrideMediaSource Method

Sets stream channel source.

Syntax

[Sansar.Script.Interface]
public void OverrideMediaSource (string url)

Parameters

url
URL to use.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

OverrideMediaSource Method

Overrides source of media surfaces.

Syntax

[Sansar.Script.Interface]
public void OverrideMediaSource (string url, int mediaWidth, int mediaHeight)

Parameters

url
URL to use.
mediaWidth
(cMediaChannel only) source width.
mediaHeight
(cMediaChannel only) source height.

Remarks

Applies to this agent only. NOTE: this will cause a few seconds of silence while restarting starting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

OverrideMediaSource Method

Overrides source of media surfaces.

Syntax

[Sansar.Script.Interface]
public void OverrideMediaSource (string url, int mediaWidth, int mediaHeight, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

url
URL to use.
mediaWidth
(cMediaChannel only) source width.
mediaHeight
(cMediaChannel only) source height.
handler
Handler to be called when the event completes.

Remarks

Applies to this agent only. NOTE: this will cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PerformMediaAction Method

Performs a specific action on the current media surface.

Syntax

[Sansar.Script.Interface]
public void PerformMediaAction (MediaAction action)

Parameters

action
The action to perform.

Remarks

Applies to this agent only.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PerformMediaAction Method

Performs a specific action on the current media surface.

Syntax

[Sansar.Script.Interface]
public void PerformMediaAction (MediaAction action, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

action
The action to perform.
handler
Handler to be called when the event completes.

Remarks

Applies to this agent only.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlaySound Method

Play sound to direct output.

Syntax

[Sansar.Script.Interface]
public PlayHandle PlaySound (SoundResource soundResource, PlaySettings playSettings)

Parameters

soundResource
The sound resource to play.
playSettings
The play parameters.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlaySoundAtPosition Method

Play sound at specified position.

Syntax

[Sansar.Script.Interface]
public PlayHandle PlaySoundAtPosition (SoundResource soundResource, Sansar.Vector position, PlaySettings playSettings)

Parameters

soundResource
The sound resource to play.
position
The absolute position.
playSettings
The play parameters.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlaySoundOnComponent Method

Play sound on a component (and follows its position).

Syntax

[Sansar.Script.Interface]
public PlayHandle PlaySoundOnComponent (SoundResource soundResource, AudioComponent audioComponent, PlaySettings playSettings)

Parameters

soundResource
The sound resource to play.
audioComponent
The audio component to play this on.
playSettings
The play parameters.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only. As the component moves, this sound will follow the component's location.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlayStream Method

Play audio stream to direct output.

Syntax

[Sansar.Script.Interface]
public PlayHandle PlayStream (StreamChannel streamChannel, float loudness)

Parameters

streamChannel
Channel of the audio stream to play.
loudness
Relative loudness in dB.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlayStreamAtPosition Method

Play web audio stream at specified position.

Syntax

[Sansar.Script.Interface]
public PlayHandle PlayStreamAtPosition (StreamChannel streamChannel, Sansar.Vector position, float loudness)

Parameters

streamChannel
Channel of the audio stream to play.
position
The absolute position.
loudness
Relative loudness in dB.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

PlayStreamOnComponent Method

Play web audio stream on this component (and follow its position).

Syntax

[Sansar.Script.Interface]
public PlayHandle PlayStreamOnComponent (StreamChannel streamChannel, AudioComponent audioComponent, float loudness)

Parameters

streamChannel
Channel of the audio stream to play.
audioComponent
The audio component to play this on.
loudness
Relative loudness in dB.

Returns

The play handle for controlling playback.

Remarks

Plays for this agent only. As the component moves, this sound will follow the component's location.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SendChat Method

Sends a string message to the $className$.

Syntax

[Sansar.Script.Interface]
public void SendChat (string message)

Parameters

message
The message to send.

Exceptions

Type Reason
NullReferenceException If the user is no longer online.
Sansar.Script.ThrottleException If the throttle rate is exceeded.

Remarks

eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SendChat Method

Sends a string message to the AgentPrivate.

Syntax

[Sansar.Script.Interface]
public void SendChat (string message, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

message
The message to send.
handler
Handler to be called when the event completes.

Remarks

Messages may be throttled and ignored.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetGravityFactor Method

Sets what factor of the world's gravity is applied to this agent.

Syntax

[Sansar.Script.Interface]
public void SetGravityFactor (float gravityFactor)

Parameters

gravityFactor
The gravityFactor. Default value is 1, range is -2 to 2

Returns

The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetGravityFactor Method

Sets what factor of the world's gravity is applied to this agent.

Syntax

[Sansar.Script.Interface]
public void SetGravityFactor (float gravityFactor, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

gravityFactor
The gravityFactor. Default value is 1, range is -2 to 2
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface]
public override string ToString ()

Returns

A string representation of this object.

Remarks

The format of this string may change between releases.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0


Was this article helpful?
1 out of 2 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.