Level H Engine
CannonControllerComponent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../../Components/Component.h"
4 #include "../../../Maths/Vec2.h"
5 
10 {
11 public:
16 
20  virtual void onAwake();
21 
25  virtual void onDestroy();
26 
27  void handleInput();
28 
29  void update();
30  void setCannonPower(float inPower) { cannonPower = inPower; }
31  float getCannonPower() { return cannonPower; }
32 
33  void setCannonAngle(Vec2 inAngle) { cannonAngle = inAngle; }
35 
36  void setCannonRotation(Vec3 inRot) { cannonRot = inRot; }
38 
40 
41 private:
43  float cannonPower;
50 
52 };
Vec3 getCannonRotation()
Definition: CannonControllerComponent.h:37
Vec3 cannonRot
The cannon rotation.
Definition: CannonControllerComponent.h:47
A class that handles the components.
Definition: Component.h:13
Contains the Vec2 structure with functions and overloaded operators.
Definition: Vec2.h:8
virtual ~CannonControllerComponent()
A virtual destructor.
Definition: CannonControllerComponent.cpp:9
void setCannonRotation(Vec3 inRot)
Definition: CannonControllerComponent.h:36
Vec2 cannonAngle
The cannon angle.
Definition: CannonControllerComponent.h:45
virtual void onAwake()
A virtual function for the componets awake.
Definition: CannonControllerComponent.cpp:13
float cannonPower
The cannon velocity.
Definition: CannonControllerComponent.h:43
float getCannonPower()
Definition: CannonControllerComponent.h:31
void setCannonPower(float inPower)
Definition: CannonControllerComponent.h:30
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:8
float rotationSpeed
The speed of the rotation.
Definition: CannonControllerComponent.h:49
Vec2 getCannonAngle()
Definition: CannonControllerComponent.h:34
Vec3 getCannonLaunchVelocities()
Definition: CannonControllerComponent.h:39
void setCannonAngle(Vec2 inAngle)
Definition: CannonControllerComponent.h:33
void update()
Definition: CannonControllerComponent.cpp:61
void handleInput()
Definition: CannonControllerComponent.cpp:25
A class that handles the cannon controller component.
Definition: CannonControllerComponent.h:9
Vec3 calculateLaunchVeclocites()
Definition: CannonControllerComponent.cpp:66
virtual void onDestroy()
A virtual function for the componets destroy.
Definition: CannonControllerComponent.cpp:21