Enum hltas::types::VectorialStrafingConstraints
source · pub enum VectorialStrafingConstraints {
VelocityYaw {
tolerance: f32,
},
AvgVelocityYaw {
tolerance: f32,
},
VelocityYawLocking {
tolerance: f32,
},
Yaw {
yaw: f32,
tolerance: f32,
},
YawRange {
from: f32,
to: f32,
},
LookAt {
entity: Option<NonZeroU32>,
x: f32,
y: f32,
z: f32,
},
}
Expand description
Constraints for the vectorial strafing algorithm.
Variants§
VelocityYaw
Constrains the player yaw relative the velocity yaw.
AvgVelocityYaw
Fields
Constrains the player yaw relative the yaw of velocity averaged over last two frames.
VelocityYawLocking
Fields
Constrains the player yaw to the velocity yaw, locking to the target strafing yaw.
When the velocity yaw rotates past the target strafing yaw (usually the frame bulk yaw), the constraint locks the player yaw to the target strafing yaw. When the target strafing yaw changes, the yaw is unlocked and follows the velocity yaw until the next time it reaches the target strafing yaw, and so on.
Yaw
Fields
Constrains the player yaw relative to the given yaw.
YawRange
Fields
Constrains the player yaw to the given range.
The range is in degrees, mod 360, inclusive from both sides. The order matters: from 10 to 350 results in a wide angle range, and from 350 to 10 results in a narrow angle range opposite to the first one.
LookAt
Fields
entity: Option<NonZeroU32>
If set, the coordinates will be added to the origin of an entity with this index.
Constrains the player yaw to look at the given point.
Trait Implementations§
source§impl Clone for VectorialStrafingConstraints
impl Clone for VectorialStrafingConstraints
source§fn clone(&self) -> VectorialStrafingConstraints
fn clone(&self) -> VectorialStrafingConstraints
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VectorialStrafingConstraints
impl Debug for VectorialStrafingConstraints
source§impl PartialEq<VectorialStrafingConstraints> for VectorialStrafingConstraints
impl PartialEq<VectorialStrafingConstraints> for VectorialStrafingConstraints
source§fn eq(&self, other: &VectorialStrafingConstraints) -> bool
fn eq(&self, other: &VectorialStrafingConstraints) -> bool
self
and other
values to be equal, and is used
by ==
.