@box2d/debug-draw
Version:
Debug drawing helper for @box2d
71 lines • 2.21 kB
TypeScript
import { b2Draw } from "../common/b2_draw";
import { b2Vec2, XY } from "../common/b2_math";
import { b2Readonly } from "../common/b2_readonly";
export declare enum b2StretchingModel {
b2_pbdStretchingModel = 0,
b2_xpbdStretchingModel = 1
}
export declare enum b2BendingModel {
b2_springAngleBendingModel = 0,
b2_pbdAngleBendingModel = 1,
b2_xpbdAngleBendingModel = 2,
b2_pbdDistanceBendingModel = 3,
b2_pbdHeightBendingModel = 4,
b2_pbdTriangleBendingModel = 5
}
export declare class b2RopeTuning {
stretchingModel: b2StretchingModel;
bendingModel: b2BendingModel;
damping: number;
stretchStiffness: number;
stretchHertz: number;
stretchDamping: number;
bendStiffness: number;
bendHertz: number;
bendDamping: number;
isometric: boolean;
fixedEffectiveMass: boolean;
warmStart: boolean;
Copy(other: Readonly<b2RopeTuning>): this;
}
export interface b2RopeDef {
position: XY;
vertices: XY[];
masses: number[];
gravity: XY;
tuning: b2RopeTuning;
}
export declare class b2Rope {
private readonly m_position;
private m_count;
private m_stretchCount;
private m_bendCount;
private readonly m_stretchConstraints;
private readonly m_bendConstraints;
private readonly m_bindPositions;
private readonly m_ps;
private readonly m_p0s;
private readonly m_vs;
private readonly m_invMasses;
private readonly m_gravity;
private readonly m_tuning;
constructor(def: b2RopeDef);
SetTuning(tuning: b2RopeTuning): void;
Step(dt: number, iterations: number, position: b2Readonly<b2Vec2>): void;
Reset(position: b2Readonly<b2Vec2>): void;
private SolveStretch_PBD;
private SolveStretch_XPBD;
private SolveBend_PBD_Angle;
private SolveBend_XPBD_Angle;
private SolveBend_PBD_Distance;
/**
* Constraint based implementation of:
* P. Volino: Simple Linear Bending Stiffness in Particle Systems
*/
private SolveBend_PBD_Height;
/** M. Kelager: A Triangle Bending Constraint Model for PBD */
private SolveBend_PBD_Triangle;
private ApplyBendForces;
Draw(draw: b2Draw): void;
}
//# sourceMappingURL=b2_rope.d.ts.map