pub struct PySimConfig {
pub gravity: [f64; 3],
pub solver_iterations: u32,
pub linear_sleep_threshold: f64,
pub angular_sleep_threshold: f64,
pub time_before_sleep: f64,
pub ccd_enabled: bool,
pub restitution_mixing: String,
pub friction_mixing: String,
pub max_penetration: f64,
pub baumgarte_factor: f64,
pub sleep_enabled: bool,
pub ccd_max_substeps: u32,
}Expand description
Top-level simulation configuration.
Passed to PyPhysicsWorld::new to configure global simulation parameters.
Fields§
§gravity: [f64; 3]Gravity vector [gx, gy, gz].
solver_iterations: u32Number of constraint solver iterations per step.
linear_sleep_threshold: f64Linear velocity threshold for sleep.
angular_sleep_threshold: f64Angular velocity threshold for sleep.
time_before_sleep: f64Time (in seconds) a body must be below thresholds before sleeping.
ccd_enabled: boolEnable continuous collision detection.
restitution_mixing: StringCoefficient of restitution mixing method: “average”, “min”, or “max”.
friction_mixing: StringFriction mixing method: “average”, “min”, or “max”.
max_penetration: f64Maximum allowed penetration depth before a contact is ignored.
baumgarte_factor: f64Baumgarte stabilization factor (0..1, typical 0.1–0.3).
sleep_enabled: boolWhether sleeping is enabled globally.
ccd_max_substeps: u32Maximum substeps for CCD.
Implementations§
Source§impl PySimConfig
impl PySimConfig
Sourcepub fn earth_gravity() -> Self
pub fn earth_gravity() -> Self
Standard Earth-gravity configuration.
Sourcepub fn zero_gravity() -> Self
pub fn zero_gravity() -> Self
Zero-gravity (space) configuration.
Sourcepub fn moon_gravity() -> Self
pub fn moon_gravity() -> Self
Moon-gravity configuration (~1/6 of Earth).
Trait Implementations§
Source§impl Clone for PySimConfig
impl Clone for PySimConfig
Source§fn clone(&self) -> PySimConfig
fn clone(&self) -> PySimConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PySimConfig
impl Debug for PySimConfig
Source§impl Default for PySimConfig
impl Default for PySimConfig
Source§impl<'de> Deserialize<'de> for PySimConfig
impl<'de> Deserialize<'de> for PySimConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PySimConfig
impl RefUnwindSafe for PySimConfig
impl Send for PySimConfig
impl Sync for PySimConfig
impl Unpin for PySimConfig
impl UnsafeUnpin for PySimConfig
impl UnwindSafe for PySimConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.