feat!: rename BroadPhase to BroadPhaseMultiSap
This commit is contained in:
committed by
Sébastien Crozet
parent
cd9fb8342d
commit
cfb2c2c93e
@@ -4,7 +4,7 @@ use rapier_testbed3d::Testbed;
|
|||||||
#[derive(serde::Deserialize)]
|
#[derive(serde::Deserialize)]
|
||||||
struct State {
|
struct State {
|
||||||
pub islands: IslandManager,
|
pub islands: IslandManager,
|
||||||
pub broad_phase: BroadPhase,
|
pub broad_phase: BroadPhaseMultiSap,
|
||||||
pub narrow_phase: NarrowPhase,
|
pub narrow_phase: NarrowPhase,
|
||||||
pub bodies: RigidBodySet,
|
pub bodies: RigidBodySet,
|
||||||
pub colliders: ColliderSet,
|
pub colliders: ColliderSet,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ struct PhysicsState {
|
|||||||
pub gravity: Vector<f32>,
|
pub gravity: Vector<f32>,
|
||||||
pub integration_parameters: IntegrationParameters,
|
pub integration_parameters: IntegrationParameters,
|
||||||
pub islands: IslandManager,
|
pub islands: IslandManager,
|
||||||
pub broad_phase: BroadPhase,
|
pub broad_phase: BroadPhaseMultiSap,
|
||||||
pub narrow_phase: NarrowPhase,
|
pub narrow_phase: NarrowPhase,
|
||||||
pub bodies: RigidBodySet,
|
pub bodies: RigidBodySet,
|
||||||
pub colliders: ColliderSet,
|
pub colliders: ColliderSet,
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ use parry::utils::hashmap::HashMap;
|
|||||||
/// broad-phase, as well as the Aabbs of all the regions part of this broad-phase.
|
/// broad-phase, as well as the Aabbs of all the regions part of this broad-phase.
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct BroadPhase {
|
pub struct BroadPhaseMultiSap {
|
||||||
proxies: SAPProxies,
|
proxies: SAPProxies,
|
||||||
layers: Vec<SAPLayer>,
|
layers: Vec<SAPLayer>,
|
||||||
smallest_layer: u8,
|
smallest_layer: u8,
|
||||||
@@ -114,16 +114,16 @@ pub struct BroadPhase {
|
|||||||
reporting: HashMap<(u32, u32), bool>, // Workspace
|
reporting: HashMap<(u32, u32), bool>, // Workspace
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BroadPhase {
|
impl Default for BroadPhaseMultiSap {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
Self::new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BroadPhase {
|
impl BroadPhaseMultiSap {
|
||||||
/// Create a new empty broad-phase.
|
/// Create a new empty broad-phase.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
BroadPhase {
|
BroadPhaseMultiSap {
|
||||||
proxies: SAPProxies::new(),
|
proxies: SAPProxies::new(),
|
||||||
layers: Vec::new(),
|
layers: Vec::new(),
|
||||||
smallest_layer: 0,
|
smallest_layer: 0,
|
||||||
@@ -138,7 +138,7 @@ impl BroadPhase {
|
|||||||
///
|
///
|
||||||
/// For each colliders marked as removed, we make their containing layer mark
|
/// For each colliders marked as removed, we make their containing layer mark
|
||||||
/// its proxy as pre-deleted. The actual proxy removal will happen at the end
|
/// its proxy as pre-deleted. The actual proxy removal will happen at the end
|
||||||
/// of the `BroadPhase::update`.
|
/// of the `BroadPhaseMultiSap::update`.
|
||||||
fn handle_removed_colliders(&mut self, removed_colliders: &[ColliderHandle]) {
|
fn handle_removed_colliders(&mut self, removed_colliders: &[ColliderHandle]) {
|
||||||
// For each removed collider, remove the corresponding proxy.
|
// For each removed collider, remove the corresponding proxy.
|
||||||
for removed in removed_colliders {
|
for removed in removed_colliders {
|
||||||
@@ -623,11 +623,11 @@ mod test {
|
|||||||
use crate::dynamics::{
|
use crate::dynamics::{
|
||||||
ImpulseJointSet, IslandManager, MultibodyJointSet, RigidBodyBuilder, RigidBodySet,
|
ImpulseJointSet, IslandManager, MultibodyJointSet, RigidBodyBuilder, RigidBodySet,
|
||||||
};
|
};
|
||||||
use crate::geometry::{BroadPhase, ColliderBuilder, ColliderSet};
|
use crate::geometry::{BroadPhaseMultiSap, ColliderBuilder, ColliderSet};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_update_remove() {
|
fn test_add_update_remove() {
|
||||||
let mut broad_phase = BroadPhase::new();
|
let mut broad_phase = BroadPhaseMultiSap::new();
|
||||||
let mut bodies = RigidBodySet::new();
|
let mut bodies = RigidBodySet::new();
|
||||||
let mut colliders = ColliderSet::new();
|
let mut colliders = ColliderSet::new();
|
||||||
let mut impulse_joints = ImpulseJointSet::new();
|
let mut impulse_joints = ImpulseJointSet::new();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
pub use self::broad_phase::BroadPhase;
|
pub use self::broad_phase_multi_sap::BroadPhaseMultiSap;
|
||||||
pub use self::broad_phase_pair_event::{BroadPhasePairEvent, ColliderPair};
|
pub use self::broad_phase_pair_event::{BroadPhasePairEvent, ColliderPair};
|
||||||
pub use self::sap_proxy::SAPProxyIndex;
|
pub use self::sap_proxy::SAPProxyIndex;
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ use self::sap_proxy::*;
|
|||||||
use self::sap_region::*;
|
use self::sap_region::*;
|
||||||
use self::sap_utils::*;
|
use self::sap_utils::*;
|
||||||
|
|
||||||
mod broad_phase;
|
mod broad_phase_multi_sap;
|
||||||
mod broad_phase_pair_event;
|
mod broad_phase_pair_event;
|
||||||
mod sap_axis;
|
mod sap_axis;
|
||||||
mod sap_endpoint;
|
mod sap_endpoint;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ impl SAPLayer {
|
|||||||
///
|
///
|
||||||
/// This method must be called in a bottom-up loop, propagating new regions from the
|
/// This method must be called in a bottom-up loop, propagating new regions from the
|
||||||
/// smallest layer, up to the largest layer. That loop is done by the Phase 3 of the
|
/// smallest layer, up to the largest layer. That loop is done by the Phase 3 of the
|
||||||
/// BroadPhase::update.
|
/// BroadPhaseMultiSap::update.
|
||||||
pub fn propagate_created_regions(
|
pub fn propagate_created_regions(
|
||||||
&mut self,
|
&mut self,
|
||||||
larger_layer: &mut Self,
|
larger_layer: &mut Self,
|
||||||
@@ -182,7 +182,7 @@ impl SAPLayer {
|
|||||||
/// If the region with the given region key does not exist yet, it is created.
|
/// If the region with the given region key does not exist yet, it is created.
|
||||||
/// When a region is created, it creates a new proxy for that region, and its
|
/// When a region is created, it creates a new proxy for that region, and its
|
||||||
/// proxy ID is added to `self.created_region` so it can be propagated during
|
/// proxy ID is added to `self.created_region` so it can be propagated during
|
||||||
/// the Phase 3 of `BroadPhase::update`.
|
/// the Phase 3 of `BroadPhaseMultiSap::update`.
|
||||||
///
|
///
|
||||||
/// This returns the proxy ID of the already existing region if it existed, or
|
/// This returns the proxy ID of the already existing region if it existed, or
|
||||||
/// of the new region if it did not exist and has been created by this method.
|
/// of the new region if it did not exist and has been created by this method.
|
||||||
|
|||||||
@@ -7,20 +7,20 @@ use parry::query::visitors::BoundingVolumeIntersectionsSimultaneousVisitor;
|
|||||||
|
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct BroadPhase {
|
pub struct BroadPhaseQbvh {
|
||||||
qbvh: Qbvh<ColliderHandle>,
|
qbvh: Qbvh<ColliderHandle>,
|
||||||
stack: Vec<(u32, u32)>,
|
stack: Vec<(u32, u32)>,
|
||||||
#[cfg_attr(feature = "serde-serialize", serde(skip))]
|
#[cfg_attr(feature = "serde-serialize", serde(skip))]
|
||||||
workspace: QbvhUpdateWorkspace,
|
workspace: QbvhUpdateWorkspace,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BroadPhase {
|
impl Default for BroadPhaseQbvh {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
Self::new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BroadPhase {
|
impl BroadPhaseQbvh {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
qbvh: Qbvh::new(),
|
qbvh: Qbvh::new(),
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
pub use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair};
|
pub use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair};
|
||||||
|
|
||||||
pub use self::broad_phase_multi_sap::BroadPhase;
|
pub use self::broad_phase_multi_sap::BroadPhaseMultiSap;
|
||||||
// pub use self::broad_phase_qbvh::BroadPhase;
|
// pub use self::broad_phase_qbvh::BroadPhaseMultiSap;
|
||||||
pub use self::collider_components::*;
|
pub use self::collider_components::*;
|
||||||
pub use self::contact_pair::{
|
pub use self::contact_pair::{
|
||||||
ContactData, ContactManifoldData, ContactPair, IntersectionPair, SolverContact, SolverFlags,
|
ContactData, ContactManifoldData, ContactPair, IntersectionPair, SolverContact, SolverFlags,
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
use crate::dynamics::{ImpulseJointSet, MultibodyJointSet};
|
use crate::dynamics::{ImpulseJointSet, MultibodyJointSet};
|
||||||
use crate::geometry::{
|
use crate::geometry::{
|
||||||
BroadPhase, BroadPhasePairEvent, ColliderChanges, ColliderHandle, ColliderPair, NarrowPhase,
|
BroadPhaseMultiSap, BroadPhasePairEvent, ColliderChanges, ColliderHandle, ColliderPair,
|
||||||
|
NarrowPhase,
|
||||||
};
|
};
|
||||||
use crate::math::Real;
|
use crate::math::Real;
|
||||||
use crate::pipeline::{EventHandler, PhysicsHooks, QueryPipeline};
|
use crate::pipeline::{EventHandler, PhysicsHooks, QueryPipeline};
|
||||||
@@ -43,7 +44,7 @@ impl CollisionPipeline {
|
|||||||
fn detect_collisions(
|
fn detect_collisions(
|
||||||
&mut self,
|
&mut self,
|
||||||
prediction_distance: Real,
|
prediction_distance: Real,
|
||||||
broad_phase: &mut BroadPhase,
|
broad_phase: &mut BroadPhaseMultiSap,
|
||||||
narrow_phase: &mut NarrowPhase,
|
narrow_phase: &mut NarrowPhase,
|
||||||
bodies: &mut RigidBodySet,
|
bodies: &mut RigidBodySet,
|
||||||
colliders: &mut ColliderSet,
|
colliders: &mut ColliderSet,
|
||||||
@@ -107,7 +108,7 @@ impl CollisionPipeline {
|
|||||||
pub fn step(
|
pub fn step(
|
||||||
&mut self,
|
&mut self,
|
||||||
prediction_distance: Real,
|
prediction_distance: Real,
|
||||||
broad_phase: &mut BroadPhase,
|
broad_phase: &mut BroadPhaseMultiSap,
|
||||||
narrow_phase: &mut NarrowPhase,
|
narrow_phase: &mut NarrowPhase,
|
||||||
bodies: &mut RigidBodySet,
|
bodies: &mut RigidBodySet,
|
||||||
colliders: &mut ColliderSet,
|
colliders: &mut ColliderSet,
|
||||||
@@ -192,7 +193,7 @@ mod tests {
|
|||||||
let _ = collider_set.insert(collider_b);
|
let _ = collider_set.insert(collider_b);
|
||||||
|
|
||||||
let integration_parameters = IntegrationParameters::default();
|
let integration_parameters = IntegrationParameters::default();
|
||||||
let mut broad_phase = BroadPhase::new();
|
let mut broad_phase = BroadPhaseMultiSap::new();
|
||||||
let mut narrow_phase = NarrowPhase::new();
|
let mut narrow_phase = NarrowPhase::new();
|
||||||
let mut collision_pipeline = CollisionPipeline::new();
|
let mut collision_pipeline = CollisionPipeline::new();
|
||||||
let physics_hooks = ();
|
let physics_hooks = ();
|
||||||
@@ -244,7 +245,7 @@ mod tests {
|
|||||||
let _ = collider_set.insert(collider_b);
|
let _ = collider_set.insert(collider_b);
|
||||||
|
|
||||||
let integration_parameters = IntegrationParameters::default();
|
let integration_parameters = IntegrationParameters::default();
|
||||||
let mut broad_phase = BroadPhase::new();
|
let mut broad_phase = BroadPhaseMultiSap::new();
|
||||||
let mut narrow_phase = NarrowPhase::new();
|
let mut narrow_phase = NarrowPhase::new();
|
||||||
let mut collision_pipeline = CollisionPipeline::new();
|
let mut collision_pipeline = CollisionPipeline::new();
|
||||||
let physics_hooks = ();
|
let physics_hooks = ();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::dynamics::{
|
|||||||
RigidBodyChanges, RigidBodyHandle, RigidBodyPosition, RigidBodyType,
|
RigidBodyChanges, RigidBodyHandle, RigidBodyPosition, RigidBodyType,
|
||||||
};
|
};
|
||||||
use crate::geometry::{
|
use crate::geometry::{
|
||||||
BroadPhase, BroadPhasePairEvent, ColliderChanges, ColliderHandle, ColliderPair,
|
BroadPhaseMultiSap, BroadPhasePairEvent, ColliderChanges, ColliderHandle, ColliderPair,
|
||||||
ContactManifoldIndex, NarrowPhase, TemporaryInteractionIndex,
|
ContactManifoldIndex, NarrowPhase, TemporaryInteractionIndex,
|
||||||
};
|
};
|
||||||
use crate::math::{Real, Vector};
|
use crate::math::{Real, Vector};
|
||||||
@@ -93,7 +93,7 @@ impl PhysicsPipeline {
|
|||||||
&mut self,
|
&mut self,
|
||||||
integration_parameters: &IntegrationParameters,
|
integration_parameters: &IntegrationParameters,
|
||||||
islands: &mut IslandManager,
|
islands: &mut IslandManager,
|
||||||
broad_phase: &mut BroadPhase,
|
broad_phase: &mut BroadPhaseMultiSap,
|
||||||
narrow_phase: &mut NarrowPhase,
|
narrow_phase: &mut NarrowPhase,
|
||||||
bodies: &mut RigidBodySet,
|
bodies: &mut RigidBodySet,
|
||||||
colliders: &mut ColliderSet,
|
colliders: &mut ColliderSet,
|
||||||
@@ -406,7 +406,7 @@ impl PhysicsPipeline {
|
|||||||
gravity: &Vector<Real>,
|
gravity: &Vector<Real>,
|
||||||
integration_parameters: &IntegrationParameters,
|
integration_parameters: &IntegrationParameters,
|
||||||
islands: &mut IslandManager,
|
islands: &mut IslandManager,
|
||||||
broad_phase: &mut BroadPhase,
|
broad_phase: &mut BroadPhaseMultiSap,
|
||||||
narrow_phase: &mut NarrowPhase,
|
narrow_phase: &mut NarrowPhase,
|
||||||
bodies: &mut RigidBodySet,
|
bodies: &mut RigidBodySet,
|
||||||
colliders: &mut ColliderSet,
|
colliders: &mut ColliderSet,
|
||||||
@@ -650,7 +650,7 @@ mod test {
|
|||||||
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, RigidBodyBuilder,
|
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, RigidBodyBuilder,
|
||||||
RigidBodySet,
|
RigidBodySet,
|
||||||
};
|
};
|
||||||
use crate::geometry::{BroadPhase, ColliderBuilder, ColliderSet, NarrowPhase};
|
use crate::geometry::{BroadPhaseMultiSap, ColliderBuilder, ColliderSet, NarrowPhase};
|
||||||
use crate::math::Vector;
|
use crate::math::Vector;
|
||||||
use crate::pipeline::PhysicsPipeline;
|
use crate::pipeline::PhysicsPipeline;
|
||||||
use crate::prelude::{MultibodyJointSet, RigidBodyType};
|
use crate::prelude::{MultibodyJointSet, RigidBodyType};
|
||||||
@@ -661,7 +661,7 @@ mod test {
|
|||||||
let mut impulse_joints = ImpulseJointSet::new();
|
let mut impulse_joints = ImpulseJointSet::new();
|
||||||
let mut multibody_joints = MultibodyJointSet::new();
|
let mut multibody_joints = MultibodyJointSet::new();
|
||||||
let mut pipeline = PhysicsPipeline::new();
|
let mut pipeline = PhysicsPipeline::new();
|
||||||
let mut bf = BroadPhase::new();
|
let mut bf = BroadPhaseMultiSap::new();
|
||||||
let mut nf = NarrowPhase::new();
|
let mut nf = NarrowPhase::new();
|
||||||
let mut bodies = RigidBodySet::new();
|
let mut bodies = RigidBodySet::new();
|
||||||
let mut islands = IslandManager::new();
|
let mut islands = IslandManager::new();
|
||||||
@@ -699,7 +699,7 @@ mod test {
|
|||||||
let mut impulse_joints = ImpulseJointSet::new();
|
let mut impulse_joints = ImpulseJointSet::new();
|
||||||
let mut multibody_joints = MultibodyJointSet::new();
|
let mut multibody_joints = MultibodyJointSet::new();
|
||||||
let mut pipeline = PhysicsPipeline::new();
|
let mut pipeline = PhysicsPipeline::new();
|
||||||
let mut bf = BroadPhase::new();
|
let mut bf = BroadPhaseMultiSap::new();
|
||||||
let mut nf = NarrowPhase::new();
|
let mut nf = NarrowPhase::new();
|
||||||
let mut islands = IslandManager::new();
|
let mut islands = IslandManager::new();
|
||||||
|
|
||||||
@@ -809,7 +809,7 @@ mod test {
|
|||||||
let mut pipeline = PhysicsPipeline::new();
|
let mut pipeline = PhysicsPipeline::new();
|
||||||
let gravity = Vector::y() * -9.81;
|
let gravity = Vector::y() * -9.81;
|
||||||
let integration_parameters = IntegrationParameters::default();
|
let integration_parameters = IntegrationParameters::default();
|
||||||
let mut broad_phase = BroadPhase::new();
|
let mut broad_phase = BroadPhaseMultiSap::new();
|
||||||
let mut narrow_phase = NarrowPhase::new();
|
let mut narrow_phase = NarrowPhase::new();
|
||||||
let mut bodies = RigidBodySet::new();
|
let mut bodies = RigidBodySet::new();
|
||||||
let mut colliders = ColliderSet::new();
|
let mut colliders = ColliderSet::new();
|
||||||
@@ -859,7 +859,7 @@ mod test {
|
|||||||
let mut impulse_joints = ImpulseJointSet::new();
|
let mut impulse_joints = ImpulseJointSet::new();
|
||||||
let mut multibody_joints = MultibodyJointSet::new();
|
let mut multibody_joints = MultibodyJointSet::new();
|
||||||
let mut pipeline = PhysicsPipeline::new();
|
let mut pipeline = PhysicsPipeline::new();
|
||||||
let mut bf = BroadPhase::new();
|
let mut bf = BroadPhaseMultiSap::new();
|
||||||
let mut nf = NarrowPhase::new();
|
let mut nf = NarrowPhase::new();
|
||||||
let mut islands = IslandManager::new();
|
let mut islands = IslandManager::new();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use rapier::dynamics::{
|
|||||||
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
||||||
RigidBodySet,
|
RigidBodySet,
|
||||||
};
|
};
|
||||||
use rapier::geometry::{BroadPhase, ColliderSet, NarrowPhase};
|
use rapier::geometry::{BroadPhaseMultiSap, ColliderSet, NarrowPhase};
|
||||||
use rapier::math::{Real, Vector};
|
use rapier::math::{Real, Vector};
|
||||||
use rapier::pipeline::{ChannelEventCollector, PhysicsHooks, PhysicsPipeline, QueryPipeline};
|
use rapier::pipeline::{ChannelEventCollector, PhysicsHooks, PhysicsPipeline, QueryPipeline};
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ impl Harness {
|
|||||||
self.physics.hooks = Box::new(hooks);
|
self.physics.hooks = Box::new(hooks);
|
||||||
|
|
||||||
self.physics.islands = IslandManager::new();
|
self.physics.islands = IslandManager::new();
|
||||||
self.physics.broad_phase = BroadPhase::new();
|
self.physics.broad_phase = BroadPhaseMultiSap::new();
|
||||||
self.physics.narrow_phase = NarrowPhase::new();
|
self.physics.narrow_phase = NarrowPhase::new();
|
||||||
self.state.timestep_id = 0;
|
self.state.timestep_id = 0;
|
||||||
self.state.time = 0.0;
|
self.state.time = 0.0;
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ use rapier::dynamics::{
|
|||||||
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
||||||
RigidBodySet,
|
RigidBodySet,
|
||||||
};
|
};
|
||||||
use rapier::geometry::{BroadPhase, ColliderSet, CollisionEvent, ContactForceEvent, NarrowPhase};
|
use rapier::geometry::{
|
||||||
|
BroadPhaseMultiSap, ColliderSet, CollisionEvent, ContactForceEvent, NarrowPhase,
|
||||||
|
};
|
||||||
use rapier::math::{Real, Vector};
|
use rapier::math::{Real, Vector};
|
||||||
use rapier::pipeline::{PhysicsHooks, PhysicsPipeline, QueryPipeline};
|
use rapier::pipeline::{PhysicsHooks, PhysicsPipeline, QueryPipeline};
|
||||||
|
|
||||||
@@ -20,7 +22,7 @@ pub struct PhysicsSnapshot {
|
|||||||
|
|
||||||
pub struct DeserializedPhysicsSnapshot {
|
pub struct DeserializedPhysicsSnapshot {
|
||||||
pub timestep_id: usize,
|
pub timestep_id: usize,
|
||||||
pub broad_phase: BroadPhase,
|
pub broad_phase: BroadPhaseMultiSap,
|
||||||
pub narrow_phase: NarrowPhase,
|
pub narrow_phase: NarrowPhase,
|
||||||
pub island_manager: IslandManager,
|
pub island_manager: IslandManager,
|
||||||
pub bodies: RigidBodySet,
|
pub bodies: RigidBodySet,
|
||||||
@@ -32,7 +34,7 @@ pub struct DeserializedPhysicsSnapshot {
|
|||||||
impl PhysicsSnapshot {
|
impl PhysicsSnapshot {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
timestep_id: usize,
|
timestep_id: usize,
|
||||||
broad_phase: &BroadPhase,
|
broad_phase: &BroadPhaseMultiSap,
|
||||||
narrow_phase: &NarrowPhase,
|
narrow_phase: &NarrowPhase,
|
||||||
island_manager: &IslandManager,
|
island_manager: &IslandManager,
|
||||||
bodies: &RigidBodySet,
|
bodies: &RigidBodySet,
|
||||||
@@ -86,7 +88,7 @@ impl PhysicsSnapshot {
|
|||||||
|
|
||||||
pub struct PhysicsState {
|
pub struct PhysicsState {
|
||||||
pub islands: IslandManager,
|
pub islands: IslandManager,
|
||||||
pub broad_phase: BroadPhase,
|
pub broad_phase: BroadPhaseMultiSap,
|
||||||
pub narrow_phase: NarrowPhase,
|
pub narrow_phase: NarrowPhase,
|
||||||
pub bodies: RigidBodySet,
|
pub bodies: RigidBodySet,
|
||||||
pub colliders: ColliderSet,
|
pub colliders: ColliderSet,
|
||||||
@@ -110,7 +112,7 @@ impl PhysicsState {
|
|||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
islands: IslandManager::new(),
|
islands: IslandManager::new(),
|
||||||
broad_phase: BroadPhase::new(),
|
broad_phase: BroadPhaseMultiSap::new(),
|
||||||
narrow_phase: NarrowPhase::new(),
|
narrow_phase: NarrowPhase::new(),
|
||||||
bodies: RigidBodySet::new(),
|
bodies: RigidBodySet::new(),
|
||||||
colliders: ColliderSet::new(),
|
colliders: ColliderSet::new(),
|
||||||
|
|||||||
Reference in New Issue
Block a user