Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
quaternion.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2025-08-05
15// Version V2.1.0
16//##################################################################################################
17
18#pragma once
19
20#include "tuple.h"
21
22namespace cil
23{
24 class Vector3f;
27 class Quaternion : public Tuple<float>
28 {
29 public:
31 Quaternion(const Quaternion& other);
32 Quaternion(float x, float y, float z, float w);
35 Quaternion(const Vector3f& axis, float angle);
37 const float& operator[](int index) const;
39 float& operator[](int index);
43 const float& operator[](char key) const;
47 float& operator[](char key);
51 void set(float x, float y, float z, float w);
54 void set(const Vector3f& axis, float angle);
56 bool normalize();
57 };
58
60}
The Quaternion class inherits from the Tuple class, specilizing the templated parameter to float for ...
Definition quaternion.h:28
Quaternion()
Constructs a Quaternion object, all elements initialized to 0.
void set(float x, float y, float z, float w)
Sets the elements of the Quaternion object.
Quaternion(float x, float y, float z, float w)
void set(const Vector3f &axis, float angle)
Sets the elements of the Quaternion object using the rotating axis and rotating angle.
bool normalize()
Normalize the current Quaternion object and returns a boolean value indicating success.
const float & operator[](int index) const
Provides read-only access to the element at a specific index(position) within the Quaternion object.
float & operator[](int index)
Provides read-write access to the element at a specific index(position) within the Quaternion object.
Quaternion(const Quaternion &other)
const float & operator[](char key) const
Provides read-only access to a element within the Quaternion object using a character key.
Quaternion operator-() const
Returns a Quaternion object that is formed by changing the sign of each element of the current quater...
Quaternion(const Vector3f &axis, float angle)
Constructs a Quaternion object using the rotating axis and rotating angle.
float & operator[](char key)
Provides read-write access to a element within the Quaternion object using a character key.
The Tuple is a templated class inheriting from the most basic class Variant.
Definition tuple.h:27
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
Definition decal.h:23