Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
vector3.h
Go to the documentation of this file.
1#pragma once
2
8class Vector3 {
9 public:
10 float x;
11 float y;
12 float z;
13
15 Vector3(float x, float y, float z);
16
17 Vector3 operator+(const Vector3& other) const noexcept;
18 Vector3 operator-(const Vector3& other) const noexcept;
19 Vector3 operator*(const Vector3& other) const noexcept;
20 Vector3 operator/(const Vector3& other) const noexcept;
21
22 Vector3& operator+=(const Vector3& other) noexcept;
23 Vector3& operator-=(const Vector3& other) noexcept;
24 Vector3& operator*=(const Vector3& other) noexcept;
25 Vector3& operator/=(const Vector3& other) noexcept;
26
27 Vector3 operator*(float value) const noexcept;
28 Vector3 operator/(float value) const noexcept;
29
30 Vector3& operator*=(float value) noexcept;
31 Vector3& operator/=(float value) noexcept;
32
37 float length() const noexcept;
38
43 void normalize() noexcept;
44
50 bool equals(const Vector3& other) const noexcept;
51};
Represents a 3D vector with x, y, and z components. This class provides basic vector operations such ...
Definition vector3.h:8
Vector3 operator-(const Vector3 &other) const noexcept
Vector3 & operator*=(float value) noexcept
Vector3 operator+(const Vector3 &other) const noexcept
Vector3 operator/(float value) const noexcept
Vector3 & operator/=(float value) noexcept
Vector3 & operator*=(const Vector3 &other) noexcept
Vector3 & operator-=(const Vector3 &other) noexcept
float x
Definition vector3.h:10
float y
Definition vector3.h:11
void normalize() noexcept
Normalizes the vector to have a length of 1.
Vector3 operator/(const Vector3 &other) const noexcept
float z
Definition vector3.h:12
Vector3 operator*(float value) const noexcept
float length() const noexcept
Calculates the length (magnitude) of the vector.
Vector3 operator*(const Vector3 &other) const noexcept
Vector3(float x, float y, float z)
Vector3 & operator/=(const Vector3 &other) noexcept
Vector3 & operator+=(const Vector3 &other) noexcept
bool equals(const Vector3 &other) const noexcept
Checks if this vector is equal to another vector.