Agent Info

Agent info, Private, Public, and Scripts docs.

AgentInfo Class

The AgentInfo class has basic information and IDs for an agent.

Syntax

Member Details

AvatarUuid Property

Returns the persona ID of the AgentInfo.

Syntax

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

Value

The persona ID of the AgentInfo

Remarks

Requirements

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


Handle Property

Returns the handle of the AgentInfo.

Syntax

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

Value

The handle of the AgentInfo

Remarks

Agent handles are unique.

Requirements

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


Name Property

Returns the name of the AgentInfo.

Syntax

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

Value

The name of the AgentInfo

Remarks

Requirements

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


ObjectId Property

Returns the ObjectId of the AgentInfo.

Syntax

Value

The object ID of the AgentInfo

Remarks

Requirements

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


Scale Property

Returns the scale for the user.

Syntax

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

Value

The scale of the user

Remarks

Requirements

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


SessionId Property

Returns the Id of the AgentInfo.

Syntax

Value

The id of the AgentInfo

Remarks

Requirements

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


Ticket Property

Returns the ticket for the user if they purchased one.

Syntax

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

Value

The ticket of the user

Remarks

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

Requirements

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



AgentPrivate Class

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

Syntax

Member Details

AgentInfo Property

Syntax

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

Value

The Sansar.Simulation.AgentInfo for this instance

Remarks

Requirements

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


Client Property

Syntax

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

Value

The Sansar.Simulation.Client for this instance

Remarks

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

TypeReason

Thrown if an invalid control point is specified.

Remarks

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

Parameters

type

See Sansar.Simulation.ControlPointType.

Returns

The orientation of the control point.

Exceptions

TypeReason

Thrown if an invalid control point is specified.

Remarks

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

Parameters

type

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

Returns

The position of the control point.

Exceptions

TypeReason

Thrown if an invalid control point is specified.

Remarks

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

Syntax

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

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

Syntax

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

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

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

Parameters

url

URL to use.

handler

Handler to be called when the event completes.

Remarks

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

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

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

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

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

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

Parameters

action

The action to perform.

handler

Handler to be called when the event completes.

Remarks

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

Parameters

soundResource

The sound resource to play.

playSettings

The play parameters.

Returns

The play handle for controlling playback.

Remarks

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

Parameters

soundResource

The sound resource to play.

position

The absolute position.

playSettings

The play parameters.

Returns

The play handle for controlling playback.

Remarks

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

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

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

Parameters

streamChannel

Channel of the audio stream to play.

loudness

Relative loudness in dB.

Returns

The play handle for controlling playback.

Remarks

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

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

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

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

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

TypeReason

If the user is no longer online.

If the throttle rate is exceeded.

Remarks

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

Parameters

message

The message to send.

handler

Handler to be called when the event completes.

Remarks

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

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

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

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

Requirements

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



AgentPublic Class

The AgentPublic class is a more limited subset of the Sansar.Simulation.AgentPrivate API for use by other scripts in the scene.

Syntax

Member Details

AgentInfo Property

Syntax

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

Value

The Sansar.Simulation.AgentInfo for this instance

Remarks

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

TypeReason

If the user is no longer online.

If the throttle rate is exceeded.

Remarks

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 AgentPublic.

Syntax

Parameters

message

The message to send.

handler

Handler to be called when the event completes.

Remarks

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

Requirements

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



AgentScript Class

Extend AgentScript to create a script to be attached directly to an agent. For future use: Sansar does not currently support adding scripts to agents.

Syntax

Member Details

AgentScript Constructor

This constructor is called before any properties have been set. Override Sansar.Script.ScriptBase.Init() to initialize the script after properties have been set.

Syntax

[Sansar.Script.Interface] protected AgentScript ()

Remarks

Requirements

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


AgentPrivate Property

The Agent API for the agent this script is attached to.

Syntax

[Sansar.Script.NonReflective] [get: Sansar.Script.Interface] public AgentPrivate AgentPrivate { protected get; set; }

Value

The Agent this script is attached to if the script is on an avatar, null otherwise.

Remarks

Requirements

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


ObjectPrivate Property

The ObjectPrivate this script is attached to if it is attached to an object.

Syntax

[Sansar.Script.NonReflective] [get: Sansar.Script.Interface] public ObjectPrivate ObjectPrivate { protected get; set; }

Value

The scene object this script is attached to if it is attached to an object, null otherwise.

Remarks

Requirements

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


ScenePublic Property

Basic scene information for the current scene.

Syntax

[Sansar.Script.NonReflective] [get: Sansar.Script.Interface] public ScenePublic ScenePublic { protected get; set; }

Value

The Scene this object is in.

Remarks

Requirements

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



Have more questions? Ask in our Discord!

Last updated