RoboidControl for Arduino
|
A plament is used to specify where a Thing is placed on the Roboid. More...
#include <Placement.h>
Public Member Functions | |
Placement (Thing *thing, Vector3 position=Vector3::zero, float horizontalDirection=0.0F, float verticalAngle=0.0F) | |
Placement of a Thing on a Roboid. | |
Placement (Thing *thing, float horizontalDirection, float verticalDirection=0.0F) | |
Placement of a Thing on a Roboid without position. | |
Placement () | |
Default constructor with a zero placement. | |
Public Attributes | |
Placement * | parent = nullptr |
The parent placement in the Roboid hierarchy. | |
Placement ** | children = nullptr |
An array of children of this placement in the Roboid hierarchy. | |
unsigned int | childCount = 0 |
The number of children of this placemet in the Roboid hierarchy. | |
Thing * | thing |
The Thing which is placed. | |
Vector3 | position |
The position of the Thing in carthesian coordinates. | |
float | horizontalDirection |
The angle or direction of the Thing in the horizontal plane. | |
float | verticalDirection |
The angle or direction of the Thing in the vertical plane. | |
A plament is used to specify where a Thing is placed on the Roboid.
It is not always necessary to exactly specify the position and orientation of a Thing. You can use a simple constructor in that case:
The thing can be placed using carthesian coordinates in meters, while the orientation is specified with the horizontal and vertical direction. Whenö both horizontal and vertical direction are zero, the Thing is aligned with the parent thing in the hierarchy. When there is no parent, the thing is directed such that it is looking forward.
In the example above, the thing is placed 4 cm to the left and 6 cm to the front relative to the parent. The orientation is the same as the parent. The second line can be simplified, as the default angles are zero and a Vector2 position can be used which is a placement in the horizontal plane:
Passer::RoboidControl::Placement::Placement | ( | Thing * | thing, |
Vector3 | position = Vector3::zero , |
||
float | horizontalDirection = 0.0F , |
||
float | verticalAngle = 0.0F |
||
) |
Placement::Placement | ( | Thing * | thing, |
float | horizontalDirection, | ||
float | verticalDirection = 0.0F |
||
) |
Placement::Placement | ( | ) |
Default constructor with a zero placement.
Placement* Passer::RoboidControl::Placement::parent = nullptr |
The parent placement in the Roboid hierarchy.
Placement** Passer::RoboidControl::Placement::children = nullptr |
An array of children of this placement in the Roboid hierarchy.
unsigned int Passer::RoboidControl::Placement::childCount = 0 |
The number of children of this placemet in the Roboid hierarchy.
Vector3 Passer::RoboidControl::Placement::position |
The position of the Thing in carthesian coordinates.
float Passer::RoboidControl::Placement::horizontalDirection |
The angle or direction of the Thing in the horizontal plane.
float Passer::RoboidControl::Placement::verticalDirection |
The angle or direction of the Thing in the vertical plane.