1 #ifndef RAYLIB_CPP_INCLUDE_VECTOR3_HPP_
2 #define RAYLIB_CPP_INCLUDE_VECTOR3_HPP_
4 #ifndef RAYLIB_CPP_NO_MATH
8 #include "./raylib.hpp"
9 #include "./raymath.hpp"
10 #include "./raylib-cpp-utils.hpp"
28 set(ColorToHSV(color));
31 GETTERSETTER(
float, X, x)
32 GETTERSETTER(
float, Y, y)
33 GETTERSETTER(
float, Z, z)
40 bool operator==(const ::Vector3& other) {
46 #ifndef RAYLIB_CPP_NO_MATH
47 Vector3 Add(const ::Vector3& vector3) {
48 return Vector3Add(*
this, vector3);
51 Vector3 operator+(const ::Vector3& vector3) {
52 return Vector3Add(*
this, vector3);
55 Vector3 Subtract(const ::Vector3& vector3) {
56 return Vector3Subtract(*
this, vector3);
59 Vector3 operator-(const ::Vector3& vector3) {
60 return Vector3Subtract(*
this, vector3);
64 return Vector3Negate(*
this);
68 return Vector3Negate(*
this);
71 Vector3 Multiply(const ::Vector3& vector3)
const {
72 return Vector3Multiply(*
this, vector3);
75 Vector3 operator*(const ::Vector3& vector3)
const {
76 return Vector3Multiply(*
this, vector3);
79 Vector3 Scale(
const float scale)
const {
80 return Vector3Scale(*
this, scale);
83 Vector3 operator*(
const float scale)
const {
84 return Vector3Scale(*
this, scale);
87 Vector3 Divide(const ::Vector3& vector3)
const {
88 return Vector3Divide(*
this, vector3);
91 Vector3 operator/(const ::Vector3& vector3)
const {
92 return Vector3Divide(*
this, vector3);
95 Vector3 Divide(
const float div)
const {
96 return ::Vector3{x / div, y / div, z / div};
99 Vector3 operator/(
const float div)
const {
103 Vector3& operator+=(const ::Vector3& vector3) {
104 set(Vector3Add(*
this, vector3));
109 Vector3& operator-=(const ::Vector3& vector3) {
110 set(Vector3Subtract(*
this, vector3));
116 Vector3& operator*=(const ::Vector3& vector3) {
117 set(Vector3Multiply(*
this, vector3));
122 Vector3& operator*=(
const float scale) {
123 set(Vector3Scale(*
this, scale));
128 Vector3& operator/=(const ::Vector3& vector3) {
136 Vector3& operator/=(
const float div) {
144 float Length()
const {
145 return Vector3Length(*
this);
148 Vector3 Normalize()
const {
149 return Vector3Normalize(*
this);
152 float DotProduct(const ::Vector3& vector3) {
153 return Vector3DotProduct(*
this, vector3);
156 float Distance(const ::Vector3& vector3)
const {
157 return Vector3Distance(*
this, vector3);
160 Vector3 Lerp(const ::Vector3& vector3,
const float amount)
const {
161 return Vector3Lerp(*
this, vector3, amount);
164 Vector3 CrossProduct(const ::Vector3& vector3)
const {
165 return Vector3CrossProduct(*
this, vector3);
168 Vector3 Perpendicular()
const {
169 return Vector3Perpendicular(*
this);
172 void OrthoNormalize(::Vector3* vector3) {
173 Vector3OrthoNormalize(
this, vector3);
176 Vector3 Transform(const ::Matrix& matrix)
const {
177 return Vector3Transform(*
this, matrix);
180 Vector3 RotateByQuaternion(const ::Quaternion& quaternion) {
181 return Vector3RotateByQuaternion(*
this, quaternion);
184 Vector3 Reflect(const ::Vector3& normal)
const {
185 return Vector3Reflect(*
this, normal);
188 Vector3 Min(const ::Vector3& vector3) {
189 return Vector3Min(*
this, vector3);
192 Vector3 Max(const ::Vector3& vector3) {
193 return Vector3Max(*
this, vector3);
196 Vector3 Barycenter(const ::Vector3& a, const ::Vector3& b, const ::Vector3& c) {
197 return Vector3Barycenter(*
this, a, b, c);
200 static Vector3 Zero() {
201 return Vector3Zero();
204 static Vector3 One() {
209 inline Vector3& DrawLine3D(const ::Vector3& endPos, ::Color color) {
210 ::DrawLine3D(*
this, endPos, color);
214 inline Vector3& DrawPoint3D(::Color color) {
215 ::DrawPoint3D(*
this, color);
219 inline Vector3& DrawCircle3D(
221 const ::Vector3& rotationAxis,
224 ::DrawCircle3D(*
this, radius, rotationAxis, rotationAngle, color);
228 inline Vector3& DrawCube(
float width,
float height,
float length, ::Color color) {
229 ::DrawCube(*
this, width, height, length, color);
233 inline Vector3& DrawCube(const ::Vector3& size, ::Color color) {
234 ::DrawCubeV(*
this, size, color);
238 inline Vector3& DrawCubeWires(
float width,
float height,
float length, ::Color color) {
239 ::DrawCubeWires(*
this, width, height, length, color);
243 inline Vector3& DrawCubeWires(const ::Vector3& size, ::Color color) {
244 ::DrawCubeWiresV(*
this, size, color);
248 inline Vector3& DrawCubeTexture(
249 const ::Texture2D& texture,
254 ::DrawCubeTexture(texture, *
this, width, height, length, color);
258 inline Vector3& DrawSphere(
float radius, ::Color color) {
259 ::DrawSphere(*
this, radius, color);
263 inline Vector3& DrawSphere(
float radius,
int rings,
int slices, ::Color color) {
264 ::DrawSphereEx(*
this, radius, rings, slices, color);
268 inline Vector3& DrawSphereWires(
float radius,
int rings,
int slices, ::Color color) {
269 ::DrawSphereWires(*
this, radius, rings, slices, color);
273 inline Vector3& DrawCylinder(
float radiusTop,
float radiusBottom,
float height,
274 int slices, Color color) {
275 ::DrawCylinder(*
this, radiusTop, radiusBottom, height, slices, color);
279 inline Vector3& DrawCylinderWires(
float radiusTop,
float radiusBottom,
float height,
280 int slices, Color color) {
281 ::DrawCylinderWires(*
this, radiusTop, radiusBottom, height, slices, color);
285 inline Vector3& DrawPlane(const ::Vector2& size, ::Color color) {
286 ::DrawPlane(*
this, size, color);
293 inline bool CheckCollision(
float radius1, const ::Vector3& center2,
float radius2) {
294 return CheckCollisionSpheres(*
this, radius1, center2, radius2);
298 inline void set(const ::Vector3& vec) {
306 #endif // RAYLIB_CPP_INCLUDE_VECTOR3_HPP_