Skip to main content
Version: 🚧 Nightly

Class f3d::scene

Definition: scene.h (line 35)

Class to load files into.

The scene where files and meshes can be added and loaded into.

Example usage:

std::string path = ...
f3d::engine eng(f3d::window::Type::NATIVE);
f3d::scene& load = eng.getScene();

if (load.supports(path)
{
load.add(path);
}

Inner classes

Members

undefined

Function add

virtual scene & f3d::scene::add(const std::filesystem::path &filePath)=0

Add and load provided files into the scene Already added file will NOT be reloaded If it fails to loads a file, it clears the scene and throw a load_failure_exception.

Parameters:

  • const std::filesystem::path & filePath

Return type: scene &

Function add

virtual scene & f3d::scene::add(const std::vector< std::filesystem::path > &filePath)=0

Add and load provided files into the scene Already added file will NOT be reloaded If it fails to loads a file, it clears the scene and throw a load_failure_exception.

Parameters:

  • const std::vector< std::filesystem::path > & filePath

Return type: scene &

Function add

virtual scene & f3d::scene::add(const std::vector< std::string > &filePathStrings)=0

Add and load provided files into the scene Already added file will NOT be reloaded If it fails to loads a file, it clears the scene and throw a load_failure_exception.

Parameters:

  • const std::vector< std::string > & filePathStrings

Return type: scene &

undefined

Function add

scene & f3d::scene::add(std::initializer_list< std::string > list)

Convenience initializer list signature for add method

Parameters:

  • std::initializer_list< std::string > list

Return type: scene &

Function add

scene & f3d::scene::add(std::initializer_list< std::filesystem::path > list)

Convenience initializer list signature for add method

Parameters:

  • std::initializer_list< std::filesystem::path > list

Return type: scene &

Public functions

Function add

virtual scene & f3d::scene::add(const mesh_t &mesh)=0

Add and load provided mesh into the scene

Parameters:

Return type: scene &

Function clear

virtual scene & f3d::scene::clear()=0

Clear the scene of all added files

Return type: scene &

Function addLight

virtual int f3d::scene::addLight(const light_state_t &lightState) const =0

Add a light based on a light state, returns the index of the added light.

Parameters:

Return type: int

Function getLightCount

virtual int f3d::scene::getLightCount() const =0

Get the number of lights.

Return type: int

Function getLight

virtual light_state_t f3d::scene::getLight(int index) const =0

Get the light state at provided index. light_exception is thrown if the index is invalid.

Parameters:

  • int index

Return type: light_state_t

Function updateLight

virtual scene & f3d::scene::updateLight(int index, const light_state_t &lightState)=0

Update a light at provided index with the provided light state. light_exception is thrown if the index is invalid.

Parameters:

Return type: scene &

Function removeLight

virtual scene & f3d::scene::removeLight(int index)=0

Remove a light at provided index. light_exception is thrown if the index is invalid.

Parameters:

  • int index

Return type: scene &

Function removeAllLights

virtual scene & f3d::scene::removeAllLights()=0

Remove all lights from the scene.

Return type: scene &

Function supports

virtual bool f3d::scene::supports(const std::filesystem::path &filePath)=0

Return true if provided file path is supported, false otherwise.

Parameters:

  • const std::filesystem::path & filePath

Return type: bool

Function loadAnimationTime

virtual scene & f3d::scene::loadAnimationTime(double timeValue)=0

Load added files at provided time value if they contain any animation Providing a timeVale outside of the current animationTimeRange will clamp to the closest value in the range. Does not do anything if there is no animations.

Parameters:

  • double timeValue

Return type: scene &

Function animationTimeRange

virtual std::pair< double, double > f3d::scene::animationTimeRange()=0

Get animation time range of currently added files. Returns [0, 0] if there is no animations.

Return type: std::pair< double, double >

Function availableAnimations

virtual unsigned int f3d::scene::availableAnimations() const =0

Return the number of animations available in the currently loaded files.

Return type: unsigned int