Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
PhysicsSpace.h
Go to the documentation of this file.
1#ifndef ULT_PHYSICS_SPACE_H_INCLUDED
2#define ULT_PHYSICS_SPACE_H_INCLUDED
3
4#include "PhysicsObject.h"
5
6namespace Ult
7{
8
14{
15public:
23 virtual ~PhysicsSpace();
24
29 void InfluenceObject(PhysicsObject* obj, float influencePct);
30
32 void SetDensity(const float density) { mDensity = density; }
34 float GetDensity() const { return mDensity; }
35
37 void SetSurfaceHeight(const float height) { mSurfaceHeight = height; }
39 float GetSurfaceHeight() const { return mSurfaceHeight; }
40
42 void SetGravity(const Vector3D& v) { mGravity = v; }
44 Vector3D GetGravity() const { return mGravity; }
45
50 void SetIsAirAtmosphere(const bool b) { mIsAir = b; }
52 bool IsAirAtmosphere() const { return mIsAir; }
53
54protected:
55 float mDensity;
58 bool mIsAir;
59
60private:
61 Vector3D CalcDrag(const Vector3D& dir, float V, float A, float CW);
62 Vector3D CalcLift(const Vector3D& dir, const Vector3D& liftNormal, float V, float A, float CL);
63 Vector3D CalcBuoyancy(float volume);
64};
65
66} // namespace Ult
67
68#endif // ULT_PHYSICS_SPACE_H_INCLUDED
69
Definition PhysicsObject.h:15
float mDensity
Definition PhysicsSpace.h:55
virtual ~PhysicsSpace()
Definition PhysicsSpace.cpp:12
void SetGravity(const Vector3D &v)
Definition PhysicsSpace.h:42
PhysicsSpace()
Definition PhysicsSpace.cpp:6
float GetSurfaceHeight() const
Definition PhysicsSpace.h:39
Vector3D GetGravity() const
Definition PhysicsSpace.h:44
void SetSurfaceHeight(const float height)
Definition PhysicsSpace.h:37
Vector3D mGravity
Definition PhysicsSpace.h:57
void SetIsAirAtmosphere(const bool b)
Definition PhysicsSpace.h:50
bool IsAirAtmosphere() const
Definition PhysicsSpace.h:52
float mSurfaceHeight
Definition PhysicsSpace.h:56
void SetDensity(const float density)
Definition PhysicsSpace.h:32
float GetDensity() const
Definition PhysicsSpace.h:34
void InfluenceObject(PhysicsObject *obj, float influencePct)
Definition PhysicsSpace.cpp:15
bool mIsAir
Definition PhysicsSpace.h:58
Definition Vector3D.h:12
Definition Archive.h:13