MeshRenderableConfig.ixx File
Configuration for renderable components (mesh, material, shader). More...
Included Headers
#include <memory>
#include <unordered_map>
#include <cassert>
#include <helios.engine.builder.gameObject.builders.configs.SceneNodeConfig>
#include <helios.scene.SceneNode>
#include <helios.rendering.mesh>
#include <helios.math.types>
#include <helios.engine.modules.rendering>
#include <helios.ext.opengl>
#include <helios.rendering>
#include <helios.engine.ecs.GameObject>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | builder |
|
Fluent builder pattern for constructing GameObjects. More... | |
| namespace | gameObject |
|
Factory and prototype classes for GameObject construction. More... | |
| namespace | builders |
|
Domain-specific builders for configuring different aspects of GameObjects. More... | |
| namespace | configs |
|
Fine-grained configuration classes for component setup. More... | |
Classes Index
| class | MeshRenderableConfig |
|
Fluent configuration for setting up a Renderable on a GameObject. More... | |
Description
Configuration for renderable components (mesh, material, shader).
File Listing
The file content with the documentation metadata removed is:
24export namespace helios::engine::builder::gameObject::builders::configs {
32 class MeshRenderableConfig {
37 helios::engine::ecs::GameObject gameObject_;
52 helios::rendering::mesh::PrimitiveType primitiveType_;
57 helios::math::vec4f color_;
64 static std::shared_ptr<helios::rendering::mesh::MeshConfig> meshConfig(helios::rendering::mesh::PrimitiveType primitiveType) {
67 primitiveType,
68 std::make_shared<helios::rendering::mesh::MeshConfig>(primitiveType)
81 explicit MeshRenderableConfig(
83 ) : gameObject_(gameObject) {}
92 MeshRenderableConfig& shape(std::shared_ptr<helios::rendering::asset::shape::Shape> shape) {
93 shape_ = shape;
105 MeshRenderableConfig& shader(std::shared_ptr<helios::ext::opengl::rendering::shader::LegacyOpenGLShader> shader) {
106 shader_ = shader;
119 primitiveType_ = primitiveType;
131 MeshRenderableConfig& color(const helios::math::vec4f color) {
132 color_ = color;
142 void attachTo(helios::scene::SceneNode* parent) {
144 build();
146 SceneNodeConfig scn{gameObject_};
148 scn.parent(parent);
156 MeshRenderableConfig& build() {
165 auto materialProperties = std::make_shared<helios::rendering::material::MaterialShaderProperties>(color_);
166 auto material = std::make_shared<helios::rendering::material::Material>(shader_, materialProperties);
168 const auto renderPrototype = std::make_shared<helios::rendering::RenderPrototype>(material, mesh);
170 auto& rc = gameObject_.add<helios::engine::modules::rendering::renderable::components::RenderableComponent>(
174 auto& msc = gameObject_.getOrAdd<helios::engine::modules::rendering::model::components::ModelAabbComponent>();
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.