pub trait Rotation<T>:
Into<Matrix3<T>>
+ From<Matrix3<T>>
+ Into<Axes<T>>
+ From<Axes<T>>
+ Into<Rotor<T>>
+ From<Rotor<T>>
+ Into<Quaternion<T>>
+ From<Quaternion<T>>{
const X_AXIS: Vector3<T> = _;
const Y_AXIS: Vector3<T> = _;
const Z_AXIS: Vector3<T> = _;
// Required methods
fn look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn look_at_xz(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn look_at_yz(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn look_at_lock(
pos: Vector3<T>,
look_at: Vector3<T>,
locked_axis: Vector3<T>,
) -> Self;
fn camera_look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn camera_look_at_xz(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn camera_look_at_yz(pos: Vector3<T>, look_at: Vector3<T>) -> Self;
fn camera_look_at_lock(
pos: Vector3<T>,
look_at: Vector3<T>,
locked_axis: Vector3<T>,
) -> Self;
}Provided Associated Constants§
const X_AXIS: Vector3<T> = _
const Y_AXIS: Vector3<T> = _
const Z_AXIS: Vector3<T> = _
Required Methods§
Sourcefn look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self
Generate a rotation for an object at a position look at a point. only uses the X and Y rotation axes to arrive at this result Z rotation axis
↻
| locked Z rotation axis
| /
o ---- ⤺§Arguments
pos- AVector3<f32>representing the position of the objectlook_at- AVector3<f32>representing the position the object is to look at
Sourcefn look_at_xz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn look_at_xz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
Generate a rotation for an object at a position look at a point. only uses the X and Z rotation axes to arrive at this result Z rotation axis
locked Y rotation axis
| ⤺
| /
o ---- ⤺§Arguments
pos- AVector3<f32>representing the position of the objectlook_at- AVector3<f32>representing the position the object is to look at
Sourcefn look_at_yz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn look_at_yz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
Generate a rotation for an object at a position look at a point. only uses the Z and Y rotation axes to arrive at this result Z rotation axis
↻
| ⤺
| /
o ---- locked X rotation axis§Arguments
pos- AVector3<f32>representing the position of the objectlook_at- AVector3<f32>representing the position the object is to look at
Sourcefn look_at_lock(
pos: Vector3<T>,
look_at: Vector3<T>,
locked_axis: Vector3<T>,
) -> Self
fn look_at_lock( pos: Vector3<T>, look_at: Vector3<T>, locked_axis: Vector3<T>, ) -> Self
Generate a rotation for an object at a position look at a point. only uses the Z and Y rotation axes to arrive at this result Z rotation axis
↻
| ⤺
| /
o ---- ⤺
\
locked_axis§Arguments
pos- AVector3<f32>representing the position of the objectlook_at- AVector3<f32>representing the position the object is to look at
Sourcefn camera_look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn camera_look_at_xy(pos: Vector3<T>, look_at: Vector3<T>) -> Self
Camera Objects look along the -Z axis so the look_at function for a camera object needs to be modified a little. flipping the pos and the look_at should do the trick. TODO: finish comments watch out bc z is reversed and things may get wonky
^ Z
|
|
Y• C ------> X
/ \
/ \
/ \§Arguments
pos- AVector3<f32>representing the position of the cameralook_at- AVector3<f32>representing the position the camera is to look at
fn camera_look_at_xz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn camera_look_at_yz(pos: Vector3<T>, look_at: Vector3<T>) -> Self
fn camera_look_at_lock( pos: Vector3<T>, look_at: Vector3<T>, locked_axis: Vector3<T>, ) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.