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 bool operator!=(const ::Vector3& other) {
47 return !(*
this == other);
50 #ifndef RAYLIB_CPP_NO_MATH
55 return Vector3Add(*
this, vector3);
62 return Vector3Add(*
this, vector3);
65 Vector3& operator+=(const ::Vector3& vector3) {
66 set(Vector3Add(*
this, vector3));
75 return Vector3Subtract(*
this, vector3);
82 return Vector3Subtract(*
this, vector3);
85 Vector3& operator-=(const ::Vector3& vector3) {
86 set(Vector3Subtract(*
this, vector3));
95 return Vector3Negate(*
this);
102 return Vector3Negate(*
this);
109 return Vector3Multiply(*
this, vector3);
116 return Vector3Multiply(*
this, vector3);
123 set(Vector3Multiply(*
this, vector3));
132 return Vector3Scale(*
this, scaler);
139 return Vector3Scale(*
this, scaler);
146 set(Vector3Scale(*
this, scaler));
155 return Vector3Divide(*
this, vector3);
162 return Vector3Divide(*
this, vector3);
180 return ::Vector3{x / div, y / div, z / div};
205 return Vector3Length(*
this);
208 inline Vector3 Normalize()
const {
209 return Vector3Normalize(*
this);
212 inline float DotProduct(const ::Vector3& vector3) {
213 return Vector3DotProduct(*
this, vector3);
216 inline float Distance(const ::Vector3& vector3)
const {
217 return Vector3Distance(*
this, vector3);
220 inline Vector3 Lerp(const ::Vector3& vector3,
const float amount)
const {
221 return Vector3Lerp(*
this, vector3, amount);
224 inline Vector3 CrossProduct(const ::Vector3& vector3)
const {
225 return Vector3CrossProduct(*
this, vector3);
228 inline Vector3 Perpendicular()
const {
229 return Vector3Perpendicular(*
this);
232 inline void OrthoNormalize(::Vector3* vector3) {
233 Vector3OrthoNormalize(
this, vector3);
236 inline Vector3 Transform(const ::Matrix& matrix)
const {
237 return Vector3Transform(*
this, matrix);
240 inline Vector3 RotateByQuaternion(const ::Quaternion& quaternion) {
241 return Vector3RotateByQuaternion(*
this, quaternion);
244 inline Vector3 Reflect(const ::Vector3& normal)
const {
245 return Vector3Reflect(*
this, normal);
248 inline Vector3 Min(const ::Vector3& vector3) {
249 return Vector3Min(*
this, vector3);
252 inline Vector3 Max(const ::Vector3& vector3) {
253 return Vector3Max(*
this, vector3);
256 inline Vector3 Barycenter(const ::Vector3& a, const ::Vector3& b, const ::Vector3& c) {
257 return Vector3Barycenter(*
this, a, b, c);
260 static inline Vector3 Zero() {
261 return Vector3Zero();
264 static inline Vector3 One() {
269 inline Vector3& DrawLine3D(const ::Vector3& endPos, ::Color color) {
270 ::DrawLine3D(*
this, endPos, color);
274 inline Vector3& DrawPoint3D(::Color color) {
275 ::DrawPoint3D(*
this, color);
279 inline Vector3& DrawCircle3D(
281 const ::Vector3& rotationAxis,
284 ::DrawCircle3D(*
this, radius, rotationAxis, rotationAngle, color);
288 inline Vector3& DrawCube(
float width,
float height,
float length, ::Color color) {
289 ::DrawCube(*
this, width, height, length, color);
293 inline Vector3& DrawCube(const ::Vector3& size, ::Color color) {
294 ::DrawCubeV(*
this, size, color);
298 inline Vector3& DrawCubeWires(
float width,
float height,
float length, ::Color color) {
299 ::DrawCubeWires(*
this, width, height, length, color);
303 inline Vector3& DrawCubeWires(const ::Vector3& size, ::Color color) {
304 ::DrawCubeWiresV(*
this, size, color);
308 inline Vector3& DrawCubeTexture(
309 const ::Texture2D& texture,
314 ::DrawCubeTexture(texture, *
this, width, height, length, color);
318 inline Vector3& DrawSphere(
float radius, ::Color color) {
319 ::DrawSphere(*
this, radius, color);
323 inline Vector3& DrawSphere(
float radius,
int rings,
int slices, ::Color color) {
324 ::DrawSphereEx(*
this, radius, rings, slices, color);
328 inline Vector3& DrawSphereWires(
float radius,
int rings,
int slices, ::Color color) {
329 ::DrawSphereWires(*
this, radius, rings, slices, color);
333 inline Vector3& DrawCylinder(
float radiusTop,
float radiusBottom,
float height,
334 int slices, Color color) {
335 ::DrawCylinder(*
this, radiusTop, radiusBottom, height, slices, color);
339 inline Vector3& DrawCylinderWires(
float radiusTop,
float radiusBottom,
float height,
340 int slices, Color color) {
341 ::DrawCylinderWires(*
this, radiusTop, radiusBottom, height, slices, color);
345 inline Vector3& DrawPlane(const ::Vector2& size, ::Color color) {
346 ::DrawPlane(*
this, size, color);
353 inline bool CheckCollision(
float radius1, const ::Vector3& center2,
float radius2) {
354 return CheckCollisionSpheres(*
this, radius1, center2, radius2);
358 void set(const ::Vector3& vec) {
366 #endif // RAYLIB_CPP_INCLUDE_VECTOR3_HPP_