CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 01:47:03 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"14a7e312ed55ee5d7d8b05da64ba3c7f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=wNktGDdSl5A36zP7O%2FfaE4pjxZhz6WDkfmvdpN9hebw%2Bh%2F%2FaNBiWBfzKcOHDuVj8STPERk7isTkrqJdJjKu0XyotGALcyJ4xqKqxMsbuChQwlQ4e%2F1uJgZ48rWI6GUxypQb7xzxUpDGYU36761NBIQqOaiIjR8iWYGsnWb3x7pXV510LTV3x8sW901F2UJCBNgUw9D0dheQncqku5Wkv%2FXCM71vFrx8JD71XmuZ9VboFnCskxOUvbC2G05ifVL1rcRCz32PeMa32fzWPjF2dHg%3D%3D--HkfpcqErl5YeVwp1--SpsII7vwf3IMMKs14Oit7w%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.793198259.1753235223; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 01:47:03 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 01:47:03 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: D614:121670:247504:336159:68803F17
Releases · schteppe/p2.js · GitHub
21 Nov 19:01
Loading
12 Jul 19:18
Loading
29 Mar 11:29
Loading
09 Jul 19:06
Loading
05 Apr 21:40
Loading
22 Jan 21:04
Loading
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 329
Releases: schteppe/p2.js
Releases · schteppe/p2.js
v0.7.1
Compare
Upgrades the poly-decomp dependency, and adds ContactEquation.prototype.getVelocityAlongNormal
. Not much more to see here :)
Assets 4
v0.7.0
Compare
Summary
- This release makes it more easy and verbose to construct Shapes due to new constructors.
- Shapes now have
position
andangle
properties, which indicates the local position in the body they are attached to. This also means that aShape
instance can be attached to a singleBody
. - The raycasting API is refactored and should now be more verbose and flexible.
TopDownVehicle
class was added. Use it to make racing games!
Changes
- Renamed
Rectangle
toBox
380aaa5 - Updated all
Shape
constructors so they take their parameters via an options object. This way,Shape
constructor parameters can be passed in the same options object. 380aaa5new Rectangle(w, h)
=>new Box({ width: w, height: h })
new Capsule(l, r)
=>new Capsule({ length: l, radius: r })
new Circle(r)
=>new Circle({ radius: r })
new Convex(array)
=>new Convex({ vertices: array })
new Heightfield(array, options)
=>new Heightfield({ heights: array, [...other options...] })
new Line(l)
=>new Line({ length: l })
- Removed
.shapeOffsets
and.shapeAngles
fromBody
in favor of the new.position
and.angle
properties in the Shape instances. This means that a shape can only be added to one body. 16e1a47 - Raycasting API is scratched and rewritten. Replaced World.prototype.raycastAll, .raycastClosest and .raycastAny with
.raycast(result, ray)
. Moved the intersection methods inRay
to their respectiveShape
. d1feff1 - Enabled island splitting by default 1aed70b
- Increased default solver tolerance 1aed70b
- The "point" argument in
Body.prototype.applyForce
should now be a vector relative to theBody
position, instead of a world point 28494c1
Fixes
- Event objects now release references to objects in parameters after emit fe2461b
- Fix for requirejs via phaser ced0558
Additions
- The following options can now be passed via the
Shape
constructor: material, position, angle, collisionGroup, collisionMask, sensor, collisionResponse 6a20c75 380aaa5 - Added AABB.prototype.containsPoint 9423e3a
- Added vec2.getLineSegmentsIntersection and vec2.getLineSegmentsIntersectionFraction a01ee11
- Added
AABB.prototype.overlapsRay
- Added
vec2.reflect
ea9b6d5 - Added
TopDownVehicle
class 33846a5 - Added
Body.prototype.getVelocityAtPoint
33846a5 - Added object pools and prefilling 3537a2e 0b2a648
- Added
Body.prototype.applyLocalForce
28494c1 - The following options can now be passed to Body constructor: allowSleep, collisionResponse, gravityScale, sleepSpeedLimit, sleepTimeLimit, id
- Added
Body.prototype.applyImpulse
,.applyImpulseLocal
,.vectorToLocalFrame
,. vectorToWorldFrame
872ea6c - Added
vec2.vectorToLocalFrame
andvec2.vectorToGlobalFrame
238d120
Removals
- Removed
GridBroadphase
since it is buggy and mostly unused e90c672 - Removed
World.prototype.setGlobalEquationParameters
. Use.setGlobalStiffness
and.setGlobalRelaxation
instead 69d494b - Removed
doProfiling
andlastStepTime
properties fromWorld
since it is much easier to use the browser profiling tools nowadays. 4223c88 - Removed broken method
World.prototype.clone
c330903
Assets 4
v0.6.1
Compare
Small release, fixes some bugs and adds basic raycasting + experimental CCD.
Changes
- Changed default broadphase algorithm to
SAPBroadphase
.
Fixes
- Fixed bug in
endContact
event, bodyB had the value of bodyA. - Require.js fix for the build files, making it possible to use p2.js on the same page as require.js
.idleTime
inBody
is now initialized correctly- All classes now have .constructor set correctly
Additions
- Added
.collisonResponse
flag forBody
andShape
. - Added methods
.raycastClosest
,.raycastAll
and.raycastAny
toWorld
- Added method
Body.prototype.integrate
- Added properties
.ccdSpeedThreshold
and.ccdIterations
toBody
Assets 6
v0.6.0
Compare
Breaking changes
- Renamed property
.motionState
to.type
in classBody
. - Changed constructor of
RevoluteConstraint
. Now the local pivots are passed as options instead of direct arguments. See the constraints demo. - Removed
World.prototype.toJSON
and.fromJSON
. - Removed properties
.enableBodySleeping
and.enableIslandSleeping
fromWorld
instances. The enum.sleepMode
can be used instead. See the sleep demo. - Converted
Spring
to a base class for the newLinearSpring
andRotationalSpring
classes.LinearSpring
can be used as the oldSpring
. Utils.ARRAY_TYPE
can now be overridden by injecting a global calledP2_ARRAY_TYPE
. Support forGLMAT_ARRAY_TYPE
has been removed.
Other changes
- Added flag
.enableFrictionReduction
toNarrowphase
. - Added
RevoluteConstraint.prototype.setLimits
. - Added
PrismaticConstraint.prototype.setLimits
. LockConstraint
,DistanceConstraint
, andGearConstraint
can now be constructed from current body transforms.RevoluteConstraint
can now be constructed from the current body transforms and a world point.Material
id can now be passed via constructor.ContactMaterial
instances now have a property.contactSkinSize
.- Added method
Body.prototype.getAABB
. - Limits for
DistanceConstraint
. See the DistanceConstraint demo. - Added
Body.prototype.overlaps
. - Added class
OverlapKeeper
. - If substepping is used in
World.prototype.step
, the substeps are aborted if slower than real time. - Added
Heightfield
/Convex
andHeightfield
/Circle
collision support. - Added property
.overlapKeeper
toWorld
. EventEmitter.prototype.has
can now check if any listeners were added to a given topic.- Added
Utils.defaults
.
Assets 4
v0.5.0
Compare
- Added property
.enableIslandSleeping
toWorld
. - Added property
.useFrictionGravityOnZeroGravity
toWorld
. - Renamed
.useWorldGravityForFrictionApproximation
inWorld
to.useWorldGravityAsFrictionGravity
to keep things more uniform. - Sleep improvements.
- Added property
.frictionIterations
toGSSolver
, and removed.skipFrictionIterations
. - Upgraded to gl-matrix
2.1.0
. - Removed
QuadTree
. - Removed
mat2
. - Added
Utils.extend
. - Added methods
.setStiffness
and.setRelaxation
methods toConstraint
. - Removed properties
.stiffness
,.relaxation
and.useGlobalEquationParameters
fromGSSolver
. - Added methods
.setGlobalStiffness
,.setGlobalRelaxation
,.setGlobalEquationParameters
toWorld
. - Renamed property
.eps
to.epsilon
forEquation
. - Removed property
.useBoundingBoxes
fromNaiveBroadphase
in favor of the new property.boundingVolumeType
inBroadphase
. - Added methods
.getMaxForce
and.setMaxForce
toLockConstraint
. - Changed property names
.bi
,.bj
,.ni
,.ri
,.rj
to.bodyA
,.bodyB
,.normalA
,.contactPointA
,.contactPointB
inEquation
,ContactEquation
andFrictionEquation
classes. - Removed
IslandSolver
in favor of the new propertyWorld.islandSplit
. - Changed constructors of the
Constraints
so they all take anoptions
object as last parameter. - Added property
.collideConnected
toConstraint
. - Added property
.islandSplit
toWorld
. - Added methods
.disableBodyCollision
and.enableBodyCollision
toWorld
. - Added properties
.useWorldGravityForFrictionApproximation
and.frictionGravity
toWorld
. - Added
Heightfield
class. - Removed properties
.defaultFriction
and.defaultRestitution
fromWorld
, in favor of.defaultContactMaterial
. - Added property
.enabled
toEquation
. - Added property
.surfaceVelocity
toContactMaterial
. - Added property
.sensor
toShape
. World
now emits events'beginContact'
,'endContact'
and'preSolve'
.- Added property
.gravityScale
toBody
. - Renamed class
SAP1DBroadphase
toSAPBroadphase
. - Added property
.interpolatedPosition
to `Body``. - Added method
.internalStep
toWorld
. - Added property
.applyGravity
toWorld
. - Renamed method
.computeC
to.computeInvC
inEquation
, and made it compute the inverse. - Added static method
Utils.splice
. - Added property
.world
toBody
. - Added property
.fixedRotation
toBody
. - Added class
AABB
. - Added properties
.aabb
and.aabbNeedsUpdate
toBody
, as well as a method.updateAABB
. - Added property
.useBoundingBoxes
toNaiveBroadphase
. - Added static method
Broadphase.aabbCheck
. - Added method
.computeAABB
toShape
. - Added static method
Broadphase.canCollide
. Body
now inherits fromEventEmitter
, and dispatches events'sleep'
,'sleepy'
and'wakeup'
.- Added properties
.allowSleep
,.sleepState
,.sleepSpeedLimit
,.sleepTimeLimit
,.lastTimeSleepy
as well as methods.sleep
,.wakeUp
and.sleepTick
toBody
. - Added enums
Body.AWAKE
,Body.SLEEPY
,Body.SLEEPING
. - Added property
.enableBodySleeping
toWorld
. - Added options
.disableRotationalLock
,.lowerLimit
,.upperLimit
toPrismaticConstraint
constructor. - Added methods
.enableMotor
,.disableMotor
toPrismaticConstraint
as well as properties.motorEnabled
,.motorSpeed
,.motorEquation
.
Assets 4
v0.4.0
Compare
- Added properties
.damping
and.angularDamping
toBody
. - Added property
.applyDamping
toWorld
. - Added properties
.shapeA
and.shapeB
toContactEquation
andFrictionEquation
. - Added property
.contactEquation
toFrictionEquation
. - Added property
.multiplier
toEquation
. - Added properties
.lowerLimitEnabled
,.lowerLimit
,.upperLimitEnabled
,.upperLimit
toRevoluteConstraint
. - Added property
.frictionCoefficient
toFrictionEquation
andNarrowphase
. The solver now updates the friction force bounds dynamically in the solver from this value.FrictionEquation.setSlipForce()
is thus deprecated. - Changed name of
Narrowphase.convexPlane
toNarrowphase.planeConvex
. - Changed name of
Narrowphase.capsulePlane
toNarrowphase.planeCapsule
. - Added property
.emitImpactEvent
toWorld
. - Added method
.getBodyById
toWorld
. - Added property
.skipFrictionIterations
toGSSolver
. - Changed parameter names for
PrismaticConstraint
. This breaks backwards compatibility. - Added properties
.localAxisA
,.localAnchorA
,.localAnchorB
, toPrismaticConstraint
.
Assets 2
You can’t perform that action at this time.