i6engine  1.0
StaticStateComponent.h
Go to the documentation of this file.
1 /*
2  * i6engine
3  * Copyright (2016) Daniel Bonrath, Michael Baer, All rights reserved.
4  *
5  * This file is part of i6engine; i6engine is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __I6ENGINE_API_STATICSTATECOMPONENT_H__
26 #define __I6ENGINE_API_STATICSTATECOMPONENT_H__
27 
30 
32 
33 namespace i6e {
34 namespace api {
35 
47  public:
51  StaticStateComponent(const int64_t id, const attributeMap & params);
52 
54 
58  inline void setPosition(const Vec3 & position) {
59  _position = position;
60  sendUpdateMessage();
61  }
62 
66  inline void setRotation(const Quaternion & rotation) {
67  _rotation = rotation;
68  sendUpdateMessage();
69  }
70 
74  inline void setScale(const Vec3 & scale) {
75  _scale = scale;
76  sendUpdateMessage();
77  }
78 
82  inline Vec3 getPosition() const {
83  return _position;
84  }
85 
89  inline Quaternion getRotation() const { return _rotation; }
90 
94  inline Vec3 getScale() const {
95  return _scale;
96  }
97 
101  attributeMap synchronize() const override;
102 
103  std::string getTemplateName() const override {
104  return "StaticState";
105  }
106 
107  std::vector<componentOptions> getComponentOptions() override;
108 
109  private:
113  Vec3 _position;
114 
118  Quaternion _rotation;
119 
123  Vec3 _scale;
124 
128  void Init() override;
129 
130  void sendUpdateMessage();
131  };
132 
133 } /* namespace api */
134 } /* namespace i6e */
135 
136 #endif /* __I6ENGINE_API_STATICSTATECOMPONENT_H__ */
137 
void setPosition(const Vec3 &position)
Sets position.
std::string getTemplateName() const override
returns the name this template was registered with
Vec3 getScale() const
Gets scale.
Class describing a 3d rotation.
Definition: i6eQuaternion.h:58
#define ISIXE_MODULES_API
Vec3 getPosition() const
Gets position.
std::map< std::string, std::string > attributeMap
Definition: attributeMap.h:42
Implements 3-dimensional vectors.
Definition: i6eVector.h:48
Makes it possible to place a static GameObject For creating a StaticStateComponent, these keys are possible: Name Required Type Description Public pos yes Vec3 position of the SceneNode yes rot yes Quaternion rotation of the SceneNode yes scale yes Vec3 scale of the SceneNode yes
void setRotation(const Quaternion &rotation)
Sets rotation.
Quaternion getRotation() const
Gets rotation.
void setScale(const Vec3 &scale)
Sets scale.
Component Base Class. All Components must derive from Component.
Definition: Component.h:97