VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
assimpParser.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Assimp-based multi-format 3D model parser for VisuTwin Canvas.
5//
6// Loads Collada (.dae), FBX (.fbx), 3DS, PLY, and other Assimp-supported
7// formats, producing a GlbContainerResource that plugs into the existing
8// asset pipeline (same instantiateRenderEntity() path as the GLB parser).
9//
10// Collada files with Phong/Lambert materials are automatically converted
11// to PBR via shininess-to-roughness and specular-to-metalness heuristics.
12//
13// Custom Assimp loader (not derived from upstream).
14// This is a VisuTwin-specific addition for robot/CAD visualization.
15//
16#pragma once
17
18#include <memory>
19#include <string>
20
22
23namespace visutwin::canvas
24{
25 class GraphicsDevice;
26
29 {
31 float uniformScale = 1.0f;
32
34 bool flipYZ = false;
35
37 bool flipWinding = false;
38
41 float smoothingAngle = 80.0f;
42
45 bool generateTangents = true;
46
48 bool optimizeMeshes = true;
49 };
50
52 {
53 public:
56 static std::unique_ptr<GlbContainerResource> parse(
57 const std::string& path,
58 const std::shared_ptr<GraphicsDevice>& device,
59 const AssimpParserConfig& config = AssimpParserConfig{});
60 };
61}
static std::unique_ptr< GlbContainerResource > parse(const std::string &path, const std::shared_ptr< GraphicsDevice > &device, const AssimpParserConfig &config=AssimpParserConfig{})
Abstract GPU interface for resource creation, state management, and draw submission.
Configuration options for Assimp-based model loading.
float uniformScale
Uniform scale applied to all vertex positions (e.g., 0.01 for cm -> m).
bool optimizeMeshes
Merge small meshes sharing the same material to reduce draw calls.
bool flipWinding
If true, reverse face winding order.
bool flipYZ
If true, swap Y and Z axes (Z-up CAD -> Y-up engine) and negate new Z.