ObjectPrivate Class
Interface to an object in a Sansar.Simulation.Cluster in the Scene.
Syntax
[Sansar.Script.Interface]
public class ObjectPrivate : Sansar.Script.InstanceInterface
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
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 before simulation started. |
[read-only]
|
InitialRotation | Sansar.Quaternion . The rotation of the ObjectPrivate in world frame before simulation started. |
[read-only]
|
IsValid | bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.) |
[read-only]
|
Name | string . This ObjectPrivate name, as specified in the editor. |
[read-only]
|
ObjectId | Sansar.Script.ObjectId . This ObjectPrivate Id. Unique to this Scene. |
[read-only]
|
Position | Sansar.Vector . The current position of the ObjectPrivate in world frame. |
[read-only]
|
RightVector | Sansar.Vector . The right vector of the ObjectPrivate in the world frame. |
[read-only]
|
Rotation | Sansar.Quaternion . The current rotation of the ObjectPrivate in the world frame. |
[read-only]
|
UpVector | Sansar.Vector . The up vector of the ObjectPrivate in the world frame. |
Public Methods
|
AddInteraction (string, bool)
Add an Interaction to the object to make it clickable. |
|
|
AddInteraction (string, bool, Action<ObjectPrivate.AddInteractionData>)
Add an Interaction to the object to make it clickable. |
|
|
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
AddInteraction Method
Add an Interaction to the object to make it clickable.Syntax
Parameters
- prompt
- The string prompt to show on hover, leave blank to only highlight the object.
- enabled
- Whether or not the interaction is enabled.
Remarks
The Sansar.Simulation.ObjectPrivate.AddInteractionData will include the Interaction object which can be subscribed to.Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
AddInteraction Method
Add an Interaction to the object to make it clickable.Syntax
[Sansar.Script.Interface]
public void AddInteraction (string prompt, bool enabled, Action<ObjectPrivate.AddInteractionData> handler)Parameters
- prompt
- The string prompt to show on hover, leave blank to only highlight the object.
- enabled
- Whether or not the interaction is enabled.
- handler
- Handler to be called when the event completes.
Remarks
The Sansar.Simulation.ObjectPrivate.AddInteractionData will include the Interaction object which can be subscribed to.Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
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__45`1))]
public IEnumerable<TInterface> FindScripts<TInterface> (string name)
where TInterface : classType 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
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.ComponentTypeSyntax
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 before simulation started.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 rotation of the ObjectPrivate in world frame before simulation started.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 ObjectPrivateSyntax
[Sansar.Script.Interface]
public object[] LookupScripts ()Returns
object [] of Objects of the scripts on the ObjectPrivateRemarks
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
Name Property
This ObjectPrivate name, as specified in the editor.Syntax
[get: Sansar.Script.Interface]
public string Name { get; }Value
Remarks
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 current 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
RightVector Property
The right vector of the ObjectPrivate in the world frame.Syntax
[get: Sansar.Script.Interface]
public Sansar.Vector RightVector { get; }Value
A normalized vector.Remarks
Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
Rotation Property
The current rotation of the ObjectPrivate in the world frame.Syntax
[get: Sansar.Script.Interface]
public Sansar.Quaternion Rotation { get; }Value
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 ObjectPrivateSyntax
[Sansar.Script.Interface]
public bool TryGetComponent<ComponentClass> (uint index, out ComponentClass component)
where ComponentClass : classType 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 ObjectPrivateSyntax
[Sansar.Script.Interface]
public bool TryGetFirstComponent<ComponentClass> (out ComponentClass component)
where ComponentClass : classType 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
UpVector Property
The up vector of the ObjectPrivate in the world frame.Syntax
[get: Sansar.Script.Interface]
public Sansar.Vector UpVector { get; }Value
A normalized vector.Remarks
Requirements
Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0
0 Comments