7#include "LinearAlgebra/Spherical.h"
8#include "LinearAlgebra/SwingTwist.h"
10namespace RoboidControl {
13class LocalParticipant;
15#define THING_STORE_SIZE 256
43 Thing(
int thingType = Type::Undetermined);
57 unsigned char thingId,
58 Type thingType = Type::Undetermined);
108 Thing* parent =
nullptr;
109 Thing** children =
nullptr;
153 bool linearVelocityUpdated =
false;
154 bool angularVelocityUpdated =
false;
164 SwingTwist orientation;
167 Spherical linearVelocity;
169 Spherical angularVelocity;
182 static unsigned long GetTimeMs();
184 void Update(
bool recursive =
false);
188 virtual void Update(
unsigned long currentTimeMs,
bool recursive =
false);
190 static void UpdateThings(
unsigned long currentTimeMs);
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:14
A temperature sensor.
Definition TemperatureSensor.h:8
A thing is the primitive building block.
Definition Thing.h:20
virtual Spherical GetLinearVelocity()
Get the linear velocity of the thing.
Definition Thing.cpp:237
void SetModel(const char *url)
Sets the location from where the 3D model of this Thing can be loaded from.
Definition Thing.cpp:172
Thing * FindThing(const char *name)
Find a thing by name.
Definition Thing.cpp:67
void SetPosition(Spherical position)
Set the position of the thing.
Definition Thing.cpp:215
virtual void SetParent(Thing *parent)
Sets the parent Thing.
Definition Thing.cpp:83
Thing * GetChildByIndex(unsigned char ix)
Get a child by index.
Definition Thing.cpp:168
SwingTwist GetOrientation()
Get the orientation of the thing.
Definition Thing.cpp:228
void Terminate()
Terminated things are no longer updated.
Definition Thing.cpp:63
void SetOrientation(SwingTwist orientation)
Set the orientation of the thing.
Definition Thing.cpp:223
virtual void AddChild(Thing *child)
Add a child Thing to this Thing.
Definition Thing.cpp:103
float modelScale
The scale of the model (deprecated I think)
Definition Thing.h:118
Spherical GetPosition()
Get the position of the thing.
Definition Thing.cpp:219
Thing * GetParent()
Gets the parent Thing.
Definition Thing.cpp:99
virtual void ProcessBinary(char *bytes)
Definition Thing.cpp:211
virtual void SetAngularVelocity(Spherical angularVelocity)
Set the angular velocity of the thing.
Definition Thing.cpp:241
void SetLinearVelocity(Spherical linearVelocity)
Set the linear velocity of the thing.
Definition Thing.cpp:232
Thing * GetChild(unsigned char id, bool recursive=false)
Get a child by thing Id.
Definition Thing.cpp:151
unsigned char networkId
The network ID of this thing.
Definition Thing.h:64
virtual Spherical GetAngularVelocity()
Get the angular velocity of the thing.
Definition Thing.cpp:246
bool positionUpdated
The scale of the thing (deprecated I think)
Definition Thing.h:136
const char * name
The name of the thing.
Definition Thing.h:113
Thing * RemoveChild(Thing *child)
Remove the given thing as a child of this thing.
Definition Thing.cpp:126
bool orientationUpdated
boolean indicating if the orientation was updated
Definition Thing.h:138
Type
Predefined thing types.
Definition Thing.h:23
Participant * owner
The participant managing this thing.
Definition Thing.h:61
unsigned char childCount
The number of children.
Definition Thing.h:96
unsigned char type
The type of Thing This can be either a Thing::Type of a byte value for custom types.
Definition Thing.h:70
const char * modelUrl
An URL pointing to the location where a model of the thing can be found.
Definition Thing.h:116
virtual void GenerateBinary(char *buffer, unsigned char *ix)
Function used to generate binary data for this thing.
Definition Thing.cpp:207
A sensor which can detect touches.
Definition TouchSensor.h:8