p2s
Version:
A JavaScript 2D physics engine.
1,403 lines (1,402 loc) • 382 kB
JSON
{
"project": {
"name": "p2.js",
"description": "A JavaScript 2D physics engine.",
"version": "0.7.1"
},
"files": {
"src/collision/AABB.js": {
"name": "src/collision/AABB.js",
"modules": {},
"classes": {
"AABB": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/Broadphase.js": {
"name": "src/collision/Broadphase.js",
"modules": {},
"classes": {
"Broadphase": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/NaiveBroadphase.js": {
"name": "src/collision/NaiveBroadphase.js",
"modules": {},
"classes": {
"NaiveBroadphase": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/Narrowphase.js": {
"name": "src/collision/Narrowphase.js",
"modules": {},
"classes": {
"Narrowphase": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/Ray.js": {
"name": "src/collision/Ray.js",
"modules": {},
"classes": {
"Ray": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/RaycastResult.js": {
"name": "src/collision/RaycastResult.js",
"modules": {},
"classes": {
"RaycastResult": 1
},
"fors": {},
"namespaces": {}
},
"src/collision/SAPBroadphase.js": {
"name": "src/collision/SAPBroadphase.js",
"modules": {},
"classes": {
"SAPBroadphase": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/Constraint.js": {
"name": "src/constraints/Constraint.js",
"modules": {},
"classes": {
"Constraint": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/DistanceConstraint.js": {
"name": "src/constraints/DistanceConstraint.js",
"modules": {},
"classes": {
"DistanceConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/GearConstraint.js": {
"name": "src/constraints/GearConstraint.js",
"modules": {},
"classes": {
"GearConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/LockConstraint.js": {
"name": "src/constraints/LockConstraint.js",
"modules": {},
"classes": {
"LockConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/PrismaticConstraint.js": {
"name": "src/constraints/PrismaticConstraint.js",
"modules": {},
"classes": {
"PrismaticConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/constraints/RevoluteConstraint.js": {
"name": "src/constraints/RevoluteConstraint.js",
"modules": {},
"classes": {
"RevoluteConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/AngleLockEquation.js": {
"name": "src/equations/AngleLockEquation.js",
"modules": {},
"classes": {
"AngleLockEquation": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/ContactEquation.js": {
"name": "src/equations/ContactEquation.js",
"modules": {},
"classes": {
"ContactEquation": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/Equation.js": {
"name": "src/equations/Equation.js",
"modules": {},
"classes": {
"Equation": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/FrictionEquation.js": {
"name": "src/equations/FrictionEquation.js",
"modules": {},
"classes": {
"FrictionEquation": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/RotationalLockEquation.js": {
"name": "src/equations/RotationalLockEquation.js",
"modules": {},
"classes": {
"RotationalLockEquation": 1
},
"fors": {},
"namespaces": {}
},
"src/equations/RotationalVelocityEquation.js": {
"name": "src/equations/RotationalVelocityEquation.js",
"modules": {},
"classes": {
"RotationalVelocityEquation": 1
},
"fors": {},
"namespaces": {}
},
"src/events/EventEmitter.js": {
"name": "src/events/EventEmitter.js",
"modules": {},
"classes": {
"EventEmitter": 1
},
"fors": {},
"namespaces": {}
},
"src/material/ContactMaterial.js": {
"name": "src/material/ContactMaterial.js",
"modules": {},
"classes": {
"ContactMaterial": 1
},
"fors": {},
"namespaces": {}
},
"src/material/Material.js": {
"name": "src/material/Material.js",
"modules": {},
"classes": {
"Material": 1
},
"fors": {},
"namespaces": {}
},
"src/math/vec2.js": {
"name": "src/math/vec2.js",
"modules": {},
"classes": {
"vec2": 1
},
"fors": {},
"namespaces": {}
},
"src/objects/Body.js": {
"name": "src/objects/Body.js",
"modules": {},
"classes": {
"Body": 1
},
"fors": {},
"namespaces": {}
},
"src/objects/LinearSpring.js": {
"name": "src/objects/LinearSpring.js",
"modules": {},
"classes": {
"LinearSpring": 1
},
"fors": {},
"namespaces": {}
},
"src/objects/RotationalSpring.js": {
"name": "src/objects/RotationalSpring.js",
"modules": {},
"classes": {
"RotationalSpring": 1
},
"fors": {},
"namespaces": {}
},
"src/objects/Spring.js": {
"name": "src/objects/Spring.js",
"modules": {},
"classes": {
"Spring": 1
},
"fors": {},
"namespaces": {}
},
"src/objects/TopDownVehicle.js": {
"name": "src/objects/TopDownVehicle.js",
"modules": {},
"classes": {
"TopDownVehicle": 1,
"WheelConstraint": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Box.js": {
"name": "src/shapes/Box.js",
"modules": {},
"classes": {
"Box": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Capsule.js": {
"name": "src/shapes/Capsule.js",
"modules": {},
"classes": {
"Capsule": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Circle.js": {
"name": "src/shapes/Circle.js",
"modules": {},
"classes": {
"Circle": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Convex.js": {
"name": "src/shapes/Convex.js",
"modules": {},
"classes": {
"Convex": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Heightfield.js": {
"name": "src/shapes/Heightfield.js",
"modules": {},
"classes": {
"Heightfield": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Line.js": {
"name": "src/shapes/Line.js",
"modules": {},
"classes": {
"Line": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Particle.js": {
"name": "src/shapes/Particle.js",
"modules": {},
"classes": {
"Particle": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Plane.js": {
"name": "src/shapes/Plane.js",
"modules": {},
"classes": {
"Plane": 1
},
"fors": {},
"namespaces": {}
},
"src/shapes/Shape.js": {
"name": "src/shapes/Shape.js",
"modules": {},
"classes": {
"Shape": 1
},
"fors": {},
"namespaces": {}
},
"src/solver/GSSolver.js": {
"name": "src/solver/GSSolver.js",
"modules": {},
"classes": {
"GSSolver": 1
},
"fors": {},
"namespaces": {}
},
"src/solver/Solver.js": {
"name": "src/solver/Solver.js",
"modules": {},
"classes": {
"Solver": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/ContactEquationPool.js": {
"name": "src/utils/ContactEquationPool.js",
"modules": {},
"classes": {},
"fors": {},
"namespaces": {}
},
"src/utils/FrictionEquationPool.js": {
"name": "src/utils/FrictionEquationPool.js",
"modules": {},
"classes": {},
"fors": {},
"namespaces": {}
},
"src/utils/IslandNodePool.js": {
"name": "src/utils/IslandNodePool.js",
"modules": {},
"classes": {},
"fors": {},
"namespaces": {}
},
"src/utils/IslandPool.js": {
"name": "src/utils/IslandPool.js",
"modules": {},
"classes": {},
"fors": {},
"namespaces": {}
},
"src/utils/OverlapKeeper.js": {
"name": "src/utils/OverlapKeeper.js",
"modules": {},
"classes": {
"OverlapKeeper": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/OverlapKeeperRecord.js": {
"name": "src/utils/OverlapKeeperRecord.js",
"modules": {},
"classes": {
"OverlapKeeperRecord": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/OverlapKeeperRecordPool.js": {
"name": "src/utils/OverlapKeeperRecordPool.js",
"modules": {},
"classes": {
"": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/Pool.js": {
"name": "src/utils/Pool.js",
"modules": {},
"classes": {
"Object pooling utility.": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/TupleDictionary.js": {
"name": "src/utils/TupleDictionary.js",
"modules": {},
"classes": {
"TupleDictionary": 1
},
"fors": {},
"namespaces": {}
},
"src/utils/Utils.js": {
"name": "src/utils/Utils.js",
"modules": {},
"classes": {
"Utils": 1
},
"fors": {},
"namespaces": {}
},
"src/world/Island.js": {
"name": "src/world/Island.js",
"modules": {},
"classes": {
"Island": 1
},
"fors": {},
"namespaces": {}
},
"src/world/IslandManager.js": {
"name": "src/world/IslandManager.js",
"modules": {},
"classes": {
"IslandManager": 1
},
"fors": {},
"namespaces": {}
},
"src/world/IslandNode.js": {
"name": "src/world/IslandNode.js",
"modules": {},
"classes": {
"IslandNode": 1
},
"fors": {},
"namespaces": {}
},
"src/world/World.js": {
"name": "src/world/World.js",
"modules": {},
"classes": {
"World": 1
},
"fors": {},
"namespaces": {}
}
},
"modules": {},
"classes": {
"AABB": {
"name": "AABB",
"shortname": "AABB",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/AABB.js",
"line": 6,
"description": "Axis aligned bounding box class.",
"is_constructor": 1,
"params": [
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "upperBound",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "lowerBound",
"description": "",
"type": "Array",
"optional": true
}
]
}
]
},
"Broadphase": {
"name": "Broadphase",
"shortname": "Broadphase",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/Broadphase.js",
"line": 6,
"description": "Base class for broadphase implementations.",
"is_constructor": 1
},
"NaiveBroadphase": {
"name": "NaiveBroadphase",
"shortname": "NaiveBroadphase",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/NaiveBroadphase.js",
"line": 10,
"description": "Naive broadphase implementation. Does N^2 tests.",
"is_constructor": 1,
"extends": "Broadphase"
},
"Narrowphase": {
"name": "Narrowphase",
"shortname": "Narrowphase",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/Narrowphase.js",
"line": 43,
"description": "Narrowphase. Creates contacts and friction given shapes and transforms.",
"is_constructor": 1
},
"Ray": {
"name": "Ray",
"shortname": "Ray",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/Ray.js",
"line": 8,
"description": "A line with a start and end point that is used to intersect shapes. For an example, see {{#crossLink \"World/raycast:method\"}}World.raycast{{/crossLink}}",
"is_constructor": 1,
"params": [
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "from",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "to",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "checkCollisionResponse",
"description": "",
"type": "Boolean",
"optional": true,
"optdefault": "true"
},
{
"name": "skipBackfaces",
"description": "",
"type": "Boolean",
"optional": true,
"optdefault": "false"
},
{
"name": "collisionMask",
"description": "",
"type": "Number",
"optional": true,
"optdefault": "-1"
},
{
"name": "collisionGroup",
"description": "",
"type": "Number",
"optional": true,
"optdefault": "-1"
},
{
"name": "mode",
"description": "",
"type": "Number",
"optional": true,
"optdefault": "Ray.ANY"
},
{
"name": "callback",
"description": "",
"type": "Number",
"optional": true
}
]
}
]
},
"RaycastResult": {
"name": "RaycastResult",
"shortname": "RaycastResult",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/RaycastResult.js",
"line": 6,
"description": "Storage for Ray casting hit data.",
"is_constructor": 1
},
"SAPBroadphase": {
"name": "SAPBroadphase",
"shortname": "SAPBroadphase",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/collision/SAPBroadphase.js",
"line": 6,
"description": "Sweep and prune broadphase along one axis.",
"is_constructor": 1,
"extends": "Broadphase"
},
"Constraint": {
"name": "Constraint",
"shortname": "Constraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/Constraint.js",
"line": 5,
"description": "Base constraint class.",
"is_constructor": 1,
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "type",
"description": "",
"type": "Number"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "collideConnected",
"description": "",
"type": "Object",
"optional": true,
"optdefault": "true"
}
]
}
]
},
"DistanceConstraint": {
"name": "DistanceConstraint",
"shortname": "DistanceConstraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/DistanceConstraint.js",
"line": 8,
"description": "Constraint that tries to keep the distance between two bodies constant.",
"is_constructor": 1,
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "distance",
"description": "The distance to keep between the anchor points. Defaults to the current distance between the bodies.",
"type": "Number",
"optional": true
},
{
"name": "localAnchorA] The anchor point for bodyA, defined locally in bodyA frame. Defaults to [0,0",
"description": ".",
"type": "Array",
"optional": true
},
{
"name": "localAnchorB] The anchor point for bodyB, defined locally in bodyB frame. Defaults to [0,0",
"description": ".",
"type": "Array",
"optional": true
},
{
"name": "maxForce",
"description": "Maximum force to apply.",
"type": "Object",
"optional": true,
"optdefault": "Number.MAX_VALUE"
}
]
}
],
"extends": "Constraint",
"example": [
"\n // If distance is not given as an option, then the current distance between the bodies is used.\n // In this example, the bodies will be constrained to have a distance of 2 between their centers.\n var bodyA = new Body({ mass: 1, position: [-1, 0] });\n var bodyB = new Body({ mass: 1, position: [1, 0] });\n var constraint = new DistanceConstraint(bodyA, bodyB);\n world.addConstraint(constraint);",
"\n // Manually set the distance and anchors\n var constraint = new DistanceConstraint(bodyA, bodyB, {\n distance: 1, // Distance to keep between the points\n localAnchorA: [1, 0], // Point on bodyA\n localAnchorB: [-1, 0] // Point on bodyB\n });\n world.addConstraint(constraint);"
]
},
"GearConstraint": {
"name": "GearConstraint",
"shortname": "GearConstraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/GearConstraint.js",
"line": 8,
"description": "Constrains the angle of two bodies to each other to be equal. If a gear ratio is not one, the angle of bodyA must be a multiple of the angle of bodyB.",
"is_constructor": 1,
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "angle",
"description": "Relative angle between the bodies. Will be set to the current angle between the bodies (the gear ratio is accounted for).",
"type": "Number",
"optional": true,
"optdefault": "0"
},
{
"name": "ratio",
"description": "Gear ratio.",
"type": "Number",
"optional": true,
"optdefault": "1"
},
{
"name": "maxTorque",
"description": "Maximum torque to apply.",
"type": "Number",
"optional": true
}
]
}
],
"extends": "Constraint",
"example": [
"\n var constraint = new GearConstraint(bodyA, bodyB);\n world.addConstraint(constraint);",
"\n var constraint = new GearConstraint(bodyA, bodyB, {\n ratio: 2,\n maxTorque: 1000\n });\n world.addConstraint(constraint);"
]
},
"LockConstraint": {
"name": "LockConstraint",
"shortname": "LockConstraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/LockConstraint.js",
"line": 7,
"description": "Locks the relative position and rotation between two bodies.",
"is_constructor": 1,
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "localOffsetB",
"description": "The offset of bodyB in bodyA's frame. If not given the offset is computed from current positions.",
"type": "Array",
"optional": true
},
{
"name": "localAngleB",
"description": "The angle of bodyB in bodyA's frame. If not given, the angle is computed from current angles.",
"type": "Number",
"optional": true
},
{
"name": "maxForce",
"description": "",
"type": "Number",
"optional": true
}
]
}
],
"extends": "Constraint",
"example": [
"\n // Locks the relative position and rotation between bodyA and bodyB\n var constraint = new LockConstraint(bodyA, bodyB);\n world.addConstraint(constraint);"
]
},
"PrismaticConstraint": {
"name": "PrismaticConstraint",
"shortname": "PrismaticConstraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/PrismaticConstraint.js",
"line": 9,
"description": "Constraint that only allows bodies to move along a line, relative to each other. See <a href=\"http://www.iforce2d.net/b2dtut/joints-prismatic\">this tutorial</a>. Also called \"slider constraint\".",
"is_constructor": 1,
"extends": "Constraint",
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "maxForce",
"description": "Max force to be applied by the constraint",
"type": "Number",
"optional": true
},
{
"name": "localAnchorA",
"description": "Body A's anchor point, defined in its own local frame.",
"type": "Array",
"optional": true
},
{
"name": "localAnchorB",
"description": "Body B's anchor point, defined in its own local frame.",
"type": "Array",
"optional": true
},
{
"name": "localAxisA",
"description": "An axis, defined in body A frame, that body B's anchor point may slide along.",
"type": "Array",
"optional": true
},
{
"name": "disableRotationalLock",
"description": "If set to true, bodyB will be free to rotate around its anchor point.",
"type": "Boolean",
"optional": true
},
{
"name": "upperLimit",
"description": "",
"type": "Number",
"optional": true
},
{
"name": "lowerLimit",
"description": "",
"type": "Number",
"optional": true
}
]
}
],
"todo": [
"Ability to create using only a point and a worldAxis"
]
},
"RevoluteConstraint": {
"name": "RevoluteConstraint",
"shortname": "RevoluteConstraint",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/constraints/RevoluteConstraint.js",
"line": 15,
"description": "Connects two bodies at given offset points, letting them rotate relative to each other around this point.",
"is_constructor": 1,
"author": "schteppe",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "worldPivot",
"description": "A pivot point given in world coordinates. If specified, localPivotA and localPivotB are automatically computed from this value.",
"type": "Array",
"optional": true
},
{
"name": "localPivotA",
"description": "The point relative to the center of mass of bodyA which bodyA is constrained to.",
"type": "Array",
"optional": true
},
{
"name": "localPivotB",
"description": "See localPivotA.",
"type": "Array",
"optional": true
},
{
"name": "maxForce",
"description": "The maximum force that should be applied to constrain the bodies.",
"type": "Number",
"optional": true
}
]
}
],
"extends": "Constraint",
"example": [
"\n // This will create a revolute constraint between two bodies with pivot point in between them.\n var bodyA = new Body({ mass: 1, position: [-1, 0] });\n var bodyB = new Body({ mass: 1, position: [1, 0] });\n var constraint = new RevoluteConstraint(bodyA, bodyB, {\n worldPivot: [0, 0]\n });\n world.addConstraint(constraint);\n\n // Using body-local pivot points, the constraint could have been constructed like this:\n var constraint = new RevoluteConstraint(bodyA, bodyB, {\n localPivotA: [1, 0],\n localPivotB: [-1, 0]\n });"
]
},
"AngleLockEquation": {
"name": "AngleLockEquation",
"shortname": "AngleLockEquation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/AngleLockEquation.js",
"line": 6,
"description": "Locks the relative angle between two bodies. The constraint tries to keep the dot product between two vectors, local in each body, to zero. The local angle in body i is a parameter.",
"is_constructor": 1,
"extends": "Equation",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "angle",
"description": "Angle to add to the local vector in body A.",
"type": "Number",
"optional": true
},
{
"name": "ratio",
"description": "Gear ratio",
"type": "Number",
"optional": true
}
]
}
]
},
"ContactEquation": {
"name": "ContactEquation",
"shortname": "ContactEquation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/ContactEquation.js",
"line": 6,
"description": "Non-penetration constraint equation. Tries to make the contactPointA and contactPointB vectors coincide, while keeping the applied force repulsive.",
"is_constructor": 1,
"extends": "Equation",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
}
]
},
"Equation": {
"name": "Equation",
"shortname": "Equation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/Equation.js",
"line": 7,
"description": "Base class for constraint equations.",
"is_constructor": 1,
"params": [
{
"name": "bodyA",
"description": "First body participating in the equation",
"type": "Body"
},
{
"name": "bodyB",
"description": "Second body participating in the equation",
"type": "Body"
},
{
"name": "minForce",
"description": "Minimum force to apply. Default: -Number.MAX_VALUE",
"type": "Number"
},
{
"name": "maxForce",
"description": "Maximum force to apply. Default: Number.MAX_VALUE",
"type": "Number"
}
]
},
"FrictionEquation": {
"name": "FrictionEquation",
"shortname": "FrictionEquation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/FrictionEquation.js",
"line": 7,
"description": "Constrains the slipping in a contact along a tangent",
"is_constructor": 1,
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "slipForce",
"description": "",
"type": "Number"
}
],
"extends": "Equation"
},
"RotationalLockEquation": {
"name": "RotationalLockEquation",
"shortname": "RotationalLockEquation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/RotationalLockEquation.js",
"line": 6,
"description": "Locks the relative angle between two bodies. The constraint tries to keep the dot product between two vectors, local in each body, to zero. The local angle in body i is a parameter.",
"is_constructor": 1,
"extends": "Equation",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "angle",
"description": "Angle to add to the local vector in bodyA.",
"type": "Number",
"optional": true
}
]
}
]
},
"RotationalVelocityEquation": {
"name": "RotationalVelocityEquation",
"shortname": "RotationalVelocityEquation",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/equations/RotationalVelocityEquation.js",
"line": 6,
"description": "Syncs rotational velocity of two bodies, or sets a relative velocity (motor).",
"is_constructor": 1,
"extends": "Equation",
"params": [
{
"name": "bodyA",
"description": "",
"type": "Body"
},
{
"name": "bodyB",
"description": "",
"type": "Body"
}
]
},
"EventEmitter": {
"name": "EventEmitter",
"shortname": "EventEmitter",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/events/EventEmitter.js",
"line": 1,
"description": "Base class for objects that dispatches events.",
"is_constructor": 1
},
"ContactMaterial": {
"name": "ContactMaterial",
"shortname": "ContactMaterial",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/material/ContactMaterial.js",
"line": 6,
"description": "Defines what happens when two materials meet, such as what friction coefficient to use. You can also set other things such as restitution, surface velocity and constraint parameters.",
"is_constructor": 1,
"params": [
{
"name": "materialA",
"description": "",
"type": "Material"
},
{
"name": "materialB",
"description": "",
"type": "Material"
},
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "friction",
"description": "Friction coefficient.",
"type": "Number",
"optional": true,
"optdefault": "0.3"
},
{
"name": "restitution",
"description": "Restitution coefficient aka \"bounciness\".",
"type": "Number",
"optional": true,
"optdefault": "0"
},
{
"name": "stiffness",
"description": "ContactEquation stiffness.",
"type": "Number",
"optional": true
},
{
"name": "relaxation",
"description": "ContactEquation relaxation.",
"type": "Number",
"optional": true
},
{
"name": "frictionStiffness",
"description": "FrictionEquation stiffness.",
"type": "Number",
"optional": true
},
{
"name": "frictionRelaxation",
"description": "FrictionEquation relaxation.",
"type": "Number",
"optional": true
},
{
"name": "surfaceVelocity",
"description": "Surface velocity.",
"type": "Number",
"optional": true,
"optdefault": "0"
}
]
}
],
"author": "schteppe"
},
"Material": {
"name": "Material",
"shortname": "Material",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/material/Material.js",
"line": 3,
"description": "Defines a physics material.",
"is_constructor": 1,
"params": [
{
"name": "id",
"description": "Material identifier",
"type": "Number"
}
],
"author": "schteppe"
},
"vec2": {
"name": "vec2",
"shortname": "vec2",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/math/vec2.js",
"line": 23,
"description": "The vec2 object from glMatrix, with some extensions and some removed methods. See http://glmatrix.net."
},
"Body": {
"name": "Body",
"shortname": "Body",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "src/objects/Body.js",
"line": 11,
"description": "A rigid body. Has got a center of mass, position, velocity and a number of\nshapes that are used for collisions.",
"is_constructor": 1,
"extends": "EventEmitter",
"params": [
{
"name": "options",
"description": "",
"type": "Object",
"optional": true,
"props": [
{
"name": "force",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "position",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "velocity",
"description": "",
"type": "Array",
"optional": true
},
{
"name": "allowSleep",
"description": "",
"type": "Boolean",
"optional": true
},
{
"name": "collisionResponse",
"description": "",
"type": "Boolean",