-
Notifications
You must be signed in to change notification settings - Fork 0
/
StageMoveFloor.h
57 lines (43 loc) · 1.61 KB
/
StageMoveFloor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Graphics/Graphics.h"
#include "Stage.h"
// 移動床ステージ
class StageMoveFloor :public Stage
{
public:
StageMoveFloor();
~StageMoveFloor();
// 更新処理
void Update(float elapsedTime)override;
// 描画処理
void Render(ID3D11DeviceContext* dc, Shader* shader)override;
// レイキャスト
bool RayCast(const DirectX::XMFLOAT3& start, const DirectX::XMFLOAT3& end, HitResult& hit)override;
// スタート位置設定
void SetStartPoint(const DirectX::XMFLOAT3& start) { this->start = start; }
// ゴール位置設定
void SetGoalPoint(const DirectX::XMFLOAT3& goal) { this->goal = goal; }
// トルク設定
void SetTorque(const DirectX::XMFLOAT3& torque) { this->torque = torque; }
private:// 行列更新処理
void UpdateTransform();
private:
Model* model = nullptr;
DirectX::XMFLOAT3 position = { 0,0,0 };
DirectX::XMFLOAT3 angle = { 0,0,0 };
DirectX::XMFLOAT3 scale = { 1,1,1 };
DirectX::XMFLOAT4X4 transform = { 1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1 };
DirectX::XMFLOAT4X4 oldTransform = { 1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1 };
DirectX::XMFLOAT3 torque = { 0,0,0 };
DirectX::XMFLOAT3 start = { 0,0,0 };
DirectX::XMFLOAT3 goal = { 0,0,0 };
float moveSpeed = 2.0f;
float moveRate = 0.0f;
DirectX::XMFLOAT3 oldAngle = { 0,0,0 };
};