MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXNTC / ModelView

Method ModelView

tools/explorer/ModelView.cpp:43–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41constexpr float c_verticalFov = 60.f;
42
43ModelView::ModelView(
44 std::shared_ptr<donut::engine::CommonRenderPasses> commonPasses,
45 std::shared_ptr<donut::engine::ShaderFactory> shaderFactory,
46 nvrhi::IDevice* device)
47 : m_commonPasses(std::move(commonPasses))
48 , m_shaderFactory(std::move(shaderFactory))
49 , m_device(device)
50{
51 m_camera = std::make_shared<donut::app::ThirdPersonCamera>();
52 m_camera->SetTargetPosition(0.f);
53 m_camera->SetDistance(3.f);
54 m_camera->SetRotation(radians(135.f), radians(30.f));
55 m_camera->Animate(0.f);
56
57 m_sceneGraph = std::make_shared<engine::SceneGraph>();
58 auto rootNode = std::make_shared<engine::SceneGraphNode>();
59 m_light = std::make_shared<engine::DirectionalLight>();
60 rootNode->SetLeaf(m_light);
61 m_sceneGraph->SetRootNode(rootNode);
62
63 m_light->SetDirection(double3(-1.0, -1.0, -1.0));
64 m_light->angularSize = 1.f;
65 m_light->irradiance = 3.f;
66
67 m_descriptors.fill(nvrhi::BindingSetItem::None());
68}
69
70bool ModelView::Init(nvrhi::FramebufferInfoEx const& framebufferInfo)
71{

Callers

nothing calls this directly

Calls 1

AnimateMethod · 0.45

Tested by

no test coverage detected