Struct collider::HbVel
[−]
[src]
pub struct HbVel { pub value: Vec2, pub resize: Vec2, pub end_time: f64, }
Velocity information describing how a hitbox shape is changing over time.
Fields
value: Vec2
The movement velocity of the hitbox.
resize: Vec2
A velocity describing how the hitbox dims are changing over time.
Since the width and height of the shape is greater than padding
at all times,
if a resize velocity is set that decreases the dimensions of the shape over time,
then the user is responsible for ensuring that the shape will not decrease below this threshold.
Collider may panic if this is violated.
end_time: f64
An upper-bound on the time at which the hitbox will be updated by the user.
This is an advanced feature for efficiency and does not impact the results. Infinity is used as the default, but using a lower value may improve performance
Collider will panic if the end time is exceeded without update, at least in unoptimized builds. It is ultimately the user's responsibility to ensure that end times are not exceeded.
Methods
impl HbVel
[src]
fn moving(value: Vec2) -> HbVel
[src]
Creates an HbVel
with the given value
.
fn moving_until(value: Vec2, end_time: f64) -> HbVel
[src]
Creates an HbVel
with the given value
and end_time
.
fn still() -> HbVel
[src]
Creates a stationary HbVel
.
fn still_until(end_time: f64) -> HbVel
[src]
Creates a stationary HbVel
with the given end_time
.
Trait Implementations
impl PartialEq for HbVel
[src]
fn eq(&self, __arg_0: &HbVel) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HbVel) -> bool
[src]
This method tests for !=
.
impl Clone for HbVel
[src]
fn clone(&self) -> HbVel
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more