29 degenerate(s.degenerate || degenerate_)
34 const Vector3f axis = source % destination;
42 const Vector3f pos(fabsf(source.
i), fabsf(source.
j), fabsf(source.
k));
44 if(pos.
i < pos.
j && pos.
i < pos.
k)
46 else if(pos.
j < pos.
k)
57 const float half_theta = 0.5f * theta;
59 const float time = float(
cos(half_theta));
60 const float space_coeff = float(
sin(half_theta));
71 const Vector3f axis0 = default_forward % destination_forward;
72 const float angle0 = default_forward.
angle_between(destination_forward);
82 const Vector3f intermediate_up = rotation0 * default_up;
83 const Vector3f axis1 = intermediate_up % destination_up;
84 const float angle1 = intermediate_up.
angle_between(destination_up);
94 return (rotation1 * rotation0).normalized();
98 : degenerate(degenerate_)
100 const float half_yaw = 0.5f * yaw;
101 const float half_pitch = 0.5f * pitch;
102 const float half_roll = 0.5f * roll;
104 const float shy = float(
sin(half_yaw));
105 const float shp = float(
sin(half_pitch));
106 const float shr = float(
sin(half_roll));
107 const float chy = float(
cos(half_yaw));
108 const float chp = float(
cos(half_pitch));
109 const float chr = float(
cos(half_roll));
111 time = chr * chp * chy + shr * shp * shy;
112 space.
i = shr * chp * chy - chr * shp * shy;
113 space.
j = chr * shp * chy + shr * chp * shy;
114 space.
k = chr * chp * shy - shr * shp * chy;
120 degenerate(rhs.degenerate || degenerate_)
132 mplier = 1.0f / mplier;
146 mplier = 1.0f / mplier;
static Quaternion Vector3f_to_Vector3f(const Vector3f &destination, const Vector3f &source)
Create a Quaternion rotating to one Vector3f from another.
static Quaternion Axis_Angle(const Vector3f &v, const float &theta)
Create a Quaternion from an Axis/Angle pair.
std::istream & unserialize(std::istream &is, Color &value)
std::ostream & serialize(std::ostream &os, const Color &value)
A Featureful 3-Space Vector Class.
const float pi
pi == 3.1415926...
Quaternion normalized() const
Get the normalized vector.
A Featureful Quaternion Class.
static Quaternion Forward_Up(const Vector3f &destination_forward, const Vector3f &destination_up, const Vector3f &default_forward=ZENI_DEFAULT_FORWARD_VECTOR, const Vector3f &default_up=ZENI_DEFAULT_UP_VECTOR)
Create a Quaternion from a Forward/Up Vector3f pair.
float angle_between(const Vector3f &rhs) const
Find the angle between the Vector3fs.
float magnitude() const
Get the magnitude of the vector.
EGLSurface EGLint void ** value
Quaternion(const bool °enerate_=false)
GLsizei GLsizei GLchar * source
Quaternion & normalize()
Normalize the vector.
Vector3f normalized() const
Get the normalized vector.