1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_RENDER_3D_POSITION_H
17 #define OHOS_RENDER_3D_POSITION_H
18 
19 #include "data_type/vec3.h"
20 
21 namespace OHOS::Render3D {
22 class Position {
23 public:
24     Position() = default;
25     ~Position() = default;
26 
SetPosition(const OHOS::Render3D::Vec3 & vec)27     void SetPosition(const OHOS::Render3D::Vec3& vec)
28     {
29         pos_ = vec;
30     }
31 
SetDistance(const float distance)32     void SetDistance(const float distance)
33     {
34         distance_ = distance;
35     }
36 
SetIsAngular(bool isAngular)37     void SetIsAngular(bool isAngular)
38     {
39         isAngular_ = isAngular;
40     }
41 
GetPosition()42     const Vec3& GetPosition() const
43     {
44         return pos_;
45     }
46 
GetX()47     float GetX() const
48     {
49         return pos_.GetX();
50     }
51 
GetY()52     float GetY() const
53     {
54         return pos_.GetY();
55     }
56 
GetZ()57     float GetZ() const
58     {
59         return pos_.GetZ();
60     }
61 
GetDistance()62     float GetDistance() const
63     {
64         return distance_;
65     }
66 
GetIsAngular()67     bool GetIsAngular() const
68     {
69         return isAngular_;
70     }
71 
72 private:
73     OHOS::Render3D::Vec3 pos_ { 0.0f, 0.0f, 4.0f };
74     float distance_ { 0.0f };
75     bool isAngular_ = false;
76 };
77 } // namespace OHOS::Render3D
78 #endif // OHOS_RENDER_3D_POSITION_H
79