Level H Engine
Public Member Functions | Private Attributes | List of all members
Boid Class Reference

Creates a Boid object. NOTE - This is a HEAVILY modifed version of code from a previous assignment (It was not built for 3D initaliy) More...

#include <Boid.h>

Collaboration diagram for Boid:
Collaboration graph

Public Member Functions

 Boid (std::string inSpriteID, Vec2 inDirection, float inMoveSpeed, Vec2 inPosition)
 Constructs the 2D Boid Object. More...
 
 Boid (int boidIndex, std::string inMesh, std::string inBoidTexture, std::string inBoidVertexShader, std::string inBoidFragmentShader, Vec3 inDirection, float inMoveSpeed, Vec3 inPosition)
 Constructs the 3D Boid Object. More...
 
 Boid (int boidIndex, std::string inMesh, std::string inBoidVertexShader, std::string inBoidFragmentShader, Vec3 inDirection, float inMoveSpeed, Vec3 inPosition)
 Constructs the 3D Boid Object. More...
 
 ~Boid ()
 Destructs the Boid Object deleting the Boid Object from memory. More...
 
void update2D ()
 A function that updates the 2D Boid. More...
 
void update3D ()
 A function that updates the 3D Boid. More...
 
void draw2D ()
 Draw the 2D Boid to the screen. More...
 
void setPosition2D (Vec2 inPosition)
 Sets the position of the 2D Boid. More...
 
void setPosition3D (Vec3 inPosition)
 Sets the position of the 3D Boid. More...
 
void setPosition2D (float inX, float inY)
 Sets the position of the 2D Boid. More...
 
void setPosition3D (float inX, float inY, float inZ)
 Sets the position of the 3D Boid. More...
 
void move2D (Vec2 movement)
 Move the 2D Boid. More...
 
void move3D (Vec3 movement)
 Move the 3D Boid. More...
 
void move2DX (float movement)
 Move the 2D Boid along the X axis. More...
 
void move2DY (float movement)
 Move the 2D Boid along the Y axis. More...
 
void move3DX (float movement)
 Move the 2D Boid along the X axis. More...
 
void move3DY (float movement)
 Move the 3D Boid along the Y axis. More...
 
void move3DZ (float movement)
 Move the 3D Boid along the Z axis. More...
 
void setMoveSpeed (float inMoveSpeed)
 Sets the moveSpeed of the Boid. More...
 
void setDirection2D (Vec2 inDirection)
 Sets the direction of the 2D Boid. More...
 
void setDirection3D (Vec3 inDirection)
 Sets the direction of the 3D Boid. More...
 
float getMoveSpeed ()
 Gets the moveSpeed of the Boid. More...
 
Vec2 getPosition2D ()
 Gets the position of the 2D Boid. More...
 
Vec3 getPosition3D ()
 Gets the position of the 3D Boid. More...
 
Vec2 getDirection2D ()
 Gets the direction of the 2D Boid. More...
 
Vec3 getDirection3D ()
 Gets the direction of the 3D Boid. More...
 
std::shared_ptr< GameObjectgetObject ()
 Gets the Boid 3D game object ID. More...
 

Private Attributes

std::string spriteID
 The 2D sprite ID. More...
 
std::shared_ptr< GameObjectobject
 A shared pointer to the 3D game object. More...
 
Vec2 direction2D
 The 2D direction of the Particle. More...
 
Vec3 direction3D
 The 3D direction of the Particle. More...
 
Vec2 position2D
 The 2D Position of the Particle. More...
 
Vec3 position3D
 The 3D Position of the Particle. More...
 
float moveSpeed
 The movement speed of the Particle. More...
 

Detailed Description

Creates a Boid object. NOTE - This is a HEAVILY modifed version of code from a previous assignment (It was not built for 3D initaliy)

Constructor & Destructor Documentation

◆ Boid() [1/3]

Boid::Boid ( std::string  inSpriteID,
Vec2  inDirection,
float  inMoveSpeed,
Vec2  inPosition 
)

Constructs the 2D Boid Object.

Parameters
spriteThe Sprite ID.
directionThe direction of the Sprite.
moveSpeedThe move speed of the Sprite.
positionThe position of the Sprite.

◆ Boid() [2/3]

Boid::Boid ( int  boidIndex,
std::string  inMesh,
std::string  inBoidTexture,
std::string  inBoidVertexShader,
std::string  inBoidFragmentShader,
Vec3  inDirection,
float  inMoveSpeed,
Vec3  inPosition 
)

Constructs the 3D Boid Object.

Parameters
boidIndexThe 3D boid index number.
meshIDThe path of the mesh for the boid
meshIDThe path of the texture for the boid.
meshIDThe path of the vertex shader for the boid.
meshIDThe path of the fragment shader for the boid.
directionThe direction of the Sprite.
moveSpeedThe move speed of the Sprite.
positionThe position of the Sprite.
Here is the call graph for this function:

◆ Boid() [3/3]

