AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::Model Class Reference

#include <Model.h>

Inheritance diagram for Aire::Model:
Inheritance graph
[legend]
Collaboration diagram for Aire::Model:
Collaboration graph
[legend]

Public Member Functions

 Model (std::vector< MeshPtr > meshes, std::map< string, BoneInfo > m_BoneInfoMap, int m_BoneCounter=0)
 
void AssignRigidbodyBox (float aWidth, float aHeight, float aDepth)
 
void AssignRigidbodyBall (float aRadius)
 
void SetGravity (bool gravityOn, float gravityValue)
 
void SetCollision (bool aCollidable)
 
void SetStatic (bool aStatic)
 
autoGetBoneInfoMap ()
 
intGetBoneCount ()
 
void translate (glm::vec3 direction)
 
void scale (glm::vec3 val)
 
void rotate (float degree, glm::vec3 axis)
 
glm::vec3 getPosition ()
 
void renderInstanced (ShaderProgram &shader, Aire::Camera &camera, glm::mat4 transform)
 
void render (ShaderProgram &shader, Aire::Camera &camera)
 render the model
 
uint32_t getSize ()
 
- Public Member Functions inherited from Aire::Resource
 Resource ()
 Default constructor.
 
virtual ~Resource ()
 Default destructor.
 
bool isLoadToGpu ()
 
ResourceState getState ()
 
void setState (ResourceState state)
 

Public Attributes

bool isStatic = true
 Flag indicating whether the model is static.
 
std::vector< MeshPtrmeshes
 List of meshes.
 
bool gammaCorrection
 Flag indicating whether the model use gamma correction.
 
glm::mat4 modelMatrix
 Model matrix for the model.
 
Rigidbodyrb = nullptr
 Rigid body that might be associated with the model.
 

Additional Inherited Members

- Protected Attributes inherited from Aire::Resource
ResourceState resourceState
 

Detailed Description

A 3D model that combines several meshes and materials Supports animation.

Constructor & Destructor Documentation

◆ Model()

Aire::Model::Model ( std::vector< MeshPtr > meshes,
std::map< string, BoneInfo > m_BoneInfoMap,
int m_BoneCounter = 0 )
inline

Create a new model

Parameters
meshesList of meshes to include in the model
m_BoneInfoMapMap from bone name to bone info object
m_BoneCounterThe number of bones in the model skeleton

Member Function Documentation

◆ AssignRigidbodyBall()

void Aire::Model::AssignRigidbodyBall ( float aRadius)

Assign a rigidbody to the model

Parameters
aRadiusRadius of the rigidbody ball
Here is the call graph for this function:

◆ AssignRigidbodyBox()

void Aire::Model::AssignRigidbodyBox ( float aWidth,
float aHeight,
float aDepth )

Assign a rigidbody to the model

Parameters
aWidthWidth of the rigidbody box
aHeightHeight of the rigidbody box
aDepthDepth of the rigidbody box
Here is the call graph for this function:

◆ GetBoneCount()

int & Aire::Model::GetBoneCount ( )
inline

Dunction to get the bone counter

Returns
The bone counter

◆ GetBoneInfoMap()

auto & Aire::Model::GetBoneInfoMap ( )
inline

Function to get the bone info map

Returns
The map of bone names to bone info objects

◆ getPosition()

glm::vec3 Aire::Model::getPosition ( )
Returns
The model position in world space

◆ getSize()

uint32_t Aire::Model::getSize ( )
virtual
Returns
The model size in memory (in Bytes)

Implements Aire::Resource.

◆ render()

void Aire::Model::render ( ShaderProgram & shader,
Aire::Camera & camera )

render the model

Render the whole model

Parameters
shaderShader program to use for rendering
cameraThe camera associated with the player
shadershader that will be used to process the model
cameracamera information
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderInstanced()

void Aire::Model::renderInstanced ( ShaderProgram & shader,
Aire::Camera & camera,
glm::mat4 transform )

Render a model instance

Parameters
shaderShader program to use for rendering
cameraThe camera associated with the player
transformTransform for the model instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate()

void Aire::Model::rotate ( float degree,
glm::vec3 axis )

Function to apply rotation on the model

Parameters
degreeThe degrees of rotation to apply to the model
axisThe rotation direction

◆ scale()

void Aire::Model::scale ( glm::vec3 val)

Function to apply (non-uniform) scale on the model

Parameters
valScale vector

◆ SetCollision()

void Aire::Model::SetCollision ( bool aCollidable)

Set the collision settings for the model via the rigidbody

Parameters
aCollidableEnable / Disable collision (True by default)

◆ SetGravity()

void Aire::Model::SetGravity ( bool gravityOn,
float gravityValue )

Set the gravity settings for the model via the rigidbody

Parameters
gravityOnEnables gravity
gravityValueStrength of the gravity

◆ SetStatic()

void Aire::Model::SetStatic ( bool aStatic)

Set the rigidbody settings to say a rigidbody is static

Parameters
aCollidableEnable / Disable static (False by default)

◆ translate()

void Aire::Model::translate ( glm::vec3 direction)

Function to apply translation on the model

Parameters
positionTranslation vector

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