![]() |
Roboid Control for C# 0.4
|
A thing is the primitive building block.
Classes | |
class | CoreEvent |
An event happened to this event. More... | |
class | Type |
Predefined thing types. More... | |
Public Member Functions | |
Thing (Thing parent=default) | |
Create a new Thing. | |
virtual void | CreateComponent () |
Function which can be used to create components in external engines. | |
void | AddChild (Thing child) |
Add a child Thing to this Thing. | |
bool | RemoveChild (Thing child) |
Remove the given thing as a child of this thing. | |
void | ReplacePosition (Spherical newPosition) |
void | ReplaceOrientation (SwingTwist newOrientation) |
virtual void | Update (bool recurse=false) |
Update de state of the thing. | |
virtual byte[] | GenerateBinary () |
Function used to generate binary data for this thing. | |
virtual void | ProcessBinary (byte[] bytes) |
Function used to process binary data received for this thing. | |
Static Public Member Functions | |
static void | CreateRoot (Participant owner) |
Create a root Thing for a participant. | |
static ulong | GetTimeMs () |
Get the current time in milliseconds. | |
Public Attributes | |
bool | terminate = false |
Terminated things are no longer updated. | |
byte | id = 0 |
The ID of this thing. | |
byte | type = Type.Undetermined |
The type of this thing. | |
bool | isRemote = false |
Participant | owner = null |
The participant owning this thing. | |
bool | nameChanged = false |
Unity.Thing | component = null |
A reference to the representation of the thing in Unity. | |
bool | hierarchyChanged = true |
Indicator that the hierarchy of the thing has changed. | |
bool | positionUpdated = false |
Boolean indicating that the thing has an updated position. | |
bool | orientationUpdated = false |
Boolean indicating the thing has an updated orientation. | |
bool | linearVelocityUpdated = false |
Boolean indicating the thing has an updated linear velocity. | |
bool | angularVelocityUpdated = false |
Boolean indicating the thing has an updated angular velocity. | |
ConcurrentQueue< CoreEvent > | updateQueue = new() |
Queue containing events happened to this thing. | |
Protected Attributes | |
List< Thing > | children = new() |
The children of this thing. | |
Properties | |
static Thing | localRoot [get] |
The root thing for the local participant. | |
virtual string | name [get, set] |
The name of the thing. | |
string | modelUrl [get, set] |
An URL pointing to the location where a model of the thing can be found. | |
Thing | parent [get, set] |
The parent of this thing. | |
bool | isRoot [get] |
Indication whether this is a root thing. | |
Spherical | position [get, set] |
The position of the thing in local space, in meters. | |
SwingTwist | orientation [get, set] |
The orientation of the thing in local space. | |
Spherical | linearVelocity [get, set] |
The linear velocity of the thing in local space in meters per second. | |
Spherical | angularVelocity [get, set] |
The angular velocity of the thing in local space in degrees per second. | |
RoboidControl.Thing.Thing | ( | Thing | parent = default | ) |
Create a new Thing.
parent | (optional) The parent thing |
<note>The owner will be the same as the owner of the parent thing, it will be Participant.LocalParticipant if the parent is not specified. A thing without a parent will be connected to the root thing. </note>
|
static |
Create a root Thing for a participant.
owner | The participant who will own this root thing |
|
virtual |
Function which can be used to create components in external engines.
Currently this is used to create GameObjects in Unity
Reimplemented in RoboidControl.DistanceSensor, and RoboidControl.TouchSensor.
void RoboidControl.Thing.AddChild | ( | Thing | child | ) |
Add a child Thing to this Thing.
child | The Thing which should become a child |
bool RoboidControl.Thing.RemoveChild | ( | Thing | child | ) |
Remove the given thing as a child of this thing.
child | The child to remove |
|
virtual |
Update de state of the thing.
recurse | When true, this will Update the descendants recursively |
Reimplemented in RoboidControl.ControlledMotor, RoboidControl.EncoderMotor, and RoboidControl.DifferentialDrive.
|
static |
Get the current time in milliseconds.
|
virtual |
Function used to generate binary data for this thing.
Reimplemented in RoboidControl.DifferentialDrive, RoboidControl.DigitalSensor, RoboidControl.RelativeEncoder, RoboidControl.TemperatureSensor, and RoboidControl.TouchSensor.
|
virtual |
Function used to process binary data received for this thing.
bytes | The binary data to process |
Reimplemented in RoboidControl.DigitalSensor, RoboidControl.DistanceSensor, RoboidControl.TemperatureSensor, RoboidControl.TouchSensor, RoboidControl.DifferentialDrive, and RoboidControl.RelativeEncoder.
byte RoboidControl.Thing.type = Type.Undetermined |
The type of this thing.
This can be either a Thing.Type or a byte value for custom types.
|
getset |
An URL pointing to the location where a model of the thing can be found.
Although the roboid implementation is not dependent on the model, the only official supported model formats are .png (sprite), .gltf and .glb