Creates a Flocking object. NOTE - This is a HEAVILY modifed version of code from a previous assignment (It was not built for 3D initaliy)
More...
#include <Flocking.h>
|
| Flocking (int inNumberOfBoids, std::string inSpriteID, int inXBoundary, int inYBoundary, float inMaxVel) |
| Constructs the 2D Flocking object. More...
|
|
| Flocking (int inNumberOfBoids, std::string inMesh, std::string inBoidTexture, std::string inBoidVertexShader, std::string inBoidFragmentShader, int inXBoundary, int inYBoundary, int inZBoundary, float inMaxVel) |
| Constructs the 3D Flocking object. More...
|
|
| Flocking (int inNumberOfBoids, std::string inMesh, std::string inBoidVertexShader, std::string inBoidFragmentShader, int inXBoundary, int inYBoundary, int inZBoundary, float inMaxVel) |
| Constructs the 3D Flocking object. More...
|
|
| ~Flocking () |
| Destructs the Flocking object. More...
|
|
void | update2D () |
| A function that updates the Flocking. More...
|
|
void | update3D () |
| A function that updates the Flocking. More...
|
|
void | draw2D () |
| Draws the 2D Flocking. More...
|
|
void | setRule1 (int inApplyRule1) |
| Set applyRule1. More...
|
|
void | setRule2 (int inApplyRule2) |
| Set applyRule2. More...
|
|
void | setRule3 (int inApplyRule3) |
| Set applyRule3. More...
|
|
Creates a Flocking object. NOTE - This is a HEAVILY modifed version of code from a previous assignment (It was not built for 3D initaliy)
◆ Flocking() [1/3]
Flocking::Flocking |
( |
int |
inNumberOfBoids, |
|
|
std::string |
inSpriteID, |
|
|
int |
inXBoundary, |
|
|
int |
inYBoundary, |
|
|
float |
inMaxVel |
|
) |
| |
Constructs the 2D Flocking object.
- Parameters
-
inNmberOfBoids | The number of boids. |
inSpriteID | The ID of the sprite. |
inXBoundary | The rough x boundary of the boids. |
inYBoundary | The rough y boundary of the boids. |
inMaxVel | The maximum velocity of the boids. |
◆ Flocking() [2/3]
Flocking::Flocking |
( |
int |
inNumberOfBoids, |
|
|
std::string |
inMesh, |
|
|
std::string |
inBoidTexture, |
|
|
std::string |
inBoidVertexShader, |
|
|
std::string |
inBoidFragmentShader, |
|
|
int |
inXBoundary, |
|
|
int |
inYBoundary, |
|
|
int |
inZBoundary, |
|
|
float |
inMaxVel |
|
) |
| |
Constructs the 3D Flocking object.
- Parameters
-
inNmberOfBoids | The number of boids. |
meshID | The path of the mesh for the boids |
meshID | The path of the texture for the boids. |
meshID | The path of the vertex shader for the boids. |
meshID | The path of the fragment shader for the boids. |
inXBoundary | The rough x boundary of the boids. |
inYBoundary | The rough y boundary of the boids. |
inZBoundary | The rough z boundary of the boids. |
inMaxVel | The maximum velocity of the boids. |
◆ Flocking() [3/3]
Flocking::Flocking |
( |
int |
inNumberOfBoids, |
|
|
std::string |
inMesh, |
|
|
std::string |
inBoidVertexShader, |
|
|
std::string |
inBoidFragmentShader, |
|
|
int |
inXBoundary, |
|
|
int |
inYBoundary, |
|
|
int |
inZBoundary, |
|
|
float |
inMaxVel |
|
) |
| |
Constructs the 3D Flocking object.
- Parameters
-
inNmberOfBoids | The number of boids. |
meshID | The path of the mesh for the boids |
meshID | The path of the vertex shader for the boids. |
meshID | The path of the fragment shader for the boids. |
inXBoundary | The rough x boundary of the boids. |
inYBoundary | The rough y boundary of the boids. |
inYBoundary | The rough z boundary of the boids. |
inMaxVel | The maximum velocity of the boids. |
◆ ~Flocking()
◆ draw2D()
void Flocking::draw2D |
( |
| ) |
|
Draws the 2D Flocking.
- Parameters
-
renderer | A pointer to the renderer. |
◆ limitVelocity()
void Flocking::limitVelocity |
( |
int |
index | ) |
|
|
private |
Limits the Boid velocity.
- Parameters
-
index | The index of the Boid to test. |
◆ limitVelocity3D()
void Flocking::limitVelocity3D |
( |
int |
index | ) |
|
|
private |
Limits the Boid velocity.
- Parameters
-
index | The index of the Boid to test. |
◆ roughBoundaries()
Vec2 Flocking::roughBoundaries |
( |
int |
index | ) |
|
|
private |
Applies Boid rough boundaries.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the boundary.
◆ roughBoundaries3D()
Vec3 Flocking::roughBoundaries3D |
( |
int |
index | ) |
|
|
private |
Applies Boid rough boundaries.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the boundary.
◆ rule1()
Vec2 Flocking::rule1 |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 1.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ rule2()
Vec2 Flocking::rule2 |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 2.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ rule3()
Vec2 Flocking::rule3 |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 3.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ ruleOne3D()
Vec3 Flocking::ruleOne3D |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 1.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ ruleThree3D()
Vec3 Flocking::ruleThree3D |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 3.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ ruleTwo3D()
Vec3 Flocking::ruleTwo3D |
( |
int |
index | ) |
|
|
private |
Applies Boid Rule 2.
- Parameters
-
index | The index of the Boid to test. |
- Returns
- The resultant velocity of the rule.
◆ setRule1()
void Flocking::setRule1 |
( |
int |
inApplyRule1 | ) |
|
Set applyRule1.
- Parameters
-
applyRule1 | What to do with the rule. (1 == possitve, 0 = neutral, -1 == negative) |
◆ setRule2()
void Flocking::setRule2 |
( |
int |
inApplyRule2 | ) |
|
Set applyRule2.
- Parameters
-
applyRule2 | What to do with the rule. (1 == possitve, 0 = neutral, -1 == negative) |
◆ setRule3()
void Flocking::setRule3 |
( |
int |
inApplyRule3 | ) |
|
Set applyRule3.
- Parameters
-
applyRule3 | What to do with the rule. (1 == possitve, 0 = neutral, -1 == negative) |
◆ update2D()
void Flocking::update2D |
( |
| ) |
|
◆ update3D()
void Flocking::update3D |
( |
| ) |
|
◆ applyRule1
What to do with the rule. (1 == possitve, 0 = neutral, -1 == negative)
◆ applyRule2
◆ applyRule3
◆ boids
std::vector<Boid*> Flocking::boids |
|
private |
A vector of Particle boids.
◆ maxVel
◆ spriteID
std::string Flocking::spriteID |
|
private |
The ID of the 2D boid sprite.
◆ xBoundary
The boundaries of the boids.
◆ yBoundary
◆ zBoundary
The documentation for this class was generated from the following files: