Bbop-2D 0.4.1-alpha
Bbop-2D is a c++ library based on openGL to make 2D game. It implement sprite, shape, light and more.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RectangleShape Class Reference

Gère un rectangle/carré More...

#include <shapeClass.h>

Inheritance diagram for RectangleShape:
Inheritance graph
[legend]
Collaboration diagram for RectangleShape:
Collaboration graph
[legend]

Public Member Functions

 RectangleShape ()
 Constructeur par défault du rectangle.
 
 RectangleShape (Vector2f nSize, Vector2f nPos)
 Constructeur du rectangle.
 
 RectangleShape (Vector2f nSize, Vector2f nPos, Vector3i nRGB, Vector2f nOrigin)
 
 RectangleShape (Vector2f nSize, Vector2f nPos, Vector3i nRGB, Vector2f nOrigin, float nRotation, float nAlpha)
 
void Draw (GLint *renderUniforms) const override
 Déssine l'objet héritant de la class.
 
- Public Member Functions inherited from Shape
 Shape (GLfloat *vertices, GLsizeiptr verticesSize, GLuint *indices, GLsizeiptr indicesSize)
 Constructeur de Shape.
 
 Shape ()
 Constructeur par défault de Shape.
 
 Shape (const Shape &other)
 Constructeur par copie de shape.
 
 ~Shape ()
 Destructeur de shape.
 
void initShape (GLfloat *vertices, GLsizeiptr verticesSize, GLuint *indices, GLsizeiptr indicesSize)
 Initialise la Shape comme sont constructeur.
 
const Vector2fgetSize () const
 Renvoie la Taille du Shape.
 
void setSize (const Vector2f &nSize)
 Change la taille du Shape.
 
void setSize (float x_, float y_)
 Change la taille du Shape.
 
const Vector2fgetPosition () const
 Renvoie la position du Shape.
 
void setPosition (const Vector2f &nPos)
 Change la position du Shape.
 
void setPosition (float x_, float y_)
 Change la position de la Shape.
 
const Vector2fgetOrigin () const
 Renvoie l'origine de la Shape.
 
void setOrigin (const Vector2f &nOrigin)
 Change l'origine de la Shape.
 
void setOrigin (float x_, float y_)
 Change l'origine de la Shape.
 
const Vector3igetColor () const
 Renvoie la couleur de Shape.
 
void setColor (const Vector3i &nRGB)
 Change la couleur de Shape.
 
void setColor (int x_, int y_, int z_)
 Change la couleur de Shape.
 
float getAlpha () const
 Renvoie la transaprence du la Shape.
 
void setAlpha (float nAlpha)
 Change la transaprence de la Shape.
 
float getRotation () const
 Renvoie la rotation de la Shape.
 
void setRotation (float nRotation)
 Change la rotation de la Shape.
 
CollisionBoxgetCollisionBox ()
 Renvoie la boîte de collision de Shape.
 
void setAutoUpdateCollision (bool etat)
 Change l'état de l'automatisation de la mise a jour de la boîte de collision.
 
void move (const Vector2f &vecM)
 Déplace la Shape.
 
void move (float x_, float y_)
 Déplace la Shape.
 

Private Member Functions

void buildVAO () override
 
void updateVBO () override
 
void updateVBORGB () override
 
void updateVBOAlpha () override
 

Private Attributes

GLfloat vertices [24]
 
GLuint indices [6]
 

Additional Inherited Members

- Protected Attributes inherited from Shape
VAO shapeVAO
 
VBO shapeVBO
 
EBO shapeEBO
 
Vector2f pos
 
Vector2f size
 
Vector2f origin
 
Vector3i RGB
 
bool autoUpdateCollision
 
float rotation
 
CollisionBox shapeCollisionBox
 
float alpha
 

Detailed Description

Gère un rectangle/carré

Constructor & Destructor Documentation

◆ RectangleShape() [1/4]

RectangleShape::RectangleShape ( )

Constructeur par défault du rectangle.

◆ RectangleShape() [2/4]

RectangleShape::RectangleShape ( Vector2f  nSize,
Vector2f  nPos 
)

Constructeur du rectangle.

Parameters
[in]nSizeTaille du rectangle
[in]nPosPosition du rectangle

◆ RectangleShape() [3/4]

RectangleShape::RectangleShape ( Vector2f  nSize,
Vector2f  nPos,
Vector3i  nRGB,
Vector2f  nOrigin 
)

◆ RectangleShape() [4/4]

RectangleShape::RectangleShape ( Vector2f  nSize,
Vector2f  nPos,
Vector3i  nRGB,
Vector2f  nOrigin,
float  nRotation,
float  nAlpha 
)

Member Function Documentation

◆ buildVAO()

void RectangleShape::buildVAO ( )
overrideprivatevirtual

Implements Shape.

◆ Draw()

void RectangleShape::Draw ( GLint *  renderUniforms) const
overridevirtual

Déssine l'objet héritant de la class.

Cette méthode est utilisé dans Scene.Draw(BbopDrawable) qui lui transmet le renderModeLoc.

See also
Scene.Draw(BbopDrawable)

Implements BbopDrawable.

◆ updateVBO()

void RectangleShape::updateVBO ( )
overrideprivatevirtual

Implements Shape.

◆ updateVBOAlpha()

void RectangleShape::updateVBOAlpha ( )
overrideprivatevirtual

Implements Shape.

◆ updateVBORGB()

void RectangleShape::updateVBORGB ( )
overrideprivatevirtual

Implements Shape.

Member Data Documentation

◆ indices

GLuint RectangleShape::indices[6]
private

◆ vertices

GLfloat RectangleShape::vertices[24]
private

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