载入中...
搜索中...
未找到
ForceApplication.cpp
浏览该文件的文档.
14 return isFinite(v) && std::abs(v.x) <= limit && std::abs(v.y) <= limit && std::abs(v.z) <= limit;
18 if (!body.isValid()) return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "Dead 2D body"));
19 if (!body.isActive() || body.getType() != "dynamic" || force.z != 0 || point.z != 0 || !fits(force) || !fits(point))
30 if (!body.isValid()) return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "Dead 3D body"));
31 if (!body.isActive() || body.getType() != "dynamic" || !fits(force) || !fits(point)) return invalid<void>();
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Backend-neutral 3D rigid body in meter-space coordinates (+Y up by convention). Owned by a World3D; c...
Definition Body3D.h:31
2D rigid body (Box2D) in pixel-space coordinates. Owned by a World; create shapes with newRectangleFi...
Definition Body.h:21
Result< void > applyForceSI(Body &body, ForceVector force, ForceVector point)
Apply an SI force to a 2D body at an SI world point, converting through its world meter....
Definition ForceApplication.cpp:17
@ StaleHandle
Owning world-space SI vector; 2D uses XY with Z exactly zero.
Definition ForceModels.h:12