-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcolliderComponent.h
More file actions
78 lines (67 loc) · 3.33 KB
/
colliderComponent.h
File metadata and controls
78 lines (67 loc) · 3.33 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//--------------------------------------------------------------------------------
// colliderコンポネント
// colliderComponent.h
// Author : Xu Wenjie
// Date : 2017-05-18
//--------------------------------------------------------------------------------
#pragma once
//--------------------------------------------------------------------------------
// インクルードファイル
//--------------------------------------------------------------------------------
#include "component.h"
#include "KF_CollisionSystem.h"
//--------------------------------------------------------------------------------
// 前方宣言
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// クラス宣言
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Colliderポネントクラス
//--------------------------------------------------------------------------------
class CColliderComponent : public CComponent
{
public:
//--------------------------------------------------------------------------------
// 構造体定義
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// 関数定義
//--------------------------------------------------------------------------------
CColliderComponent(CGameObject* const pGameObj, const CS::COL_TYPE& type, const CS::COL_MODE& mode);
~CColliderComponent() {}
virtual bool Init(void) override { return true; }
virtual void Uninit(void) override;
virtual void Update(void);
//Set関数
void SetTrigger(const bool& bTrigger) { m_bTrigger = bTrigger; }
void SetTag(const string& strTag) { m_strTag = strTag; }
void SetOffset(const CKFVec3& vPos, const CKFVec3& vRot = CKFVec3(0.0f));
//Get関数
CKFVec3 GetLocalPos(void) const { return CKFVec3(m_mtxOffset.m_af[3][0], m_mtxOffset.m_af[3][1], m_mtxOffset.m_af[3][2]); }
CKFVec3 GetWorldPos(void) const { return CKFVec3(m_mtxWorld.m_af[3][0], m_mtxWorld.m_af[3][1], m_mtxWorld.m_af[3][2]); }
CKFMtx44 GetMatrixWorld(void) const { return m_mtxWorld; }
const CS::COL_TYPE GetType(void) const { return m_type; }
const bool IsTrigger(void) const { return m_bTrigger; }
const string& GetTag(void) const { return m_strTag; }
//他
void Sleep(void);
void Awake(void);
protected:
//--------------------------------------------------------------------------------
// 定数定義
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// 関数定義
//--------------------------------------------------------------------------------
CColliderComponent() : CComponent() , m_type(CS::COL_MAX), m_mode(CS::MODE_MAX) {}
//--------------------------------------------------------------------------------
// 変数定義
//--------------------------------------------------------------------------------
CS::COL_TYPE m_type; //colliderのタイプ
CS::COL_MODE m_mode; //Static/Dynamic mode
bool m_bTrigger; //Trigger Flag
CKFMtx44 m_mtxOffset;//相対行列
CKFMtx44 m_mtxWorld; //ワールド行列(処理速度向上のため)
string m_strTag; //識別用タグ
};