MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / string

Method string

include/Quaternion.hpp:21–54  ·  view source on GitHub ↗

* Quaternion type */

Source from the content-addressed store, hash-verified

19 * Quaternion type
20 */
21class Quaternion : public ::Quaternion {
22public:
23 constexpr Quaternion(const ::Quaternion& quat) : ::Quaternion{quat.x, quat.y, quat.z, quat.w} {}
24 explicit constexpr Quaternion(const raylib::Vector4 vec4) : ::Quaternion{vec4.x, vec4.y, vec4.z, vec4.w} {}
25
26 explicit constexpr Quaternion(const float x = 0, const float y = 0, const float z = 0, const float w = 1) : ::Quaternion{x, y, z, w} {}
27
28 GETTERSETTER(float, X, x)
29 GETTERSETTER(float, Y, y)
30 GETTERSETTER(float, Z, z)
31 GETTERSETTER(float, W, w)
32
33 Quaternion& operator=(const ::Quaternion& quaternion) {
34 set(quaternion);
35 return *this;
36 }
37
38 /*
39 * An exact value by value equality comparison.
40 * Due to floating point inaccuracies consider using Equals instead.
41 */
42 constexpr bool operator==(const ::Quaternion& other) const {
43 return x == other.x && y == other.y && z == other.z && w == other.w;
44 }
45
46 /*
47 * An exact value by value inequality comparison.
48 * Due to floating point inaccuracies consider using Equals instead.
49 */
50 constexpr bool operator!=(const ::Quaternion& other) const { return !(*this == other); }
51
52 RLCPP_NODISCARD std::string ToString() const { return ::TextFormat("Quaternion(%f, %f, %f, %f)", x, y, z, w); }
53
54 operator std::string() const { return ToString(); }
55
56#ifndef RAYLIB_CPP_NO_MATH
57 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected