FreeCameraOrientation class final
A rotation in 3D space, as a unit quaternion.
A unit quaternion has a length of 1: x² + y² + z² + w² = 1, so each
component is in the range -1 to 1. A rotation by an angle a around a
unit axis (ax, ay, az) is
(ax · sin(a/2), ay · sin(a/2), az · sin(a/2), cos(a/2)).
q and -q give the same rotation.
The identity rotation is FreeCameraOrientation(x: 0, y: 0, z: 0, w: 1).
Constructors
- FreeCameraOrientation({required double x, required double y, required double z, required double w})
-
Creates a quaternion from its components.
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- w → double
-
The scalar part,
cos(a/2).final - x → double
-
The x component of the vector part,
ax · sin(a/2).final - y → double
-
The y component of the vector part,
ay · sin(a/2).final - z → double
-
The z component of the vector part,
az · sin(a/2).final
Methods
-
copyWith(
{double? x, double? y, double? z, double? w}) → FreeCameraOrientation - Returns a copy of this quaternion with the given components replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- identity → const FreeCameraOrientation
- The identity rotation.