VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
lightCamera.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 04.10.2025.
5//
6#include "lightCamera.h"
7
8#include "scene/graphNode.h"
9
10namespace visutwin::canvas
11{
14 Quaternion::fromEulerAngles(0, -90, 180),
17 Quaternion::fromEulerAngles(0, 180, 180),
19 };
20
21 Camera* LightCamera::create(const std::string& name, LightType lightType, int face)
22 {
23 Camera* camera = new Camera();
24 camera->setNode(new GraphNode(name));
25 camera->setAspectRatio(1.0f);
27 camera->setScissorRectClear(true);
28
29 // Set up constant settings based on a light type
30 switch (lightType) {
32 camera->node()->setRotation(pointLightRotations[face]);
33 camera->setFov(90.0f);
35 break;
36
39 break;
40
43 break;
44 }
45
46 return camera;
47 }
48}
Perspective or orthographic camera with projection matrix, jitter (TAA), and render target binding.
Definition camera.h:40
void setProjection(ProjectionType value)
Definition camera.cpp:17
void setScissorRectClear(bool value)
Definition camera.h:105
void setFov(float value)
Definition camera.h:43
void setAspectRatio(float value)
Definition camera.cpp:25
void setNode(GraphNode *value)
Definition camera.cpp:12
const std::unique_ptr< GraphNode > & node() const
Definition camera.h:102
void setAspectRatioMode(AspectRatioMode value)
Definition camera.cpp:33
Hierarchical scene graph node with local/world transforms and parent-child relationships.
Definition graphNode.h:28
static Quaternion pointLightRotations[6]
Definition lightCamera.h:17
static Camera * create(const std::string &name, LightType lightType, int face=0)
Unit quaternion for rotation representation with SIMD-accelerated slerp and multiply.
Definition quaternion.h:20
static Quaternion fromEulerAngles(float ax, float ay, float az)