1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! # Gravity Action
//!
//! This module provides gravity modification functionality for kinematic character controllers.
//! It allows overriding or limiting the character's falling speed by applying custom gravity values.
use Vec3;
use crateKccVelocity;
/// Action for modifying gravity effects on a character.
///
/// This action allows you to override or limit the character's downward velocity
/// by applying a custom gravity value. It's commonly used for:
///
/// * **Floating/Gliding**: Reducing fall speed for gliding mechanics
/// * **Low Gravity Areas**: Creating areas with different gravity
/// * **Terminal Velocity**: Capping maximum fall speed
/// * **Anti-Gravity**: Creating upward forces or zero gravity
///
/// The action works by clamping the Y velocity to not exceed the custom gravity value,
/// effectively limiting how fast the character can fall.
///
/// ## Example
///
/// ```rust
/// use bevy::math::Vec3;
/// use your_crate::actions::GravityAction;
///
/// // Create a floating/gliding effect (slower falling)
/// let floating = GravityAction::new(Vec3::new(0.0, -2.0, 0.0));
///
/// // Create zero gravity
/// let zero_gravity = GravityAction::new(Vec3::ZERO);
///
/// // Create upward force (anti-gravity)
/// let anti_gravity = GravityAction::new(Vec3::new(0.0, 5.0, 0.0));
/// ```