46 glm::vec3
scale{1.0f, 1.0f, 1.0f};
81 glm::vec3
color = {1.0f, 1.0f, 1.0f};
94 glm::mat4
GetTransform(glm::vec3 base = glm::vec3(0, 0, -1.0f))
const;
102 void SetDirection(
const glm::mat4& transform, glm::vec3 base = glm::vec3(0, 0, -1.0f));
135 [[nodiscard]]
static SAsset3D Import(
const std::filesystem::path& path,
bool flip =
true,
bool decode_images =
true);
148 bool decode_images =
true);
160 void ExportGLB(
const std::filesystem::path& path,
bool flip =
true,
bool pack_textures =
true)
const;
Represents a simple model.
Definition smodel.hpp:654
std::vector< SPosition > positions
Spawn positions.
Definition sasset3d.hpp:123
std::vector< SAnimation > animations
Skeletal animations.
Definition sasset3d.hpp:120
std::string name
An optional name for the light.
Definition sasset3d.hpp:79
static SAsset3D Import(const std::filesystem::path &path, bool flip=true, bool decode_images=true)
Constructs an asset from a glTF file located at the specified path.
void SortForBlending(glm::vec3 reference_point)
Sorts meshes for proper blending and improved performance.
glm::quat rotation
Rotation transformation.
Definition sasset3d.hpp:47
Buffer ExportGLB(bool flip=true) const
Exports the asset data to a GLB file.
SValue extras
Any additional data for custom use.
Definition sasset3d.hpp:83
bool TrySimplifySkeleton()
Simplifies the skeleton by retaining only translation transformations.
glm::mat4 GetTransform() const
Calculates the local transformation matrix from the SRT properties.
std::string name
An optional name for the asset.
Definition sasset3d.hpp:117
SValue extras
Any additional data for custom use.
Definition sasset3d.hpp:50
std::vector< SVisibilityAnimation > visibility_animations
Visibility animations for mesh groups of the model.
Definition sasset3d.hpp:121
glm::vec3 translation
Translation transformation.
Definition sasset3d.hpp:48
std::vector< STexture > textures
Textures used by the materials of the model.
Definition sasset3d.hpp:119
glm::mat4 GetTransform(glm::vec3 base=glm::vec3(0, 0, -1.0f)) const
Computes the transformation matrix for the light.
void SetDirection(const glm::mat4 &transform, glm::vec3 base=glm::vec3(0, 0, -1.0f))
Sets the direction of the light based on a transformation matrix.
glm::vec3 color
Color of the light.
Definition sasset3d.hpp:81
void SetTransform(const glm::mat4 &transform)
Sets the local SRT properties.
SModel model
The 3D model.
Definition sasset3d.hpp:118
SValue extras
Any additional data for custom use.
Definition sasset3d.hpp:124
void Scale(float scale=1.0f)
Scales the asset by a specified factor.
static SAsset3D Import(BufferView buffer, const std::filesystem::path &base_path={}, bool flip=true, bool decode_images=true)
Constructs an asset from a glTF file located in the buffer.
void ExportGLB(const std::filesystem::path &path, bool flip=true, bool pack_textures=true) const
Exports the asset data to a GLB file.
glm::vec3 direction
Light direction from the source.
Definition sasset3d.hpp:80
glm::vec3 scale
Scale transformation.
Definition sasset3d.hpp:46
std::string name
An optional name for the struct.
Definition sasset3d.hpp:42
std::vector< SLight > lights
Light sources.
Definition sasset3d.hpp:122
Represents a light source in a 3D scene.
Definition sasset3d.hpp:78
Represents an empty node with a transform.
Definition sasset3d.hpp:41
Represents a 3D asset composed of various components.
Definition sasset3d.hpp:116
A class representing JSON-like values (null, bool, numbers, strings, arrays, or objects)
Definition svalue.hpp:41
Definition exception.hpp:56
Provides data structures for representing various animation types and their essential components.
Provides data structures and functions for managing essential components of a 3D model.
Provides data structures for representing essential components of a texture.