Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
ray.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 2024-05-01
15// Version V1.0.0
16//##################################################################################################
17
18#pragma once
19
20#include "tuple.h"
21
22namespace cil
23{
24 class Vector3f;
25 class Matrix4f;
28 class Ray : public Tuple<float>
29 {
30 public:
31 Ray();
32 Ray(const Ray& other);
33 Ray(const Vector3f& origin, const Vector3f& normal);
34
36 const float& operator[](int index) const;
38 float& operator[](int index);
39
41 void set(const Vector3f& origin, const Vector3f& direction);
50
52 Vector3f project(const Vector3f& point) const;
54 void transform(const Matrix4f& other);
55 };
56
57 using ray = Ray;
58}
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element...
Definition ray.h:29
Ray()
Constructs a Ray object, all elements initialized to 0.
Vector3f direction() const
Gets a Vector3f object that is the direction of the current Ray.
void transform(const Matrix4f &other)
Transform the current Ray object using the other transformation matrix.
Ray(const Vector3f &origin, const Vector3f &normal)
Constructs a Ray object using the origin point and the direction.
Vector3f project(const Vector3f &point) const
Gets the projected point of the other point on the current Ray.
float & operator[](int index)
Provides read-write access to the element at a specific index(position) within the Ray object.
Vector3f origin() const
Gets a Vector3f object that is the origin of the current Ray.
void set(const Vector3f &origin, const Vector3f &direction)
Sets the origin point and direction of the Ray object.
void setDirection(const Vector3f &direction)
Sets the direction ot the current Ray.
const float & operator[](int index) const
Provides read-only access to the element at a specific index(position) within the Ray object.
Ray(const Ray &other)
void setOrigin(const Vector3f &origin)
Sets the origin of the current Ray.
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