Sign in

    Milky2018/moon_rapier/control does not have a README file

    CharacterAutostep

    pub struct CharacterAutostep {
    max_height : CharacterLength
    min_width : CharacterLength
    include_dynamic_bodies : Bool
    }

    CharacterAutostep::CharacterAutostep

    fn CharacterAutostep::CharacterAutostep(max_height : CharacterLength, min_width : CharacterLength) -> CharacterAutostep

    CharacterAutostep::default

    CharacterAutostep::include_dynamic_bodies

    fn CharacterAutostep::include_dynamic_bodies(self : CharacterAutostep) -> Bool

    CharacterAutostep::max_height

    CharacterAutostep::min_width

    CharacterAutostep::with_include_dynamic_bodies

    fn CharacterAutostep::with_include_dynamic_bodies(self : CharacterAutostep, include_dynamic_bodies : Bool) -> CharacterAutostep

    CharacterLength

    pub(all) enum CharacterLength {
    Relative(Float)
    Absolute(Float)
    }

    CharacterLength::absolute

    fn CharacterLength::absolute(value : Float) -> CharacterLength

    CharacterLength::map_absolute

    fn CharacterLength::map_absolute(self : CharacterLength, f : (Float) -> Float) -> CharacterLength

    CharacterLength::map_relative

    fn CharacterLength::map_relative(self : CharacterLength, f : (Float) -> Float) -> CharacterLength

    CharacterLength::relative

    fn CharacterLength::relative(value : Float) -> CharacterLength

    DynamicRayCastVehicleController

    pub struct DynamicRayCastVehicleController {
    wheels : Array[Wheel]
    chassis :
    RigidBodyHandle

    index_up_axis : Int
    index_forward_axis : Int
    }

    DynamicRayCastVehicleController::DynamicRayCastVehicleController

    DynamicRayCastVehicleController::add_wheel

    fn DynamicRayCastVehicleController::add_wheel(self : DynamicRayCastVehicleController, chassis_connection_cs :
    Vec2
    , direction_cs :
    Vec2
    , suspension_rest_length : Float, radius : Float, tuning : WheelTuning) -> Unit

    DynamicRayCastVehicleController::set_brake

    fn DynamicRayCastVehicleController::set_brake(self : DynamicRayCastVehicleController, wheel_id : Int, brake : Float) -> Unit

    DynamicRayCastVehicleController::set_engine_force

    fn DynamicRayCastVehicleController::set_engine_force(self : DynamicRayCastVehicleController, wheel_id : Int, force : Float) -> Unit

    DynamicRayCastVehicleController::update_vehicle

    Updates wheel contacts and applies suspension/traction impulses to the chassis.

    Expected usage:
    • Build/update a QueryPipelineMut with a filter excluding the chassis' colliders.
    • Call this before the physics pipeline step so the impulses affect the solver.

    DynamicRayCastVehicleController3

    pub struct DynamicRayCastVehicleController3 {
    wheels : Array[Wheel3]
    forward_ws : Array[
    Vec3
    ]
    axle_ws : Array[
    Vec3
    ]
    current_vehicle_speed : Float
    chassis :
    RigidBodyHandle

    index_up_axis : Int
    index_forward_axis : Int
    }

    DynamicRayCastVehicleController3::DynamicRayCastVehicleController3

    DynamicRayCastVehicleController3::add_wheel

    fn DynamicRayCastVehicleController3::add_wheel(self : DynamicRayCastVehicleController3, chassis_connection_cs :
    Vec3
    , direction_cs :
    Vec3
    , axle_cs :
    Vec3
    , suspension_rest_length : Float, radius : Float, tuning : WheelTuning) -> Int

    DynamicRayCastVehicleController3::set_brake

    fn DynamicRayCastVehicleController3::set_brake(self : DynamicRayCastVehicleController3, wheel_id : Int, brake : Float) -> Unit

    DynamicRayCastVehicleController3::set_engine_force

    fn DynamicRayCastVehicleController3::set_engine_force(self : DynamicRayCastVehicleController3, wheel_id : Int, force : Float) -> Unit

    DynamicRayCastVehicleController3::set_steering_value

    fn DynamicRayCastVehicleController3::set_steering_value(self : DynamicRayCastVehicleController3, wheel_id : Int, steering : Float) -> Unit

    DynamicRayCastVehicleController3::wheels

    DynamicRayCastVehicleController3DReal

    pub struct DynamicRayCastVehicleController3DReal {
    wheels : Array[Wheel3DReal]
    forward_ws : Array[
    Vec3
    ]
    axle_ws : Array[
    Vec3
    ]
    current_vehicle_speed : Float
    chassis :
    RigidBodyHandle

    index_up_axis : Int
    index_forward_axis : Int
    }

    DynamicRayCastVehicleController3DReal::DynamicRayCastVehicleController3DReal

    DynamicRayCastVehicleController3DReal::add_wheel

    fn DynamicRayCastVehicleController3DReal::add_wheel(self : DynamicRayCastVehicleController3DReal, chassis_connection_cs :
    Vec3
    , direction_cs :
    Vec3
    , axle_cs :
    Vec3
    , suspension_rest_length : Float, radius : Float, tuning : WheelTuning) -> Int

    DynamicRayCastVehicleController3DReal::set_brake

    fn DynamicRayCastVehicleController3DReal::set_brake(self : DynamicRayCastVehicleController3DReal, wheel_id : Int, brake : Float) -> Unit

    DynamicRayCastVehicleController3DReal::set_engine_force

    fn DynamicRayCastVehicleController3DReal::set_engine_force(self : DynamicRayCastVehicleController3DReal, wheel_id : Int, force : Float) -> Unit

    DynamicRayCastVehicleController3DReal::set_steering_value

    fn DynamicRayCastVehicleController3DReal::set_steering_value(self : DynamicRayCastVehicleController3DReal, wheel_id : Int, steering : Float) -> Unit

    DynamicRayCastVehicleController3DReal::wheels

    DynamicRayCastVehicleController3DReal::wheels_mut

    EffectiveMovement

    #alias(EffectiveCharacterMovement)
    pub struct EffectiveMovement {
    translation :
    Vec2

    grounded : Bool
    is_sliding_down_slope : Bool
    }

    EffectiveMovement::is_grounded

    fn EffectiveMovement::is_grounded(self : EffectiveMovement) -> Bool

    EffectiveMovement::is_sliding_down_slope

    fn EffectiveMovement::is_sliding_down_slope(self : EffectiveMovement) -> Bool

    EffectiveMovement::translation

    EffectiveMovement3DReal

    pub struct EffectiveMovement3DReal {
    translation :
    Vec3

    grounded : Bool
    is_sliding_down_slope : Bool
    }

    EffectiveMovement3DReal::is_grounded

    fn EffectiveMovement3DReal::is_grounded(self : EffectiveMovement3DReal) -> Bool

    EffectiveMovement3DReal::is_sliding_down_slope

    fn EffectiveMovement3DReal::is_sliding_down_slope(self : EffectiveMovement3DReal) -> Bool

    EffectiveMovement3DReal::translation

    KinematicCharacterController

    pub struct KinematicCharacterController {
    up :
    Vec2

    offset : CharacterLength
    slide : Bool
    max_slope_climb_angle : Float
    min_slope_slide_angle : Float
    snap_to_ground : CharacterLength?
    autostep : CharacterAutostep?
    normal_nudge_factor : Float
    }

    KinematicCharacterController::KinematicCharacterController

    fn KinematicCharacterController::KinematicCharacterController() -> KinematicCharacterController

    KinematicCharacterController::default

    KinematicCharacterController::solve_character_collision_impulses

    KinematicCharacterController::with_autostep

    KinematicCharacterController::with_max_slope_climb_angle

    fn KinematicCharacterController::with_max_slope_climb_angle(self : KinematicCharacterController, angle : Float) -> KinematicCharacterController

    KinematicCharacterController::with_min_slope_slide_angle

    fn KinematicCharacterController::with_min_slope_slide_angle(self : KinematicCharacterController, angle : Float) -> KinematicCharacterController

    KinematicCharacterController::with_normal_nudge_factor

    fn KinematicCharacterController::with_normal_nudge_factor(self : KinematicCharacterController, normal_nudge_factor : Float) -> KinematicCharacterController

    KinematicCharacterController::with_offset

    KinematicCharacterController::with_slide

    KinematicCharacterController::with_snap_to_ground

    KinematicCharacterController3DReal

    pub struct KinematicCharacterController3DReal {
    up :
    Vec3

    offset : CharacterLength
    slide : Bool
    autostep : CharacterAutostep?
    max_slope_climb_angle : Float
    min_slope_slide_angle : Float
    snap_to_ground : CharacterLength?
    normal_nudge_factor : Float
    }

    KinematicCharacterController3DReal::KinematicCharacterController3DReal

    KinematicCharacterController3DReal::default

    KinematicCharacterController3DReal::solve_character_collision_impulses

    KinematicCharacterController3DReal::with_autostep

    KinematicCharacterController3DReal::with_max_slope_climb_angle

    KinematicCharacterController3DReal::with_min_slope_slide_angle

    KinematicCharacterController3DReal::with_normal_nudge_factor

    KinematicCharacterController3DReal::with_offset

    KinematicCharacterController3DReal::with_slide

    KinematicCharacterController3DReal::with_snap_to_ground

    PdController

    pub(all) struct PdController {
    lin_kp :
    Vec2

    lin_kd :
    Vec2

    ang_kp : Float
    ang_kd : Float
    axes :
    AxesMask

    }

    PdController::PdController

    fn PdController::PdController(kp : Float, kd : Float, axes :
    AxesMask
    ) -> PdController

    PdController::angular_rigid_body_correction

    fn PdController::angular_rigid_body_correction(self : PdController, rb :
    RigidBody
    , target_rot :
    Rot2
    , target_angvel : Float) -> Float

    PdController::correction

    PdController::default

    fn PdController::default() -> PdController

    PdController::linear_rigid_body_correction

    PdErrors

    pub(all) struct PdErrors {
    linear :
    Vec2

    angular : Float
    }

    PidController

    pub(all) struct PidController {
    pd : PdController
    lin_integral :
    Vec2

    ang_integral : Float
    lin_ki :
    Vec2

    ang_ki : Float
    }

    PidController::PidController

    fn PidController::PidController(kp : Float, ki : Float, kd : Float, axes :
    AxesMask
    ) -> PidController

    PidController::angular_rigid_body_correction

    fn PidController::angular_rigid_body_correction(self : PidController, dt : Float, rb :
    RigidBody
    , target_rot :
    Rot2
    , target_angvel : Float) -> Float

    PidController::correction

    PidController::default

    fn PidController::default() -> PidController

    PidController::linear_rigid_body_correction

    PidController::reset_integrals

    fn PidController::reset_integrals(self : PidController) -> PidController

    RayCastInfo

    pub struct RayCastInfo {
    contact_normal_ws :
    Vec2

    contact_point_ws :
    Vec2

    suspension_length : Float
    hard_point_ws :
    Vec2

    is_in_contact : Bool
    ground_object :
    ColliderHandle
    ?
    }

    RayCastInfo::default

    fn RayCastInfo::default() -> RayCastInfo

    RayCastInfo3

    pub struct RayCastInfo3 {
    contact_normal_ws :
    Vec3

    contact_point_ws :
    Vec3

    suspension_length : Float
    hard_point_ws :
    Vec3

    is_in_contact : Bool
    ground_object :
    ColliderHandle
    ?
    }

    RayCastInfo3::default

    fn RayCastInfo3::default() -> RayCastInfo3

    RayCastInfo3DReal

    pub struct RayCastInfo3DReal {
    contact_normal_ws :
    Vec3

    contact_point_ws :
    Vec3

    suspension_length : Float
    hard_point_ws :
    Vec3

    is_in_contact : Bool
    ground_object :
    ColliderHandle3D
    ?
    }

    Real dim3 ray-cast vehicle controller.

    Ported from rapier-reference/src/control/ray_cast_vehicle_controller.rs (v0.32.0, dim3). This controller uses ray-casts for suspension contacts and applies impulses on the chassis.

    RayCastInfo3DReal::default

    Wheel

    pub struct Wheel {
    raycast_info : RayCastInfo
    center :
    Vec2

    wheel_direction_ws :
    Vec2

    chassis_connection_point_cs :
    Vec2

    direction_cs :
    Vec2

    suspension_rest_length : Float
    max_suspension_travel : Float
    radius : Float
    suspension_stiffness : Float
    damping_compression : Float
    damping_relaxation : Float
    friction_slip : Float
    max_suspension_force : Float
    rotation : Float
    delta_rotation : Float
    clipped_inv_contact_dot_suspension : Float
    suspension_relative_velocity : Float
    wheel_suspension_force : Float
    forward_impulse : Float
    engine_force : Float
    brake : Float
    }

    Wheel::center

    Wheel::raycast_info

    fn Wheel::raycast_info(self : Wheel) -> RayCastInfo

    Wheel::suspension

    Wheel3

    pub struct Wheel3 {
    raycast_info : RayCastInfo3
    center :
    Vec3

    wheel_direction_ws :
    Vec3

    wheel_axle_ws :
    Vec3

    chassis_connection_point_cs :
    Vec3

    direction_cs :
    Vec3

    axle_cs :
    Vec3

    suspension_rest_length : Float
    max_suspension_travel : Float
    radius : Float
    suspension_stiffness : Float
    damping_compression : Float
    damping_relaxation : Float
    friction_slip : Float
    side_friction_stiffness : Float
    max_suspension_force : Float
    rotation : Float
    delta_rotation : Float
    roll_influence : Float
    clipped_inv_contact_dot_suspension : Float
    suspension_relative_velocity : Float
    wheel_suspension_force : Float
    skid_info : Float
    forward_impulse : Float
    side_impulse : Float
    steering : Float
    engine_force : Float
    brake : Float
    }

    Wheel3::center

    Wheel3::raycast_info

    fn Wheel3::raycast_info(self : Wheel3) -> RayCastInfo3

    Wheel3::suspension

    Wheel3DReal

    pub struct Wheel3DReal {
    raycast_info : RayCastInfo3DReal
    center :
    Vec3

    wheel_direction_ws :
    Vec3

    wheel_axle_ws :
    Vec3

    chassis_connection_point_cs :
    Vec3

    direction_cs :
    Vec3

    axle_cs :
    Vec3

    suspension_rest_length : Float
    max_suspension_travel : Float
    radius : Float
    suspension_stiffness : Float
    damping_compression : Float
    damping_relaxation : Float
    friction_slip : Float
    side_friction_stiffness : Float
    max_suspension_force : Float
    rotation : Float
    delta_rotation : Float
    roll_influence : Float
    clipped_inv_contact_dot_suspension : Float
    suspension_relative_velocity : Float
    wheel_suspension_force : Float
    skid_info : Float
    forward_impulse : Float
    side_impulse : Float
    steering : Float
    engine_force : Float
    brake : Float
    }

    Wheel3DReal::center

    Wheel3DReal::raycast_info

    fn Wheel3DReal::raycast_info(self : Wheel3DReal) -> RayCastInfo3DReal

    Wheel3DReal::suspension

    WheelTuning

    pub struct WheelTuning {
    suspension_stiffness : Float
    suspension_compression : Float
    suspension_damping : Float
    max_suspension_travel : Float
    side_friction_stiffness : Float
    friction_slip : Float
    max_suspension_force : Float
    }

    WheelTuning::default

    fn WheelTuning::default() -> WheelTuning

    WheelTuning::with_friction_slip

    fn WheelTuning::with_friction_slip(self : WheelTuning, friction_slip : Float) -> WheelTuning

    WheelTuning::with_max_suspension_force

    fn WheelTuning::with_max_suspension_force(self : WheelTuning, max_suspension_force : Float) -> WheelTuning

    WheelTuning::with_max_suspension_travel

    fn WheelTuning::with_max_suspension_travel(self : WheelTuning, max_suspension_travel : Float) -> WheelTuning

    WheelTuning::with_side_friction_stiffness

    fn WheelTuning::with_side_friction_stiffness(self : WheelTuning, side_friction_stiffness : Float) -> WheelTuning

    WheelTuning::with_suspension_compression

    fn WheelTuning::with_suspension_compression(self : WheelTuning, suspension_compression : Float) -> WheelTuning

    WheelTuning::with_suspension_damping

    fn WheelTuning::with_suspension_damping(self : WheelTuning, suspension_damping : Float) -> WheelTuning

    WheelTuning::with_suspension_stiffness

    fn WheelTuning::with_suspension_stiffness(self : WheelTuning, suspension_stiffness : Float) -> WheelTuning