Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | List of all members
raylib::model::RlModel Class Reference

Encapsulation of the raylib Model. More...

#include <RlModel.hpp>

Collaboration diagram for raylib::model::RlModel:
Collaboration graph

Public Member Functions

 RlModel (const std::string &fileName)
 Construct a new RlModel object from a file. More...
 
 RlModel (const std::string &fileName, const std::string &textureName)
 Construct a new RlModel object from a file with a custom texture. More...
 
 RlModel (const std::shared_ptr< RlMesh > &mesh)
 Construct a new RlModel object from a mesh. More...
 
 RlModel (const RlMesh &mesh)
 Construct a new RlModel object from a mesh. More...
 
 RlModel (const RlModel &model)
 Copy constructor (create a copy of the raylib Model) More...
 
RlModeloperator= (const RlModel &model)
 Assignment operator (Create a copy of the raylib Model) More...
 
 ~RlModel ()
 Destroy the RlModel object. More...
 
const Vector3fgetPosition () const
 Get the model position. More...
 
void setPosition (const Vector3f &position)
 Set the model position. More...
 
void setPosition (const float &x, const float &y, const float &z)
 Set the model position. More...
 
const Vector3fgetScale () const
 Get the model scale. More...
 
void setScale (const Vector3f &scale)
 Set the model scale. More...
 
void setScale (const float &x, const float &y, const float &z)
 Set the model scale. More...
 
const RlColorgetColor () const
 Get the model color. More...
 
void setColor (const RlColor &color)
 Set the model color. More...
 
const Vector3fgetRotationAxis () const
 Get the model rotation axis. More...
 
void setRotationAxis (const Vector3f &rotationAxis)
 Set the model rotation axis. More...
 
void setRotationAxis (const float &x, const float &y, const float &z)
 Set the model rotation axis. More...
 
const float & getRotationAngle () const
 Get the model rotation angle. More...
 
void setRotationAngle (float rotationAngle)
 Set the model rotation angle. More...
 
const BoundingBox & getBoundingBox () const
 Get the model bounding box. More...
 
void setBoundingBox (const BoundingBox &boundingBox)
 Set the model bounding box (will change the base bounding box) More...
 
const BoundingBox & getBaseBoundingBox () const
 Get the model bounding box at the start. More...
 
BoundingBox getDefaultBoundingBox () const
 Get the model bouding box (will call GetModelBoudingBox) More...
 
const Model & getModel () const
 Get the raylib model. More...
 
const std::shared_ptr< texture::RlTexture > & getTexture () const
 Get the texture linked to the model (can be null) More...
 
void setMaterialTexture (const std::shared_ptr< texture::RlTexture > &texture)
 Set the material texture of the model (Default index 0 and type MATERIAL_MAP_DIFFUSE) More...
 
void setMaterialTexture (const std::shared_ptr< texture::RlTexture > &texture, const int &materialIndex)
 Set the material texture of the model (Default type to MATERIAL_MAP_DIFFUSE) More...
 
void setMaterialTexture (const std::shared_ptr< texture::RlTexture > &texture, const int &materialIndex, const MaterialMapIndex &type)
 Set the material texture of the model. More...
 
void setMeshMaterial (const int &meshId, const int &materialId)
 Set material for a mesh. More...
 

Detailed Description

Encapsulation of the raylib Model.

Constructor & Destructor Documentation

◆ RlModel() [1/5]

raylib::model::RlModel::RlModel ( const std::string &  fileName)
explicit

Construct a new RlModel object from a file.

Parameters
fileNamethe file name

◆ RlModel() [2/5]

raylib::model::RlModel::RlModel ( const std::string &  fileName,
const std::string &  textureName 
)
explicit

Construct a new RlModel object from a file with a custom texture.

Parameters
fileNamethe file name
textureNamethe texture name
Warning
Don't use this, link the texture manually through a resource manager for better performances
Here is the call graph for this function:

◆ RlModel() [3/5]

raylib::model::RlModel::RlModel ( const std::shared_ptr< RlMesh > &  mesh)
explicit

Construct a new RlModel object from a mesh.

Parameters
meshthe mesh

◆ RlModel() [4/5]

raylib::model::RlModel::RlModel ( const RlMesh mesh)
explicit

Construct a new RlModel object from a mesh.

Parameters
meshthe mesh
Here is the call graph for this function:

◆ RlModel() [5/5]

raylib::model::RlModel::RlModel ( const RlModel model)

Copy constructor (create a copy of the raylib Model)

Parameters
modelthe model

◆ ~RlModel()

raylib::model::RlModel::~RlModel ( )

Destroy the RlModel object.

Member Function Documentation

◆ getBaseBoundingBox()

const BoundingBox & raylib::model::RlModel::getBaseBoundingBox ( ) const

Get the model bounding box at the start.

Returns
the model bounding box at the start

