Level H Engine
BoundingSphereComponent.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 ~BoundingSphereComponent();
16 
21  void initaliseBoundingSphere(std::string meshID);
22 
27  float getBoundingSphereRadius() { return sphereRad; }
28 
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:
61  float sphereRad;
64 };
A class that handles the components.
Definition: Component.h:13
void setNextPos(Vec3 inNextPos)
A function to set the position of the sphere for the next loop for use with collision.
Definition: BoundingSphereComponent.h:49
float initialSphereRad
The initial radius of the bounding sphere.
Definition: BoundingSphereComponent.h:59
virtual void onAwake()
A virtual function for the componets awake.
Definition: BoundingSphereComponent.cpp:9
float x
Position variables.
Definition: Vec3.h:11
virtual ~BoundingSphereComponent()
A virtual destructor.
Definition: BoundingSphereComponent.cpp:5
void scaleBoundingSphere(Vec3 scale)
A function to scale the sphere.
Definition: BoundingSphereComponent.h:33
virtual void onDestroy()
A virtual function for the componets destroy.
Definition: BoundingSphereComponent.cpp:17
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:8
void initaliseBoundingSphere(std::string meshID)
A function to initalise the bounding sphere from a mesh.
Definition: BoundingSphereComponent.cpp:21
float getBoundingSphereRadius()
A function to return the radius of the bounding sphere.
Definition: BoundingSphereComponent.h:27
Vec3 nextPos
The position in the next loop.
Definition: BoundingSphereComponent.h:63
float sphereRad
The radius of the bounding sphere.
Definition: BoundingSphereComponent.h:61
Vec3 getNextPos()
A function to get the position of the sphere for the next loop for use with collision.
Definition: BoundingSphereComponent.h:55
A class that handles the bounding sphere component.
Definition: BoundingSphereComponent.h:9