GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
phantomx_renderer_simple.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_PHANTOMX_RENDERER_SIMPLE_H_
9#define DESIGNLAB_PHANTOMX_RENDERER_SIMPLE_H_
10
11#include <array>
12#include <memory>
13
14#include <Dxlib.h>
15
16#include "display_quality.h"
17#include "hexapod_const.h"
22#include "robot_state_node.h"
23
24
25namespace designlab
26{
27
31{
32public:
34 const std::shared_ptr<const IHexapodCoordinateConverter>& converter_ptr,
35 const std::shared_ptr<const IHexapodJointCalculator>& calculator_ptr,
36 DisplayQuality display_quality);
37
38 void SetNode(const RobotStateNode& node) override;
39
40 void Draw() const override;
41
42private:
44 void DrawHexapodNormal() const;
45
46 const unsigned int kColorBody;
47 const unsigned int kColorLeg;
48 const unsigned int kColorLiftedLeg;
49 const unsigned int kColorJoint;
50 const unsigned int kColorLiftedJoint;
51 const unsigned int kColorLegBase;
52 const unsigned int kColorErrorJoint;
53 const unsigned int kColorErrorText;
54
56 const int kCapsuleDivNum;
57
59 const int kSphereDivNum;
60
63 const float kLegRadius;
64
66 const float kJointRadius;
67
68 const bool kDoOutputDebugLog = false;
69
70
71 const std::shared_ptr<const IHexapodCoordinateConverter> converter_ptr_;
72 const std::shared_ptr<const IHexapodJointCalculator> calculator_ptr_;
73
74 RobotStateNode draw_node_;
75
77 std::array<HexapodJointState, HexapodConst::kLegNum> draw_joint_state_;
78
79 DisplayQuality display_quality_;
80};
81
82} // namespace designlab
83
84
85#endif // DESIGNLAB_PHANTOMX_RENDERER_SIMPLE_H_
DxLibの描画処理を行うクラスのインターフェース.
DxLibのGuiやRendererでノードのセットを行うためのインターフェース.
3Dモデルを使用せず,多角形を組み合わせてPhantomXの描画を行うクラス.
void Draw() const override
描画処理を行う. const 関数にしているのは, 描画処理の中でメンバ変数を変更しないようにするため.
void SetNode(const RobotStateNode &node) override
ノードをセットする.
DisplayQuality
描画の品質設定を示す列挙体.
グラフ構造のためのノード(頂点).旧名 LNODE