9#include <SDL3/SDL_filesystem.h>
15#include <unordered_map>
33#ifndef KEMENA_NO_ASSIMP
133#ifndef KEMENA_NO_ASSIMP
197#ifndef KEMENA_NO_ASSIMP
264#ifndef KEMENA_NO_ASSIMP
327 std::vector<kMesh *> meshes;
328 std::vector<kShader *> shaders;
329 std::vector<kMaterial *> materials;
kMesh * processMesh(aiMesh *mesh, const aiScene *scene)
Converts a single Assimp mesh into a kMesh.
kTexture2D * loadTexture2DFromResource(const kString resourceName, const kString textureName, const kTextureFormat format=kTextureFormat::TEX_FORMAT_SRGBA, const bool flipVertical=false, const bool keepData=false)
Loads a 2D texture from a Windows embedded resource.
kMesh * loadMesh(const kString fileName)
Loads a mesh hierarchy from a file, using Assimp for 3D formats.
kString getExecDir()
Returns the directory containing the running executable.
kString getFileExtension(const kString &fileName)
Extracts the file extension from a path kString.
kMesh * loadMeshFileAssimp(const kString fileName)
Loads a mesh file using the Assimp importer.
void calculateNormal(float N[3], float v0[3], float v1[3], float v2[3])
Computes the face normal for a triangle.
kTextureCube * loadTextureCubeFromResource(const kString resRight, const kString resLeft, const kString resTop, const kString resBottom, const kString resFront, const kString resBack, const kString textureName)
Loads a cube-map texture from six Windows embedded resources.
bool fileExists(const kString &fileName)
Checks whether a file exists on disk.
void extractBoneWeightForVertices(kMesh *mesh, aiMesh *meshData, const aiScene *scene)
Reads bone-weight data from an Assimp mesh and populates a kMesh.
kMesh * loadMeshResourceAssimp(const kString resourceName, const kString extention)
Loads a mesh from an embedded resource using the Assimp importer.
kShader * loadShaderFromFile(kString vertexShaderPath, kString fragmentShaderPath)
Compiles a shader program from GLSL source files on disk.
kMesh * loadMeshFromResource(const kString resourceName, const kString extention)
Loads a mesh from a Windows embedded resource.
kMesh * loadMeshGltf(const kString fileName)
Loads a glTF or GLB file with tinygltf into a kMesh hierarchy.
kMaterial * createMaterial(kShader *shader)
Creates a new material with a pre-assigned shader.
kShader * loadShaderFromCode(kString vertexShaderCode, kString fragmentShaderCode)
Compiles a shader program from inline GLSL source strings.
kString getBaseFilename(const kString &filePath)
Returns the filename without directory or extension.
void saveTexture2D(kTexture2D *texture, const kString fileName, kString format)
Saves a kTexture2D to disk using the specified image format.
void normalizeVector(kVec3 &v)
Normalises a kVec3 in-place.
kShader * loadGlslFromResource(kString resourceName)
Compiles a combined GLSL shader from a Windows embedded resource. The resource must contain the verte...
void setVertexBoneData(kMesh *mesh, size_t vertexID, int boneID, float weight)
Assigns one bone influence slot to a vertex (helper used during loading).
kTexture2D * loadTexture2DFromMemory(const aiTexture *rawData, const kString textureName, const kTextureFormat format=kTextureFormat::TEX_FORMAT_SRGBA, const bool flipVertical=false, const bool keepData=false)
Loads a 2D texture from an in-memory Assimp texture blob.
kTexture2D * loadTexture2D(const kString fileName, const kString textureName, const kTextureFormat format=kTextureFormat::TEX_FORMAT_SRGBA, const bool flipVertical=false, const bool keepData=false)
Loads a 2D texture from a file on disk and uploads it to the GPU.
kString popDir(const kString &filePath)
Removes the last directory component from a path.
kString getBaseDir(const kString &filePath)
Returns the directory portion of a file path.
kMesh * processNode(aiNode *node, const aiScene *scene, kMesh *parent)
Recursively converts an Assimp node into a kMesh hierarchy.
kSkeletalAnimation * loadAnimation(const kString fileName, kMesh *mesh)
Loads a skeletal animation from a file for a given mesh.
kShader * loadShaderFromResource(kString vertexShaderName, kString fragmentShaderName)
Compiles a shader program from Windows embedded resources.
kTextureCube * loadTextureCube(const kString fileNameRight, const kString fileNameLeft, const kString fileNameTop, const kString fileNameBottom, const kString fileNameFront, const kString fileNameBack, const kString textureName)
Loads a cube-map texture from six individual face files.
kAssetManager()
Constructs an empty asset manager with no loaded assets.
unsigned char * loadImageFromResource(const char *resourceName, int &width, int &height, int &channels)
Loads an image from a Windows embedded resource into CPU memory.
Groups a shader program with textures and surface parameters.
Definition kmaterial.h:27
Scene-graph node that holds renderable geometry.
Definition kmesh.h:35
Wraps a compiled GLSL shader program.
Definition kshader.h:55
A single skeletal animation clip (bone channels + node hierarchy).
Definition kskelanimation.h:38
Extends kTexture with 2D-specific metadata and optional CPU-side pixel data.
Definition ktexture2d.h:22
Represents a six-face cube-map texture.
Definition ktexturecube.h:23
Drives playback of skeletal (bone) animation, and reserves a hook for future non-skeletal (object-tra...
Single skeletal bone with position, rotation, and scale keyframe channels.
Core type aliases, enumerations, structs, and utility functions used throughout the engine.
Surface material combining a shader, textures, and PBR/Phong properties.
Polygonal mesh node with skeletal animation support.
Base class for all scene-graph nodes in the Kemena3D engine.
GLSL shader program wrapper.
Skeletal animation clip — bone keyframes + node hierarchy.
2D texture with pixel data access.
Cube-map texture used for skyboxes and environment maps.
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
std::string kString
Standard string alias.
Definition kdatatype.h:42
glm::vec3 kVec3
3-component float vector.
Definition kdatatype.h:33
kTextureFormat
Texture upload format (internal precision / colour-space).
Definition kdatatype.h:125
@ TEX_FORMAT_SRGBA
8-bit RGBA, sRGB colour-space.
Definition kdatatype.h:129