LeviLamina
Loading...
Searching...
No Matches
Vec3.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class Vec2;
8// clang-format on
9
10class Vec3 : public ll::math::floatN3<Vec3> {
11public:
12 using floatN3::floatN3;
13
14public:
15 // member functions
16 // NOLINTBEGIN
17 MCAPI ::Vec3 abs() const;
18
19 MCAPI ::Vec3 ceil() const;
20
21 MCAPI float distanceToLineSquared(::Vec3 const& p0, ::Vec3 const& p1) const;
22
23 MCAPI ::Vec3 floor(float offset) const;
24
25 MCAPI bool isNan() const;
26
27 MCAPI bool isNear(::Vec3 const& rhs, float e) const;
28
29 MCAPI float maxComponent() const;
30
31 MCAPI ::Vec3 round() const;
32
33 MCAPI ::std::string toJsonString() const;
34
35 MCAPI ::std::string toString() const;
36
37 MCAPI ::Vec3 xz() const;
38 // NOLINTEND
39
40public:
41 // static functions
42 // NOLINTBEGIN
43 MCAPI static ::Vec3 clamp(::Vec3 const& v, ::Vec3 const& clipMin, ::Vec3 const& clipMax);
44
45 MCAPI static ::Vec3 directionFromRotation(::Vec2 const& rot);
46
47 MCAPI static ::Vec3 directionFromRotation(float rotX, float rotY);
48
49 MCAPI static ::Vec3 fromXZ(::Vec2 const& xz, float y);
50
51#ifdef LL_PLAT_C
52 MCAPI static ::std::optional<::Vec3> getIntersection(
53 ::Vec3 const& lineOrigin,
54 ::Vec3 const& lineDirectionUnit,
55 ::Vec3 const& pointOnPlane,
56 ::Vec3 const& planeNormal,
57 bool allowBehind
58 );
59#endif
60
61 MCAPI static ::Vec2 rotationFromDirection(::Vec3 const& dir);
62
63 MCAPI static ::Vec2 toXZ(::Vec3 const& vec);
64 // NOLINTEND
65
66public:
67 // static variables
68 // NOLINTBEGIN
69 MCAPI static ::Vec3 const& HALF();
70
71 MCAPI static ::Vec3 const& MAX();
72
73 MCAPI static ::Vec3 const& MIN();
74
75 MCAPI static ::Vec3 const& NEG_UNIT_X();
76
77 MCAPI static ::Vec3 const& NEG_UNIT_Y();
78
79 MCAPI static ::Vec3 const& NEG_UNIT_Z();
80
81 MCAPI static ::Vec3 const& ONE();
82
83 MCAPI static ::Vec3 const& UNIT_X();
84
85 MCAPI static ::Vec3 const& UNIT_Y();
86
87 MCAPI static ::Vec3 const& UNIT_Z();
88
89 MCAPI static ::Vec3 const& ZERO();
90 // NOLINTEND
91};
Definition Vec2.h:5
Definition Vec3.h:10