-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntity.h
77 lines (64 loc) · 2.02 KB
/
Entity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************
Entity.h
Header file for Entity Class
CPSC8170 - Proj 1 GBG 8/2013
****************************************************/
#ifndef _ENTITY_H_
#define _ENTITY_H_
#include "State.h"
#include "Model.h"
#define MAXSTEPS 10000
#define SPDEPTH 3
class Entity : public Model { // entity is a model that has a state...
private:
State EntState; // the entity's associated state variables
public:
// Constructor
Entity();
// Setters
void Rest(int type);
void Stopped(int type);
void Start(int type);
void Step(int type);
void Trace(int type);
void Velocity(Vector3d newv);
void Center(Vector3d newc);
void InitState(Vector3d vel, Vector3d cen, double mass, double radius, double coeffr, double coefff, float eps, double viscosity, Vector3d wind, Vector3d gravity);
void InitState(Vector3d plane, Vector3d cen, float eps);
// Getters
Vector3d InitialCenter();
Vector3d InitialVelocity();
Vector3d Center();
Vector3d Velocity();
Vector3d Acceleration();
double Radius();
int Rest();
int Stopped();
int Start();
int Step();
int Trace();
Vector3d PlaneNormal();
Vector3d PlaneVertex(int indx = 0);
int GetCollision(int indx = 0);
Vector3d OldCenter(int indx = 0);
float FudgeFactor();
// Functions
/* called by nonmoving objects */
float PlaneBallColl(Vector3d bCenter, Vector3d bVelocity, Vector3d bNewCenter, float bRadius);
void RestingOnPlane(Vector3d bCenter, Vector3d bVelocity, float bRadius, double timeStep);
int AccelOnPlane(Vector3d bAccel);
int VelOnPlane(Vector3d bVelocity);
int CenOnPlane(float radius);
void AddOCenter(int nsteps);
void AddOCollision(int collision, int nsteps);
/* called by moving objects */
void UpdateModel();
void Accel();
void AdjustAVC(Vector3d pnormal, Vector3d pvertex);
Vector3d CalcVelocity(double timestep, double f);
Vector3d CalcVelocity(double timestep);
Vector3d CalcCenter(double timestep, double f);
Vector3d CalcCenter(double timestep);
void ScaleVel(Vector3d pnormal);
};
#endif