Level H Engine
BoundingBoxComponent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Component.h"
4 #include "../Maths/Vec3.h"
5 
10 {
11 public:
15  virtual ~BoundingBoxComponent();
16 
21  void initaliseBoundingBox(std::string meshID);
22 
28 
33  void scaleBoundingBox(Vec3 scale) { boxDim = initialBoxDim * scale; }
34 
38  virtual void onAwake();
39 
43  virtual void onDestroy();
44 
49  void setNextPos(Vec3 inNextPos) { nextPos = inNextPos; }
50 
55  Vec3 getNextPos() { return nextPos; }
56 
57 private:
64 };
void setNextPos(Vec3 inNextPos)
A function to set the position of the box for the next loop for use with collision.
Definition: BoundingBoxComponent.h:49
A class that handles the components.
Definition: Component.h:13
Vec3 getNextPos()
A function to get the position of the box for the next loop for use with collision.
Definition: BoundingBoxComponent.h:55
virtual void onAwake()
A virtual function for the componets awake.
Definition: BoundingBoxComponent.cpp:9
Vec3 getBoundingBoxDimensions()
A function to return the dimensions of the bounding box.
Definition: BoundingBoxComponent.h:27
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:8
virtual void onDestroy()
A virtual function for the componets destroy.
Definition: BoundingBoxComponent.cpp:17
Vec3 boxDim
The dimensions of the bouncing box.
Definition: BoundingBoxComponent.h:61
A class that handles the bounding box component.
Definition: BoundingBoxComponent.h:9
virtual ~BoundingBoxComponent()
A virtual destructor.
Definition: BoundingBoxComponent.cpp:5
void initaliseBoundingBox(std::string meshID)
A function to initalise the bounding box from a mesh.
Definition: BoundingBoxComponent.cpp:21
Vec3 initialBoxDim
The initial dimensions of the bouncing box.
Definition: BoundingBoxComponent.h:59
Vec3 nextPos
The position in the next loop.
Definition: BoundingBoxComponent.h:63
void scaleBoundingBox(Vec3 scale)
A function to scale the bounding box.
Definition: BoundingBoxComponent.h:33