ScenePrivate

ScenePrivate Class

Interface for Scripts that are part of a Scene. A more complete and less limited API than Sansar.Simulation.ScenePublic

Syntax

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

Remarks

The ScenePrivate class provides services relating to the Scenee.

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]
 
AgentCount uint . The number of agents in the Scene.
[read-only]
 
Chat Chat . Gets the Chat interface for this Scene
[read-only]
 
SceneInfo SceneInfo . Gets the SceneInfo for this Scene
[read-only]
 
User User . Gets the User interface for this Scene

Public Methods

  CreateCluster (ClusterResourceSansar.VectorSansar.QuaternionSansar.Vector) : ulong
Creates a new cluster and adds it to the Scene.
  CreateCluster (stringSansar.VectorSansar.QuaternionSansar.Vector) : ulong
Creates a new cluster and adds it to the Scene.
  CreateCluster (ClusterResourceSansar.VectorSansar.QuaternionSansar.VectorScenePrivate.CreateClusterHandler) : ulong
Creates a new cluster and adds it to the Scene.
  CreateCluster (ClusterResourceSansar.VectorSansar.QuaternionSansar.VectorAction<ScenePrivate.CreateClusterData>) : ulong
Creates a new cluster and adds it to the Scene.
  CreateCluster (stringSansar.VectorSansar.QuaternionSansar.VectorScenePrivate.CreateClusterHandler) : ulong
Creates a new cluster and adds it to the Scene.
  CreateCluster (stringSansar.VectorSansar.QuaternionSansar.VectorAction<ScenePrivate.CreateClusterData>) : ulong
Creates a new cluster and adds it to the Scene.
  FindAgent (Sansar.Script.ObjectId) : AgentPrivate
Looks up an Agent associated with the given object id.
  FindAgent (Sansar.Script.SessionId) : AgentPrivate
Looks up an Agent associated with the given session id if they are in the scene.
  FindAgent (Guid) : AgentPrivate
Looks up an Agent associated with the given persona id, if they are in the scene.
  FindObject (Sansar.Script.ObjectId) : ObjectPrivate
Looks up a Object associated with the given object id.
  FindScript (Sansar.Script.ScriptId) : object
Looks up the script object associated with the given scriptId
  GetAgent (uint) : AgentPrivate
Get an Sansar.Simulation.AgentPrivate for a specific agent in the Scene.
  GetAgents () : IEnumerable<AgentPrivate>
Enumerable for GetAgent
  PlaySound (SoundResourcePlaySettings) : PlayHandle
Play sound to direct output.
  PlaySoundAtPosition (SoundResourceSansar.VectorPlaySettings) : PlayHandle
Play sound at specified position.
  ResetScene ()
Restarts the Scene.
override
ToString () : string
A string representation of this object.

Member Details

AgentCount Property

The number of agents in the Scene.

Syntax

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

Value

Unsigned integer count of the number of agents in the Scene.

Remarks

This number changes when agents join and part.

Requirements

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

Chat Property

Gets the Chat interface for this Scene

Syntax

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

Value

The Chat Api

Remarks

 

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface]
public ulong CreateCluster (ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface(Restricted=true)]
public ulong CreateCluster (string asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface]
public ulong CreateCluster (ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, ScenePrivate.CreateClusterHandler handler)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface]
public ulong CreateCluster (ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, Action<ScenePrivate.CreateClusterData> handler)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface]
public ulong CreateCluster (string asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, ScenePrivate.CreateClusterHandler handler)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

CreateCluster Method

Creates a new cluster and adds it to the Scene.

Syntax

[Sansar.Script.Interface(Restricted=true)]
public ulong CreateCluster (string asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, Action<ScenePrivate.CreateClusterData> handler)

Parameters

asset
Asset identifier to create.
position
Mono.Simd.Vector4f for the initial position.
rotation
Mono.Simd.Vector4f for the initial rotation.
initialVelocity
Mono.Simd.Vector4f for the initial velocity.
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

The new object may start simulating before the event is triggered.

Requirements

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

FindAgent Method

Looks up an Agent associated with the given object id.

Syntax

[Sansar.Script.Interface]
public AgentPrivate FindAgent (Sansar.Script.ObjectId objectId)

Parameters

objectId
The object to find.

Returns

The agent, or null if an agent cannot be found with that id.

Remarks

Agents may leave at any time.

Requirements

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

FindAgent Method

Looks up an Agent associated with the given session id if they are in the scene.

Syntax

[Sansar.Script.Interface]
public AgentPrivate FindAgent (Sansar.Script.SessionId sessionId)

Parameters

sessionId
The session id of the agent to find.

Returns

The agent, or null if an agent cannot be found with that id in the scene.

Remarks

Agents may leave at any time. Attempting to use an Agent or AgentInfo 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

FindAgent Method

Looks up an Agent associated with the given persona id, if they are in the scene.

Syntax

[Sansar.Script.Interface]
public AgentPrivate FindAgent (Guid personaId)

Parameters

personaId
The object to find.

Returns

The agent, or null if an agent cannot be found with that id in the scene.

Remarks

Agents may leave at any time. Attempting to use an Agent or AgentInfo 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

FindObject Method

Looks up a Object associated with the given object id.

Syntax

[Sansar.Script.Interface]
public ObjectPrivate FindObject (Sansar.Script.ObjectId objectId)

Parameters

objectId
The object to find.

Returns

The agent, or null if a Object cannot be found with that id.

Remarks

 

Requirements

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

FindScript Method

Looks up the script object associated with the given scriptId

Syntax

[Sansar.Script.Interface]
public object FindScript (Sansar.Script.ScriptId scriptId)

Parameters

scriptId
The scriptId of the object to find.

Returns

The script object, or null if an script cannot be found with that id in the scene.

Remarks

Objects and their associated scripts may be removed the scene at any time.

Requirements

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

GetAgent Method

Get an Sansar.Simulation.AgentPrivate for a specific agent in the Scene.

Syntax

[Sansar.Script.Interface]
public AgentPrivate GetAgent (uint index)

Parameters

index
The index of the agent to get.

Returns

Returns null if the index is larger than the number of agents in the Scene.

Remarks

Agents may appear at different indices as they join and part.

Requirements

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

GetAgents Method

Enumerable for GetAgent

Syntax

[Sansar.Script.Interface]
public IEnumerable<AgentPrivate> GetAgents ()

Returns

Enumerable for GetAgent

Remarks

The resulting enumerable may be invalidated if the underlying collection changes.

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

Remarks

Plays for all agents in this scene.

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

Remarks

Plays for all agents in this scene. 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

ResetScene Method

Restarts the Scene.

Syntax

[Sansar.Script.Interface(Restricted=true)]
public void ResetScene ()

Remarks

All clients will be momentarily disconnected.

Requirements

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

SceneInfo Property

Gets the SceneInfo for this Scene

Syntax

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

Value

The full SceneInfo Api

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

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

User Property

Gets the User interface for this Scene

Syntax

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

Value

The User Api

Remarks

 

Requirements

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


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

0 Comments

Article is closed for comments.