Package jsim.forces
Class DragForce
java.lang.Object
jsim.forces.DragForce
- All Implemented Interfaces:
ForceGenerator
Velocity-proportional linear drag applied to a single body.
Models aerodynamic drag as F_drag = −b · v (linear model). For a more accurate
quadratic model (F ∝ v²), extend this class or write a custom ForceGenerator.
Angular drag is applied similarly: τ_drag = −b_rot · ω.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(double dt) Apply forces/torques to whichever bodies this generator influences.
-
Constructor Details
-
DragForce
Create a drag force applied to the given body.- Parameters:
body- the body to damplinearDamping- linear drag coefficient (N·s/m)angularDamping- rotational drag coefficient (N·m·s/rad)
-
-
Method Details
-
apply
public void apply(double dt) Description copied from interface:ForceGeneratorApply forces/torques to whichever bodies this generator influences.- Specified by:
applyin interfaceForceGenerator- Parameters:
dt- the fixed simulation timestep in seconds
-