Boid::Boid ( int  boidIndex,
std::string  inMesh,
std::string  inBoidVertexShader,
std::string  inBoidFragmentShader,
Vec3  inDirection,
float  inMoveSpeed,
Vec3  inPosition 
)

Constructs the 3D Boid Object.

Parameters
boidIndexThe 3D boid index number.
meshIDThe path of the mesh for the boid
meshIDThe path of the vertex shader for the boid.
meshIDThe path of the fragment shader for the boid.
directionThe direction of the Sprite.
moveSpeedThe move speed of the Sprite.
positionThe position of the Sprite.
Here is the call graph for this function:

◆ ~Boid()

Boid::~Boid ( )

Destructs the Boid Object deleting the Boid Object from memory.

Member Function Documentation

◆ draw2D()

void Boid::draw2D ( )

Draw the 2D Boid to the screen.

Here is the call graph for this function:

◆ getDirection2D()

Vec2 Boid::getDirection2D ( )

Gets the direction of the 2D Boid.

Returns
The direction of the Boid.

◆ getDirection3D()

Vec3 Boid::getDirection3D ( )

Gets the direction of the 3D Boid.

Returns
The direction of the Boid.

◆ getMoveSpeed()

float Boid::getMoveSpeed ( )

Gets the moveSpeed of the Boid.

Returns
The moveSpeed.

◆ getObject()

std::shared_ptr< GameObject > Boid::getObject ( )

Gets the Boid 3D game object ID.

Returns
The 3D game object ID of the Boid.

◆ getPosition2D()

Vec2 Boid::getPosition2D ( )

Gets the position of the 2D Boid.

Returns
The position of the Boid.

◆ getPosition3D()

Vec3 Boid::getPosition3D ( )

Gets the position of the 3D Boid.

Returns
The position of the Boid.

◆ move2D()

void Boid::move2D ( Vec2  movement)

Move the 2D Boid.

Parameters
movementThe amount to move by.
Here is the caller graph for this function:

◆ move2DX()

void Boid::move2DX ( float  movement)

Move the 2D Boid along the X axis.

Parameters
movementThe amount to move by.

◆ move2DY()

void Boid::move2DY ( float  movement)

Move the 2D Boid along the Y axis.

Parameters
movementThe amount to move by.

◆ move3D()

void Boid::move3D ( Vec3  movement)

Move the 3D Boid.

Parameters
movementThe amount to move by.
Here is the caller graph for this function:

◆ move3DX()

void Boid::move3DX ( float  movement)

Move the 2D Boid along the X axis.

Parameters
movementThe amount to move by.

◆ move3DY()

void Boid::move3DY ( float  movement)

Move the 3D Boid along the Y axis.

Parameters
movementThe amount to move by.

◆ move3DZ()

void Boid::move3DZ ( float  movement)

Move the 3D Boid along the Z axis.

Parameters
movementThe amount to move by.

◆ setDirection2D()

void Boid::setDirection2D ( Vec2  inDirection)

Sets the direction of the 2D Boid.

Parameters
directionThe new direction.

◆ setDirection3D()

void Boid::setDirection3D ( Vec3  inDirection)

Sets the direction of the 3D Boid.

Parameters
directionThe new direction.

◆ setMoveSpeed()

void Boid::setMoveSpeed ( float  inMoveSpeed)

Sets the moveSpeed of the Boid.

Parameters
moveSpeedThe new moveSpeed.

◆ setPosition2D() [1/2]

void Boid::setPosition2D ( Vec2  inPosition)

Sets the position of the 2D Boid.

Parameters
positionThe new position.

◆ setPosition2D() [2/2]

void Boid::setPosition2D ( float  inX,
float  inY 
)

Sets the position of the 2D Boid.

Parameters
xThe X position.
yThe Y position.

◆ setPosition3D() [1/2]

void Boid::setPosition3D ( Vec3  inPosition)

Sets the position of the 3D Boid.

Parameters
positionThe new position.

◆ setPosition3D() [2/2]

void Boid::setPosition3D ( float  inX,
float  inY,
float  inZ 
)

Sets the position of the 3D Boid.

Parameters
xThe X position.
yThe Y position.
yThe Y position.

◆ update2D()

void Boid::update2D ( )

A function that updates the 2D Boid.

Here is the call graph for this function:

◆ update3D()

void Boid::update3D ( )

A function that updates the 3D Boid.

Here is the call graph for this function:

Member Data Documentation

◆ direction2D

Vec2 Boid::direction2D
private

The 2D direction of the Particle.

◆ direction3D

Vec3 Boid::direction3D
private

The 3D direction of the Particle.

◆ moveSpeed

float Boid::moveSpeed
private

The movement speed of the Particle.

◆ object

std::shared_ptr<GameObject> Boid::object
private

A shared pointer to the 3D game object.

◆ position2D

Vec2 Boid::position2D
private

The 2D Position of the Particle.

◆ position3D

Vec3 Boid::position3D
private

The 3D Position of the Particle.

◆ spriteID

std::string Boid::spriteID
private

The 2D sprite ID.


The documentation for this class was generated from the following files: