Skip to content

Commit

Permalink
style: 🎨 fix docs formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ion098 authored Nov 18, 2024
1 parent fd99f2a commit 9016a41
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
56 changes: 28 additions & 28 deletions include/gamepad/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,65 +94,65 @@ class Gamepad {
const Button& buttonA() { return m_A; }

/**
* @brief Gets the value of the left joystick's x axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the left joystick's x-axis, between -1.0 and 1.0.
*/
* @brief Gets the value of the left joystick's x axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the left joystick's x-axis, between -1.0 and 1.0.
*/
float axisLeftX(bool use_curve = true) {
if (use_curve && m_left_transformation) return m_left_transformation->get_value({m_LeftX, m_LeftY}).first;
else return m_LeftX;
}

/**
* @brief Gets the value of the left joystick's y axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the left joystick's y-axis, between -1.0 and 1.0.
*/
* @brief Gets the value of the left joystick's y axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the left joystick's y-axis, between -1.0 and 1.0.
*/
float axisLeftY(bool use_curve = true) {
if (use_curve && m_left_transformation) return m_left_transformation->get_value({m_LeftX, m_LeftY}).second;
else return m_LeftY;
}

/**
* @brief Gets the value of the right joystick's x axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the right joystick's x-axis, between -1.0 and 1.0.
*/
* @brief Gets the value of the right joystick's x axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the right joystick's x-axis, between -1.0 and 1.0.
*/
float axisRightX(bool use_curve = true) {
if (use_curve && m_right_transformation)
return m_right_transformation->get_value({m_RightX, m_RightY}).first;
else return m_RightX;
}

/**
* @brief Gets the value of the right joystick's y axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the right joystick's y-axis, between -1.0 and 1.0.
*/
* @brief Gets the value of the right joystick's y axis, optionally applying a curve.
*
* @param use_curve (optional) Whether or not to use the curve; defaults to true.
* @return float The value of the right joystick's y-axis, between -1.0 and 1.0.
*/
float axisRightY(bool use_curve = true) {
if (use_curve && m_right_transformation)
return m_right_transformation->get_value({m_RightX, m_RightY}).second;
else return m_RightY;
}

/**
* @brief Set the transformation to be used for the left joystick.
*
* @param left_transformation The transformation to be used
*/
* @brief Set the transformation to be used for the left joystick.
*
* @param left_transformation The transformation to be used
*/
void set_left_transform(Transformation left_transformation) {
m_left_transformation = std::move(left_transformation);
}

/**
* @brief Set the transformation to be used for the right joystick.
*
* @param right_transformation The transformation to be used
*/
* @brief Set the transformation to be used for the right joystick.
*
* @param right_transformation The transformation to be used
*/
void set_right_transform(Transformation right_transformation) {
m_right_transformation = std::move(right_transformation);
}
Expand Down
24 changes: 12 additions & 12 deletions include/gamepad/joystick_transformation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ class ExpoCurve : public AbstractTransformation {
class Fisheye : public AbstractTransformation {
public:
/**
* @brief Construct a new Fisheye object
*
* @param radius The radius of the rounded circle that forms the corners of the joystick's housing.
*/
* @brief Construct a new Fisheye object
*
* @param radius The radius of the rounded circle that forms the corners of the joystick's housing.
*/
Fisheye(float radius)
: m_radius(radius) {}

Expand Down Expand Up @@ -148,10 +148,10 @@ class Transformation final {
class TransformationBuilder final {
public:
/**
* @brief Construct a new Transformation Builder object
*
* @param first The transformation that should be used first
*/
* @brief Construct a new Transformation Builder object
*
* @param first The transformation that should be used first
*/
template <std::derived_from<AbstractTransformation> T> TransformationBuilder(T first) {
m_transform.m_all_transforms.push_back(std::make_unique<T>(std::move(first)));
}
Expand All @@ -170,10 +170,10 @@ class TransformationBuilder final {
}

/**
* @brief Generate the final chained transformation
*
* @return Transformation The final chained transformation. This can be passed to set_left_transform/set_right_transform
*/
* @brief Generate the final chained transformation
*
* @return Transformation The final chained transformation. This can be passed to set_left_transform/set_right_transform
*/
Transformation build() { return std::move(m_transform); }

/**
Expand Down

0 comments on commit 9016a41

Please sign in to comment.