Roboid Control for C++ 0.4
Loading...
Searching...
No Matches
TouchSensor.h
1#pragma once
2
3#include "Thing.h"
4
5namespace RoboidControl {
6
8class TouchSensor : public Thing {
9// Why finishing this release (0.3), I notice that this is equivalent to a digital sensor
10 public:
16
19 bool IsTouching();
20
21 virtual void PrepareForUpdate() override;
22 virtual void Update(bool recursive) override;
23
27 int GenerateBinary(char* bytes, unsigned char* ix) override;
30 virtual void ProcessBinary(char* bytes) override;
31protected:
32 bool externalTouch = false;
33 bool internalTouch = false;
34};
35
36} // namespace RoboidControl
A thing is the primitive building block.
Definition Thing.h:20
static Thing * LocalRoot()
The root thing for the local participant.
Definition Thing.cpp:23
A sensor which can detect touches.
Definition TouchSensor.h:8
int GenerateBinary(char *bytes, unsigned char *ix) override
Function used to generate binary data for this touch sensor.
Definition TouchSensor.cpp:22
virtual void Update(bool recursive) override
Updates the state of the thing.
Definition TouchSensor.cpp:18
bool IsTouching()
Value which is true when the sensor is touching something, false otherwise.
Definition TouchSensor.cpp:10
virtual void ProcessBinary(char *bytes) override
Function used to process binary data received for this touch sensor.
Definition TouchSensor.cpp:28