SimulationConfig class
Immutable runtime physics configuration.
Constructors
- SimulationConfig({required double gravityConstant, required double softeningEpsilon, required double dt, required DtPolicy dtPolicy, required IntegratorKind integrator, required CollisionMode collisionMode, required bool deterministic, GravitySolver gravitySolver = GravitySolver.auto, double barnesHutTheta = 0.6, int barnesHutThreshold = 256})
-
Creates a simulation configuration.
const
-
SimulationConfig.fromJson(Map<
String, dynamic> json) -
Deserializes a config from JSON.
factory
Properties
- barnesHutTheta → double
-
Barnes-Hut theta parameter.
final
- barnesHutThreshold → int
-
Body-count threshold for Barnes-Hut switching.
final
- collisionMode → CollisionMode
-
Collision behavior mode.
final
- deterministic → bool
-
Whether deterministic replay constraints are enabled.
final
- dt → double
-
Base timestep size.
final
- dtPolicy → DtPolicy
-
Timestep policy.
final
- gravityConstant → double
-
Gravitational constant used in force computation.
final
- gravitySolver → GravitySolver
-
Solver mode selection.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- integrator → IntegratorKind
-
Integration algorithm.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- softeningEpsilon → double
-
Softening epsilon used to avoid singularities.
final
Methods
-
copyWith(
{double? gravityConstant, double? softeningEpsilon, double? dt, DtPolicy? dtPolicy, IntegratorKind? integrator, CollisionMode? collisionMode, bool? deterministic, GravitySolver? gravitySolver, double? barnesHutTheta, int? barnesHutThreshold}) → SimulationConfig - Returns a copy with the provided fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this config to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → String? - Validates config values and returns an error message if invalid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- scientificDefault → const SimulationConfig
- Predefined scientific default profile.