◆ getBoundingBox()

const BoundingBox & raylib::model::RlModel::getBoundingBox ( ) const

Get the model bounding box.

Returns
the model bounding box

◆ getColor()

const RlColor & raylib::model::RlModel::getColor ( ) const

Get the model color.

Returns
the model color
Here is the caller graph for this function:

◆ getDefaultBoundingBox()

BoundingBox raylib::model::RlModel::getDefaultBoundingBox ( ) const

Get the model bouding box (will call GetModelBoudingBox)

Returns
the model bounding box

◆ getModel()

const Model & raylib::model::RlModel::getModel ( ) const

Get the raylib model.

Returns
the raylib model
Here is the caller graph for this function:

◆ getPosition()

const Vector3f & raylib::model::RlModel::getPosition ( ) const

Get the model position.

Returns
the model position
Here is the caller graph for this function:

◆ getRotationAngle()

const float & raylib::model::RlModel::getRotationAngle ( ) const

Get the model rotation angle.

Returns
the model rotation angle
Here is the caller graph for this function:

◆ getRotationAxis()

const Vector3f & raylib::model::RlModel::getRotationAxis ( ) const

Get the model rotation axis.

Returns
the model rotation axis
Here is the caller graph for this function:

◆ getScale()

const Vector3f & raylib::model::RlModel::getScale ( ) const

Get the model scale.

Returns
the model scale
Here is the caller graph for this function:

◆ getTexture()

const std::shared_ptr< raylib::texture::RlTexture > & raylib::model::RlModel::getTexture ( ) const

Get the texture linked to the model (can be null)

Returns
the texture

◆ operator=()

raylib::model::RlModel & raylib::model::RlModel::operator= ( const RlModel model)

Assignment operator (Create a copy of the raylib Model)

Parameters
modelthe model
Returns
the RlModel

◆ setBoundingBox()

void raylib::model::RlModel::setBoundingBox ( const BoundingBox &  boundingBox)

Set the model bounding box (will change the base bounding box)

Parameters
boundingBoxthe bounding box

◆ setColor()

void raylib::model::RlModel::setColor ( const RlColor color)

Set the model color.

Parameters
colorthe color

◆ setMaterialTexture() [1/3]

void raylib::model::RlModel::setMaterialTexture ( const std::shared_ptr< texture::RlTexture > &  texture)

Set the material texture of the model (Default index 0 and type MATERIAL_MAP_DIFFUSE)

Parameters
texturethe texture
Here is the caller graph for this function:

◆ setMaterialTexture() [2/3]

void raylib::model::RlModel::setMaterialTexture ( const std::shared_ptr< texture::RlTexture > &  texture,
const int &  materialIndex 
)

Set the material texture of the model (Default type to MATERIAL_MAP_DIFFUSE)

Parameters
texturethe texture
materialIndexthe material index to set the texture

◆ setMaterialTexture() [3/3]

void raylib::model::RlModel::setMaterialTexture ( const std::shared_ptr< texture::RlTexture > &  texture,
const int &  materialIndex,
const MaterialMapIndex &  type 
)

Set the material texture of the model.

Parameters
texturethe texture
materialIndexthe material index to set the texture
typethe type of the texture (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR ...)

◆ setMeshMaterial()

void raylib::model::RlModel::setMeshMaterial ( const int &  meshId,
const int &  materialId 
)

Set material for a mesh.

Parameters
meshIdthe mesh id
materialIdthe material id

◆ setPosition() [1/2]

void raylib::model::RlModel::setPosition ( const float &  x,
const float &  y,
const float &  z 
)

Set the model position.

Parameters
xthe x position
ythe y position
zthe z position

◆ setPosition() [2/2]

void raylib::model::RlModel::setPosition ( const Vector3f position)

Set the model position.

Parameters
positionthe position

◆ setRotationAngle()

void raylib::model::RlModel::setRotationAngle ( float  rotationAngle)

Set the model rotation angle.

Parameters
rotationAnglethe rotation angle

◆ setRotationAxis() [1/2]

void raylib::model::RlModel::setRotationAxis ( const float &  x,
const float &  y,
const float &  z 
)

Set the model rotation axis.

Parameters
xthe x rotation axis
ythe y rotation axis
zthe z rotation axis

◆ setRotationAxis() [2/2]

void raylib::model::RlModel::setRotationAxis ( const Vector3f rotationAxis)

Set the model rotation axis.

Parameters
rotationAxisthe rotation axis

◆ setScale() [1/2]

void raylib::model::RlModel::setScale ( const float &  x,
const float &  y,
const float &  z 
)

Set the model scale.

Parameters
xthe x scale
ythe y scale
zthe z scale

◆ setScale() [2/2]

void raylib::model::RlModel::setScale ( const Vector3f scale)

Set the model scale.

Parameters
scalethe scale

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