Lysa  0.0
Lysa 3D Engine
AssetsPack Class Reference

Classes

struct  AnimationHeader
 
struct  DataInfo
 
struct  Header
 
struct  ImageHeader
 
struct  MaterialHeader
 
struct  MeshHeader
 
struct  MipLevelInfo
 
struct  NodeHeader
 
struct  SurfaceInfo
 
struct  TextureHeader
 
struct  TextureInfo
 
struct  TrackInfo
 

Public Member Functions

 AssetsPack () = default
 

Static Public Member Functions

template<typename T_OBJECT , typename T_MESH_INSTANCE , typename T_ANIMATION_PLAYER >
static std::shared_ptr< T_OBJECT > load (const std::string &fileURI, const std::string &rootName="Root")
 
template<typename T_OBJECT , typename T_MESH_INSTANCE , typename T_ANIMATION_PLAYER >
static std::shared_ptr< T_OBJECT > load (std::pair< std::shared_ptr< std::streambuf >, std::shared_ptr< std::istream >> stream, const std::string &rootName="Root")
 
static std::vector< unique_idloadImages (const std::string &fileURI)
 
static std::vector< unique_idloadImages (std::pair< std::shared_ptr< std::streambuf >, std::shared_ptr< std::istream >> stream)
 

Static Public Attributes

static constexpr auto NAME_SIZE {64}
 
static constexpr char MAGIC [] { 'A', 'S', 'S', 'E', 'T', 'S' }
 
static constexpr uint32 VERSION {1}
 

Constructor & Destructor Documentation

AssetsPack ( )
default

Member Function Documentation

static std::shared_ptr<T_OBJECT> load ( const std::string &  fileURI,
const std::string &  rootName = "Root" 
)
inlinestatic

Loads a scene graph from an assets pack file.

Template Parameters
T_OBJECTObject instance base type (e.g. lysa::nodes::Node).
T_MESH_INSTANCEMesh instance type.
T_ANIMATION_PLAYERAnimation player type.
Parameters
fileURIVirtualFS URI of the .assets file.
rootNameName assigned to the synthetic root node.
Returns
Shared pointer to the root node of the loaded scene or nullptr if no scene objects (for images only assets packs)
std::shared_ptr< T_OBJECT > load ( std::pair< std::shared_ptr< std::streambuf >, std::shared_ptr< std::istream >>  stream,
const std::string &  rootName = "Root" 
)
static

Loads a scene graph from an already-opened assets pack data stream.

Template Parameters
T_OBJECTObject instance base type (e.g. lysa::nodes::Node).
T_MESH_INSTANCEMesh instance type.
T_ANIMATION_PLAYERAnimation player type.
Parameters
streamOpen stream pair returned by VirtualFS::openReadStream.
rootNameName assigned to the synthetic root node.
Returns
Shared pointer to the root node of the loaded scene or nullptr if no scene objects (for images only assets packs)
static std::vector<unique_id> loadImages ( const std::string &  fileURI)
static

Loads only the images from an assets pack file.

Parameters
fileURIVirtualFS URI of the .assets file.
Returns
List of loaded image IDs, indexed by their order in the file.
static std::vector<unique_id> loadImages ( std::pair< std::shared_ptr< std::streambuf >, std::shared_ptr< std::istream >>  stream)
static

Loads only the images from an already-opened assets pack data stream.

Parameters
streamOpen stream pair returned by VirtualFS::openReadStream.
Returns
List of loaded image IDs, indexed by their order in the file.

Member Data Documentation

constexpr char MAGIC[] { 'A', 'S', 'S', 'E', 'T', 'S' }
staticconstexpr
constexpr auto NAME_SIZE {64}
staticconstexpr
constexpr uint32 VERSION {1}
staticconstexpr