ci: cargo doc step (#671)
This commit is contained in:
86
.github/workflows/rapier-ci-build.yml
vendored
86
.github/workflows/rapier-ci-build.yml
vendored
@@ -2,9 +2,9 @@ name: Rapier CI build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@@ -13,48 +13,56 @@ jobs:
|
|||||||
check-fmt:
|
check-fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: cargo fmt -- --check
|
run: cargo fmt -- --check
|
||||||
|
doc:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
RUSTDOCFLAGS: -D warnings
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Cargo doc
|
||||||
|
run: cargo doc -p rapier3d -p rapier2d -p rapier3d-stl -p rapier3d-urdf
|
||||||
build-native:
|
build-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -D warnings
|
RUSTFLAGS: -D warnings
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: sudo apt-get install -y cmake libxcb-composite0-dev
|
- run: sudo apt-get install -y cmake libxcb-composite0-dev
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy
|
run: cargo clippy
|
||||||
- name: Clippy rapier2d
|
- name: Clippy rapier2d
|
||||||
run: cargo clippy -p rapier-examples-2d --features parallel,simd-stable
|
run: cargo clippy -p rapier-examples-2d --features parallel,simd-stable
|
||||||
- name: Clippy rapier3d
|
- name: Clippy rapier3d
|
||||||
run: cargo clippy -p rapier-examples-3d --features parallel,simd-stable
|
run: cargo clippy -p rapier-examples-3d --features parallel,simd-stable
|
||||||
- name: Build rapier2d
|
- name: Build rapier2d
|
||||||
run: cargo build --verbose -p rapier2d;
|
run: cargo build --verbose -p rapier2d;
|
||||||
- name: Build rapier3d
|
- name: Build rapier3d
|
||||||
run: cargo build --verbose -p rapier3d;
|
run: cargo build --verbose -p rapier3d;
|
||||||
- name: Build rapier2d SIMD
|
- name: Build rapier2d SIMD
|
||||||
run: cd crates/rapier2d; cargo build --verbose --features simd-stable;
|
run: cd crates/rapier2d; cargo build --verbose --features simd-stable;
|
||||||
- name: Build rapier3d SIMD
|
- name: Build rapier3d SIMD
|
||||||
run: cd crates/rapier3d; cargo build --verbose --features simd-stable;
|
run: cd crates/rapier3d; cargo build --verbose --features simd-stable;
|
||||||
- name: Build rapier2d SIMD Parallel
|
- name: Build rapier2d SIMD Parallel
|
||||||
run: cd crates/rapier2d; cargo build --verbose --features simd-stable --features parallel;
|
run: cd crates/rapier2d; cargo build --verbose --features simd-stable --features parallel;
|
||||||
- name: Build rapier3d SIMD Parallel
|
- name: Build rapier3d SIMD Parallel
|
||||||
run: cd crates/rapier3d; cargo build --verbose --features simd-stable --features parallel;
|
run: cd crates/rapier3d; cargo build --verbose --features simd-stable --features parallel;
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test
|
run: cargo test
|
||||||
- name: Check rapier_testbed2d
|
- name: Check rapier_testbed2d
|
||||||
run: cargo check --verbose -p rapier_testbed2d;
|
run: cargo check --verbose -p rapier_testbed2d;
|
||||||
- name: Check rapier_testbed3d
|
- name: Check rapier_testbed3d
|
||||||
run: cargo check --verbose -p rapier_testbed3d;
|
run: cargo check --verbose -p rapier_testbed3d;
|
||||||
- name: Check rapier_testbed2d --features parallel
|
- name: Check rapier_testbed2d --features parallel
|
||||||
run: cd crates/rapier_testbed2d; cargo check --verbose --features parallel;
|
run: cd crates/rapier_testbed2d; cargo check --verbose --features parallel;
|
||||||
- name: Check rapier_testbed3d --features parallel
|
- name: Check rapier_testbed3d --features parallel
|
||||||
run: cd crates/rapier_testbed3d; cargo check --verbose --features parallel;
|
run: cd crates/rapier_testbed3d; cargo check --verbose --features parallel;
|
||||||
- name: Check rapier-examples-2d
|
- name: Check rapier-examples-2d
|
||||||
run: cargo check -j 1 --verbose -p rapier-examples-2d;
|
run: cargo check -j 1 --verbose -p rapier-examples-2d;
|
||||||
- name: Check rapier-examples-3d
|
- name: Check rapier-examples-3d
|
||||||
run: cargo check -j 1 --verbose -p rapier-examples-3d;
|
run: cargo check -j 1 --verbose -p rapier-examples-3d;
|
||||||
build-wasm:
|
build-wasm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ use std::collections::HashMap;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use xurdf::{Geometry, Inertial, Joint, Pose, Robot};
|
use xurdf::{Geometry, Inertial, Joint, Pose, Robot};
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use rapier3d::dynamics::Multibody;
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
/// Options applied to multibody joints created from the URDF joints.
|
/// Options applied to multibody joints created from the URDF joints.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
|
||||||
@@ -79,7 +82,7 @@ pub struct UrdfLoaderOptions {
|
|||||||
/// So if this option is set to `true`, it is recommended to also keep
|
/// So if this option is set to `true`, it is recommended to also keep
|
||||||
/// [`UrdfLoaderOptions::enable_joint_collisions`] set to `false`. If the model is then added
|
/// [`UrdfLoaderOptions::enable_joint_collisions`] set to `false`. If the model is then added
|
||||||
/// to the physics sets using multibody joints, it is recommended to call
|
/// to the physics sets using multibody joints, it is recommended to call
|
||||||
/// [`UrdfRobot::insert_with_multibody_joints`] with the [`UrdfMultibodyOptions::DISABLE_SELF_CONTACTS`]
|
/// [`UrdfRobot::insert_using_multibody_joints`] with the [`UrdfMultibodyOptions::DISABLE_SELF_CONTACTS`]
|
||||||
/// flag enabled.
|
/// flag enabled.
|
||||||
pub create_colliders_from_visual_shapes: bool,
|
pub create_colliders_from_visual_shapes: bool,
|
||||||
/// If `true`, the mass properties (center-of-mass, mass, and angular inertia) read from the urdf
|
/// If `true`, the mass properties (center-of-mass, mass, and angular inertia) read from the urdf
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ name = "rapier_testbed2d-f64"
|
|||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
||||||
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
|
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
|
||||||
homepage = "http://rapier.org"
|
homepage = "http://rapier.rs"
|
||||||
repository = "https://github.com/dimforge/rapier"
|
repository = "https://github.com/dimforge/rapier"
|
||||||
categories = ["science", "game-development", "mathematics", "simulation", "wasm"]
|
categories = [
|
||||||
|
"science",
|
||||||
|
"game-development",
|
||||||
|
"mathematics",
|
||||||
|
"simulation",
|
||||||
|
"wasm",
|
||||||
|
]
|
||||||
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -49,11 +55,30 @@ bevy_sprite = "0.13"
|
|||||||
|
|
||||||
# Dependencies for native only.
|
# Dependencies for native only.
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_asset", "bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_asset",
|
||||||
|
"bevy_winit",
|
||||||
|
"x11",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
|
|
||||||
# Dependencies for WASM only.
|
# Dependencies for WASM only.
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_asset", "bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_asset",
|
||||||
|
"bevy_winit",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
#bevy_webgl2 = "0.5"
|
#bevy_webgl2 = "0.5"
|
||||||
|
|
||||||
[dependencies.rapier]
|
[dependencies.rapier]
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ name = "rapier_testbed2d"
|
|||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
||||||
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
|
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
|
||||||
homepage = "http://rapier.org"
|
homepage = "http://rapier.rs"
|
||||||
repository = "https://github.com/dimforge/rapier"
|
repository = "https://github.com/dimforge/rapier"
|
||||||
categories = ["science", "game-development", "mathematics", "simulation", "wasm"]
|
categories = [
|
||||||
|
"science",
|
||||||
|
"game-development",
|
||||||
|
"mathematics",
|
||||||
|
"simulation",
|
||||||
|
"wasm",
|
||||||
|
]
|
||||||
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -49,11 +55,30 @@ bevy_sprite = "0.13"
|
|||||||
|
|
||||||
# Dependencies for native only.
|
# Dependencies for native only.
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_sprite", "bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_sprite",
|
||||||
|
"bevy_winit",
|
||||||
|
"x11",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
|
|
||||||
# Dependencies for WASM only.
|
# Dependencies for WASM only.
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_sprite", "bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_sprite",
|
||||||
|
"bevy_winit",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
#bevy_webgl2 = "0.5"
|
#bevy_webgl2 = "0.5"
|
||||||
|
|
||||||
[dependencies.rapier]
|
[dependencies.rapier]
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ name = "rapier_testbed3d-f64"
|
|||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
||||||
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
|
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
|
||||||
homepage = "http://rapier.org"
|
homepage = "http://rapier.rs"
|
||||||
repository = "https://github.com/dimforge/rapier"
|
repository = "https://github.com/dimforge/rapier"
|
||||||
categories = ["science", "game-development", "mathematics", "simulation", "wasm"]
|
categories = [
|
||||||
|
"science",
|
||||||
|
"game-development",
|
||||||
|
"mathematics",
|
||||||
|
"simulation",
|
||||||
|
"wasm",
|
||||||
|
]
|
||||||
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -48,11 +54,28 @@ bevy_sprite = "0.13"
|
|||||||
|
|
||||||
# Dependencies for native only.
|
# Dependencies for native only.
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_winit",
|
||||||
|
"x11",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
|
|
||||||
# Dependencies for WASM only.
|
# Dependencies for WASM only.
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_winit",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
#bevy_webgl2 = "0.5"
|
#bevy_webgl2 = "0.5"
|
||||||
|
|
||||||
[dependencies.rapier]
|
[dependencies.rapier]
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ name = "rapier_testbed3d"
|
|||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
|
||||||
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
|
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
|
||||||
homepage = "http://rapier.org"
|
homepage = "http://rapier.rs"
|
||||||
repository = "https://github.com/dimforge/rapier"
|
repository = "https://github.com/dimforge/rapier"
|
||||||
categories = ["science", "game-development", "mathematics", "simulation", "wasm"]
|
categories = [
|
||||||
|
"science",
|
||||||
|
"game-development",
|
||||||
|
"mathematics",
|
||||||
|
"simulation",
|
||||||
|
"wasm",
|
||||||
|
]
|
||||||
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
keywords = ["physics", "dynamics", "rigid", "real-time", "impulse_joints"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -33,7 +39,7 @@ rand = "0.8"
|
|||||||
rand_pcg = "0.3"
|
rand_pcg = "0.3"
|
||||||
instant = { version = "0.1", features = ["web-sys", "now"] }
|
instant = { version = "0.1", features = ["web-sys", "now"] }
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
glam = { version = "0.24", optional = true } # For Physx
|
glam = { version = "0.24", optional = true } # For Physx
|
||||||
num_cpus = { version = "1", optional = true }
|
num_cpus = { version = "1", optional = true }
|
||||||
physx = { version = "0.19", features = ["glam"], optional = true }
|
physx = { version = "0.19", features = ["glam"], optional = true }
|
||||||
physx-sys = { version = "0.11", optional = true }
|
physx-sys = { version = "0.11", optional = true }
|
||||||
@@ -52,11 +58,28 @@ bevy_sprite = "0.13"
|
|||||||
|
|
||||||
# Dependencies for native only.
|
# Dependencies for native only.
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_winit",
|
||||||
|
"x11",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
|
|
||||||
# Dependencies for WASM only.
|
# Dependencies for WASM only.
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"] }
|
bevy = { version = "0.13", default-features = false, features = [
|
||||||
|
"bevy_winit",
|
||||||
|
"tonemapping_luts",
|
||||||
|
"ktx2",
|
||||||
|
"zstd",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_gizmos",
|
||||||
|
] }
|
||||||
#bevy_webgl2 = "0.5"
|
#bevy_webgl2 = "0.5"
|
||||||
|
|
||||||
[dependencies.rapier]
|
[dependencies.rapier]
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ use crate::math::Real;
|
|||||||
use na::RealField;
|
use na::RealField;
|
||||||
use std::num::NonZeroUsize;
|
use std::num::NonZeroUsize;
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use super::RigidBodyActivation;
|
||||||
|
|
||||||
// TODO: enabling the block solver in 3d introduces a lot of jitters in
|
// TODO: enabling the block solver in 3d introduces a lot of jitters in
|
||||||
// the 3D domino demo. So for now we dont enable it in 3D.
|
// the 3D domino demo. So for now we dont enable it in 3D.
|
||||||
pub(crate) static BLOCK_SOLVER_ENABLED: bool = cfg!(feature = "dim2");
|
pub(crate) static BLOCK_SOLVER_ENABLED: bool = cfg!(feature = "dim2");
|
||||||
@@ -66,7 +69,7 @@ pub struct IntegrationParameters {
|
|||||||
/// This value is used internally to estimate some length-based tolerance. In particular, the
|
/// This value is used internally to estimate some length-based tolerance. In particular, the
|
||||||
/// values [`IntegrationParameters::allowed_linear_error`],
|
/// values [`IntegrationParameters::allowed_linear_error`],
|
||||||
/// [`IntegrationParameters::max_corrective_velocity`],
|
/// [`IntegrationParameters::max_corrective_velocity`],
|
||||||
/// [`IntegrationParameters::prediction_distance`], [`RigidBodyActivation::linear_threshold`]
|
/// [`IntegrationParameters::prediction_distance`], [`RigidBodyActivation::normalized_linear_threshold`]
|
||||||
/// are scaled by this value implicitly.
|
/// are scaled by this value implicitly.
|
||||||
///
|
///
|
||||||
/// This value can be understood as the number of units-per-meter in your physical world compared
|
/// This value can be understood as the number of units-per-meter in your physical world compared
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ use na::{
|
|||||||
StorageMut, LU,
|
StorageMut, LU,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use crate::prelude::{GenericJoint, RigidBody};
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
struct Force {
|
struct Force {
|
||||||
@@ -861,8 +864,7 @@ impl Multibody {
|
|||||||
/// Apply displacements, in generalized coordinates, to this multibody.
|
/// Apply displacements, in generalized coordinates, to this multibody.
|
||||||
///
|
///
|
||||||
/// Note this does **not** updates the link poses, only their generalized coordinates.
|
/// Note this does **not** updates the link poses, only their generalized coordinates.
|
||||||
/// To update the link poses and associated rigid-bodies, call [`Self::forward_kinematics`]
|
/// To update the link poses and associated rigid-bodies, call [`Self::forward_kinematics`].
|
||||||
/// or [`Self::finalize`].
|
|
||||||
pub fn apply_displacements(&mut self, disp: &[Real]) {
|
pub fn apply_displacements(&mut self, disp: &[Real]) {
|
||||||
for link in self.links.iter_mut() {
|
for link in self.links.iter_mut() {
|
||||||
link.joint.apply_displacement(&disp[link.assembly_id..])
|
link.joint.apply_displacement(&disp[link.assembly_id..])
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ use crate::math::{AngVector, Isometry, Point, Real, Rotation, Vector};
|
|||||||
use crate::utils::SimdCross;
|
use crate::utils::SimdCross;
|
||||||
use num::Zero;
|
use num::Zero;
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use super::IntegrationParameters;
|
||||||
|
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
/// A rigid body.
|
/// A rigid body.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ use crate::parry::partitioning::IndexedData;
|
|||||||
use crate::utils::{SimdAngularInertia, SimdCross, SimdDot};
|
use crate::utils::{SimdAngularInertia, SimdCross, SimdDot};
|
||||||
use num::Zero;
|
use num::Zero;
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use super::IntegrationParameters;
|
||||||
|
|
||||||
/// The unique handle of a rigid body added to a `RigidBodySet`.
|
/// The unique handle of a rigid body added to a `RigidBodySet`.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
|
|||||||
@@ -622,8 +622,9 @@ impl ColliderBuilder {
|
|||||||
|
|
||||||
/// Initialize a new collider builder with a capsule defined from its endpoints.
|
/// Initialize a new collider builder with a capsule defined from its endpoints.
|
||||||
///
|
///
|
||||||
/// See also [`ColliderBuilder::capsule_x`], [`ColliderBuilder::capsule_y`], and
|
/// See also [`ColliderBuilder::capsule_x`], [`ColliderBuilder::capsule_y`],
|
||||||
/// [`ColliderBuilder::capsule_z`], for a simpler way to build capsules with common
|
/// (and `ColliderBuilder::capsule_z` in 3D only)
|
||||||
|
/// for a simpler way to build capsules with common
|
||||||
/// orientations.
|
/// orientations.
|
||||||
pub fn capsule_from_endpoints(a: Point<Real>, b: Point<Real>, radius: Real) -> Self {
|
pub fn capsule_from_endpoints(a: Point<Real>, b: Point<Real>, radius: Real) -> Self {
|
||||||
Self::new(SharedShape::capsule(a, b, radius))
|
Self::new(SharedShape::capsule(a, b, radius))
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ use parry::query::ContactManifoldsWorkspace;
|
|||||||
|
|
||||||
use super::CollisionEvent;
|
use super::CollisionEvent;
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
use super::Collider;
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ impl NarrowPhase {
|
|||||||
|
|
||||||
/// All the contacts involving the given collider.
|
/// All the contacts involving the given collider.
|
||||||
///
|
///
|
||||||
/// It is strongly recommended to use the [`NarrowPhase::contacts_with`] method instead. This
|
/// It is strongly recommended to use the [`NarrowPhase::contact_pairs_with`] method instead. This
|
||||||
/// method can be used if the generation number of the collider handle isn't known.
|
/// method can be used if the generation number of the collider handle isn't known.
|
||||||
pub fn contact_pairs_with_unknown_gen(
|
pub fn contact_pairs_with_unknown_gen(
|
||||||
&self,
|
&self,
|
||||||
@@ -141,7 +141,7 @@ impl NarrowPhase {
|
|||||||
|
|
||||||
/// All the intersection pairs involving the given collider.
|
/// All the intersection pairs involving the given collider.
|
||||||
///
|
///
|
||||||
/// It is strongly recommended to use the [`NarrowPhase::intersections_with`] method instead.
|
/// It is strongly recommended to use the [`NarrowPhase::intersection_pairs_with`] method instead.
|
||||||
/// This method can be used if the generation number of the collider handle isn't known.
|
/// This method can be used if the generation number of the collider handle isn't known.
|
||||||
pub fn intersection_pairs_with_unknown_gen(
|
pub fn intersection_pairs_with_unknown_gen(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ use crate::prelude::{Aabb, ColliderHandle, ColliderSet, RigidBodySet};
|
|||||||
|
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
use crate::{
|
use crate::{
|
||||||
dynamics::{IntegrationParameters, RigidBodyPosition},
|
dynamics::{IntegrationParameters, RigidBody, RigidBodyPosition},
|
||||||
pipeline::QueryPipeline,
|
pipeline::QueryPipeline,
|
||||||
|
prelude::Collider,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Generates collider AABBs based on the union of their current AABB and the AABB predicted
|
/// Generates collider AABBs based on the union of their current AABB and the AABB predicted
|
||||||
@@ -26,7 +27,7 @@ pub struct SweptAabbWithPredictedPosition<'a> {
|
|||||||
pub colliders: &'a ColliderSet,
|
pub colliders: &'a ColliderSet,
|
||||||
/// The delta time to compute predicted position.
|
/// The delta time to compute predicted position.
|
||||||
///
|
///
|
||||||
/// You probably want to set it to [`IntegrationParameter::dt`].
|
/// You probably want to set it to [`IntegrationParameters::dt`].
|
||||||
pub dt: Real,
|
pub dt: Real,
|
||||||
}
|
}
|
||||||
impl<'a> QbvhDataGenerator<ColliderHandle> for SweptAabbWithPredictedPosition<'a> {
|
impl<'a> QbvhDataGenerator<ColliderHandle> for SweptAabbWithPredictedPosition<'a> {
|
||||||
|
|||||||
Reference in New Issue
Block a user