#include <ObjScene.hpp>
Public Member Functions | |
| ObjScene (std::string filename, float posy, float posz, std::string tex) | |
| ObjScene (std::string filename, float posy, float posz) | |
| void | init (sf::RenderWindow *window, sf::Vector2i dims) override |
| void | draw (float in) override |
| void | update (float dt) override |
| void | handleInput () override |
Private Attributes | |
| sf::RenderWindow * | window |
| The viewport window. | |
| Object | object |
| The mesh object to render. | |
| std::shared_ptr< Camera > | camera |
| The camera used to render. | |
|
std::vector< std::unique_ptr < Light > > | lights |
| The lights used in the scene. | |
| sf::Vector2i | windowSize |
| The dimensions of the window. | |
This class renders a 3D mesh in the viewport.
| Geno3D::ObjScene::ObjScene | ( | std::string | filename, |
| float | posy, | ||
| float | posz, | ||
| std::string | tex | ||
| ) |
Construct an object scene from a textured obj file.
| filename | the path to the obj file to load |
| posy | the y-position of the camera |
| posz | the z-position of the camera |
| tex | the path to the texture image |
| Geno3D::ObjScene::ObjScene | ( | std::string | filename, |
| float | posy, | ||
| float | posz | ||
| ) |
Construct an object scene from an obj file.
| filename | the path to the obj file to load |
| posy | the y-position of the camera |
| posz | the z-position of the camera |
References camera.
|
overridevirtual |
Update once per frame. This renders the mesh according to the scene's camera and lights and draws the rendered image to the viewport.
| in | an interpolation factor |
Implements Geno3D::Scene.
References camera, lights, window, and windowSize.
|
overridevirtual |
Handle input events such as closing the window. This function is called every frame.
Implements Geno3D::Scene.
References window.
|
overridevirtual |
Set up the scene with information about the render window. This is called internally by the Engine class.
Implements Geno3D::Scene.
References camera, lights, window, and windowSize.
|
overridevirtual |
Update at a "fixed-time" interval. This allows an update which is independent of framerate.
| dt | the time between consecutive calls of this function |
Implements Geno3D::Scene.
1.8.6