ObjectPrivate

ObjectPrivate Class

Interface to an object in a Sansar.Simulation.Cluster in the Scene.

Syntax

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

Remarks

Provides basic information about an object.

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]
 
ForwardVector Sansar.Vector . The forward vector of the ObjectPrivate in the world frame.
[read-only]
 
InitialPosition Sansar.Vector . The position of the ObjectPrivate in world frame.
[read-only]
 
InitialRotation Sansar.Quaternion . The position of the ObjectPrivate in world frame.
[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)
[read-only]
 
ObjectId Sansar.Script.ObjectId . This ObjectPrivate Id. Unique to this Scene.
[read-only]
 
Position Sansar.Vector . The position of the ObjectPrivate in world frame.
[read-only]
 
Rotation Sansar.Quaternion . The forward vector of the ObjectPrivate in the world frame.

Public Methods

 
FindScripts<TInterface> (string) : IEnumerable<TInterface>
Looks up scripts on this ObjectPrivate that match the interface type by class name.
 
GetComponent (ComponentType, uint) : object
Get interfaces to the components that are available at runtime.
 
GetComponentCount (ComponentType) : uint
Get the number of components of a particular component type. Sansar.Simulation.ComponentType
 
LookupScripts () : object[]
Get handles to the scripts on the ObjectPrivate
override
ToString () : string
A string representation of this object.
 
TryGetComponent<ComponentClass> (uint, out ComponentClass) : bool
Try to get a component of a particular type from this ObjectPrivate
 
TryGetFirstComponent<ComponentClass> (out ComponentClass) : bool
Try to get the first component of a specific type on this ObjectPrivate

Member Details

FindScripts<TInterface> Generic Method

Looks up scripts on this ObjectPrivate that match the interface type by class name.

Syntax

[Sansar.Script.Interface]
[Sansar.Script.NonReflective]
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Sansar.Simulation.ObjectPrivate/<FindScripts>d__30`1))]
public IEnumerable<TInterface> FindScripts<TInterface> (string name)
where TInterface : class

Type Parameters

TInterface
The interface to find.

Parameters

name
The type name of the script's class to find.

Returns

An IEnumerable which contains all scripts of the given type name on this ObjectPrivate that match the given interface.

Remarks

The name given corresponds to the Type.FullName of the main script class. Multiple scripts may define unrelated types of the same name, but only registered scripts that match the interface of TInterface will be returned.

Requirements

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

ForwardVector Property

The forward vector of the ObjectPrivate in the world frame.

Syntax

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

Value

A normalized vector.

Remarks

 

Requirements

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

GetComponent Method

Get interfaces to the components that are available at runtime.

Syntax

[Sansar.Script.Interface]
public object GetComponent (ComponentType componentType, uint index)

Parameters

componentType
Sansar.Simulation.ComponentType.
index
uint32 index

Returns

Remarks

 

Requirements

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

GetComponentCount Method

Get the number of components of a particular component type. Sansar.Simulation.ComponentType

Syntax

[Sansar.Script.Interface]
public uint GetComponentCount (ComponentType componentType)

Parameters

componentType
Sansar.Simulation.ComponentType

Returns

Remarks

 

Requirements

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

InitialPosition Property

The position of the ObjectPrivate in world frame.

Syntax

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

Value

Remarks

 

Requirements

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

InitialRotation Property

The position of the ObjectPrivate in world frame.

Syntax

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

Value

Remarks

 

Requirements

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

LookupScripts Method

Get handles to the scripts on the ObjectPrivate

Syntax

[Sansar.Script.Interface]
public object[] LookupScripts ()

Returns

object[] of Objects of the scripts on the ObjectPrivate

Remarks

The returned Objects are the created script types. For example if a script on the object is public MyTestObject : ObjectScript then the Objects in the array will be of type MyTestObject.

Requirements

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

ObjectId Property

This ObjectPrivate Id. Unique to this Scene.

Syntax

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

Value

Remarks

 

Requirements

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

Position Property

The position of the ObjectPrivate in world frame.

Syntax

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

Value

Remarks

 

Requirements

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

Rotation Property

The forward vector of the ObjectPrivate in the world frame.

Syntax

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

Value

A normalized vector.

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

TryGetComponent<ComponentClass> Generic Method

Try to get a component of a particular type from this ObjectPrivate

Syntax

[Sansar.Script.Interface]
public bool TryGetComponent<ComponentClass> (uint index, out ComponentClass component)
where ComponentClass : class

Type Parameters

ComponentClass
The component type. Sansar.Simulation.AnimationComponentSansar.Simulation.RigidBodyComponent

Parameters

index
The index of this component type to get. zero based index.
component
The component out parameter of the correct type to get.

Returns

True if a component of the correct type at index is found, false otherwise.

Remarks

 

Requirements

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

TryGetFirstComponent<ComponentClass> Generic Method

Try to get the first component of a specific type on this ObjectPrivate

Syntax

[Sansar.Script.Interface]
public bool TryGetFirstComponent<ComponentClass> (out ComponentClass component)
where ComponentClass : class

Type Parameters

ComponentClass
The component type. Sansar.Simulation.AnimationComponent and Sansar.Simulation.RigidBodyComponent

Parameters

component
Out parameter of the correct component type.

Returns

Returns true if able to get a component of the correct type on this ObjectPrivate.

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.