UNPKG

@box2d/debug-draw

Version:

Debug drawing helper for @box2d

76 lines 2.99 kB
import { b2Vec2, b2Mat22, XY } from "../common/b2_math"; import { b2Joint, b2JointDef, b2IJointDef } from "./b2_joint"; import { b2SolverData } from "./b2_time_step"; import { b2Body } from "./b2_body"; import { b2Readonly } from "../common/b2_readonly"; export interface b2IFrictionJointDef extends b2IJointDef { localAnchorA: XY; localAnchorB: XY; maxForce?: number; maxTorque?: number; } /** * Friction joint definition. */ export declare class b2FrictionJointDef extends b2JointDef implements b2IFrictionJointDef { /** The local anchor point relative to bodyA's origin. */ readonly localAnchorA: b2Vec2; /** The local anchor point relative to bodyB's origin. */ readonly localAnchorB: b2Vec2; /** The maximum friction force in N. */ maxForce: number; /** The maximum friction torque in N-m. */ maxTorque: number; constructor(); /** * Initialize the bodies, anchors, axis, and reference angle using the world * anchor and world axis. */ Initialize(bA: b2Body, bB: b2Body, anchor: b2Readonly<b2Vec2>): void; } /** * Friction joint. This is used for top-down friction. * It provides 2D translational friction and angular friction. */ export declare class b2FrictionJoint extends b2Joint { protected readonly m_localAnchorA: b2Vec2; protected readonly m_localAnchorB: b2Vec2; protected readonly m_linearImpulse: b2Vec2; protected m_angularImpulse: number; protected m_maxForce: number; protected m_maxTorque: number; protected m_indexA: number; protected m_indexB: number; protected readonly m_rA: b2Vec2; protected readonly m_rB: b2Vec2; protected readonly m_localCenterA: b2Vec2; protected readonly m_localCenterB: b2Vec2; protected m_invMassA: number; protected m_invMassB: number; protected m_invIA: number; protected m_invIB: number; protected readonly m_linearMass: b2Mat22; protected m_angularMass: number; /** @internal protected */ constructor(def: b2IFrictionJointDef); InitVelocityConstraints(data: b2SolverData): void; SolveVelocityConstraints(data: b2SolverData): void; SolvePositionConstraints(_data: b2SolverData): boolean; GetAnchorA<T extends XY>(out: T): T; GetAnchorB<T extends XY>(out: T): T; GetReactionForce<T extends XY>(inv_dt: number, out: T): T; GetReactionTorque(inv_dt: number): number; /** The local anchor point relative to bodyA's origin. */ GetLocalAnchorA(): b2Readonly<b2Vec2>; /** The local anchor point relative to bodyB's origin. */ GetLocalAnchorB(): b2Readonly<b2Vec2>; /** Set the maximum friction force in N. */ SetMaxForce(force: number): void; /** Get the maximum friction force in N. */ GetMaxForce(): number; /** Set the maximum friction torque in N*m. */ SetMaxTorque(torque: number): void; /** Get the maximum friction torque in N*m. */ GetMaxTorque(): number; } //# sourceMappingURL=b2_friction_joint.d.ts.map