4#include "LinearAlgebra/Spherical.h"
5#include "LinearAlgebra/SwingTwist.h"
7namespace RoboidControl {
10class LocalParticipant;
12#define THING_STORE_SIZE 256
47 Thing(
int thingType = Type::Undetermined);
66#pragma region Properties
78 unsigned char type = Type::Undetermined;
90 Thing* parent =
nullptr;
108 Thing*
GetChild(
unsigned char thingId,
bool recursively =
false);
163 SwingTwist16 orientation;
172 bool linearVelocityUpdated =
false;
176 Spherical linearVelocity;
185 bool angularVelocityUpdated =
false;
189 Spherical angularVelocity;
194#pragma region Methods
197 static unsigned long GetTimeMs();
201 void Update(
bool recursively =
false);
205 virtual void Update(
unsigned long currentTimeMs,
bool recursively =
false);
207 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:11
A temperature sensor.
Definition TemperatureSensor.h:8
A thing is the primitive building block.
Definition Thing.h:19
virtual Spherical GetLinearVelocity()
Get the linear velocity of the thing.
Definition Thing.cpp:222
void SetPosition(Spherical position)
The scale of the model (deprecated I think)
Definition Thing.cpp:200
virtual void SetParent(Thing *parent)
Sets the parent Thing.
Definition Thing.cpp:53
Thing * FindChild(const char *name, bool recursively=true)
Get a child by index.
Definition Thing.cpp:142
virtual void AddChild(Thing *child)
Add a child Thing to this Thing.
Definition Thing.cpp:73
Spherical GetPosition()
Get the position of the thing.
Definition Thing.cpp:204
Thing * GetParent()
Gets the parent Thing.
Definition Thing.cpp:69
Thing * GetChild(unsigned char thingId, bool recursively=false)
Get a child by thing Id.
Definition Thing.cpp:121
Thing ** children
The children of this thing.
Definition Thing.h:121
SwingTwist16 GetOrientation()
Get the orientation of the thing.
Definition Thing.cpp:213
void SetOrientation(SwingTwist16 orientation)
Set the orientation of the thing.
Definition Thing.cpp:208
virtual void ProcessBinary(char *bytes)
FUnction used to process binary data received for this thing.
Definition Thing.cpp:196
virtual void SetAngularVelocity(Spherical angularVelocity)
Set the angular velocity of the thing.
Definition Thing.cpp:226
void SetLinearVelocity(Spherical linearVelocity)
Set the linear velocity of the thing.
Definition Thing.cpp:217
void Update(bool recursively=false)
Update de state of the thing.
Definition Thing.cpp:166
bool RemoveChild(Thing *child)
Remove the given thing as a child of this thing.
Definition Thing.cpp:96
unsigned char networkId
The network ID of this thing.
Definition Thing.h:72
virtual Spherical GetAngularVelocity()
Get the angular velocity of the thing.
Definition Thing.cpp:231
bool positionUpdated
Boolean indicating that the thing has an updated position.
Definition Thing.h:139
const char * name
The name of the thing.
Definition Thing.h:125
bool orientationUpdated
The scale of the thing (deprecated I think)
Definition Thing.h:157
Type
Predefined thing types.
Definition Thing.h:22
Participant * owner
The participant owning this thing.
Definition Thing.h:69
unsigned char childCount
The number of children.
Definition Thing.h:103
unsigned char type
The type of Thing This can be either a Thing::Type of a byte value for custom types.
Definition Thing.h:78
const char * modelUrl
An URL pointing to the location where a model of the thing can be found.
Definition Thing.h:127
virtual void GenerateBinary(char *buffer, unsigned char *ix)
Function used to generate binary data for this thing.
Definition Thing.cpp:192
A sensor which can detect touches.
Definition TouchSensor.h:8