From 0e1d260bb2156896c94315c62f728e5dd40f7680 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 22 Dec 2023 21:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Difficult_Rocket_rs/src/src/data_type/dr.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs index 2de1953..2acf7d0 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs +++ b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; +use nalgebra::Vector2; use rapier2d_f64::geometry::{SharedShape, TriMeshFlags}; use rapier2d_f64::math::{Isometry, Point, Real}; use rapier2d_f64::parry::transformation::vhacd::VHACDParameters; @@ -36,10 +37,13 @@ pub struct DRObjectProps<'a> { /// 为了保证能使用到 所有类型的 碰撞体 /// 写了这么长一个玩意 +/// 形状参考 +/// https://rapier.rs/docs/user_guides/rust/colliders #[cfg(disable)] use rapier2d_f64::geometry::ColliderBuilder; pub enum BoxColliderEnum { - // rapier2d_f64::geometry::ColliderBuilder + /// 组合 + Compound(Vec<(Vector2, BoxColliderEnum)>), /// 球 /// 半径 Ball(Real), @@ -94,9 +98,11 @@ pub enum BoxColliderEnum { Polyline(Vec<(Real, Real)>), /// 由一系列高度定义的某种东西,大概是地面之类的 Heightfield(Vec<(Real, Real)>), - /// 凸分解的复合形状 - /// 就是不知道能不能真用上 - Compound(Vec<(Isometry, SharedShape)>), //凸分解,好像可以略微提升复杂刚体碰撞的性能 + // 凸分解的复合形状 + // 就是不知道能不能真用上 + // 凸分解,好像可以略微提升复杂刚体碰撞的性能 + // todo + // convex_decomposition } pub struct TankProps {