Skip to content

Releases: schteppe/cannon.js

v0.6.2

28 Mar 18:37
Compare
Choose a tag to compare

Summary

This release contains the new Trimesh and ConeTwistConstraint classes along with a few fixes and optimizations for convex collisions. It should be fully backwards compatible with the previous v0.6.1.

Fixes

  • Fixed narrowphase bug for compound sphere/sphere shape collision.
  • Fixed bug in RaycastVehicle that didn't caused the world listeners to not add/remove properly.
  • Fixed sphere/plane contacts points when radius != 1.
  • Fixed bug in Heightfield that made some things pass through the field.
  • Fix in ConvexPolyhedron.prototype.computeEdges along with some narrowphase optimizations makes convex/convex collisions more performant.

Additions

  • Added methods .raycastAll, .raycastClosest and .raycastAny to World.
  • Added id properties to Equation and Shape.
  • Added Trimesh class, including sphere and plane collisions.
  • Added method Body.prototype.vectorToLocalFrame.
  • Made method Body.prototype.addShape chainable.
  • Added options for Body constructor: shape, fixedRotation, allowSleep, sleepSpeedLimit, sleepTimeLimit, collisionFilterGroup, collisionFilterMask, angularDamping.
  • Per-material restitution and friction that falls back on the old behavior. See properties friction and restitution in the Material class.
  • DistanceConstraint distance now defaults to the distance between the bodies.
  • Exposed Ray.pointInTriangle.
  • Added methods vectorToWorldFrame, vectorToLocalFrame, pointToLocal and pointToWorld to Transform.
  • Added method World.prototype.clearForces.
  • Added method ContactEquation.prototype.getImpactVelocityAlongNormal.
  • Sphere constructor now throws an error if radius is negative.
  • The AABB class is now exposed.
  • Added methods AABB.prototype.getCorners, .toLocalFrame, .toWorldFrame, .clone and .contains.
  • Added property material to Shape instances. It is thus possible to set per-shape materials, that will override the Body material if it is set.
  • Added World.prototype.removeBody, deprecated World.prototype.remove.
  • Added Constraint.prototype.enable and .disable.
  • HingeConstraint now extends PointToPointConstraint class.
  • Added static properties Vec3.UNIT_X, Vec3.UNIT_Y, Vec3.UNIT_Z.
  • Added class ConeTwistConstraint.
  • Added class Octree.
  • Added property uniqueAxes to ConvexPolyhedron.

Removed

  • HingeConstraint.prototype.getRotationalEquation1 - use property .rotationalEquation1 instead
  • HingeConstraint.prototype.getRotationalEquation2 - use property .rotationalEquation2 instead
  • HingeConstraint.prototype.getPointToPointEquation1 - use property .equationX instead
  • HingeConstraint.prototype.getPointToPointEquation2 - use property .equationY instead
  • HingeConstraint.prototype.getPointToPointEquation3 - use property .equationZ instead

Deprecated

  • World.prototype.remove - use World.prototype.removeBody instead.
  • Passing result to Ray.prototype.intersectBody(body, result) is deprecated - please set the .result property of the Ray instead.
  • Vec3.prototype.norm and .norm2 are deprecated - use .length and .lengthSquared() instead.
  • Vec3.prototype.mult is deprecated - use .scale instead.
  • The preStep and postStep properties of Body are deprecated - use the events with the same name in World instead.
  • World.prototype.numObjects() is deprecated - use world.bodies.length instead.
  • World.prototype.rayTest is deprecated - use .raycastAll, .raycastClosest or .raycastAny instead.

v0.6.1

25 Oct 14:20
Compare
Choose a tag to compare

Changes

  • Renamed body.tau to body.torque

Bug fixes

  • Fixed bug that prevented Ray from intersecting compound bodies properly.
  • Bodies should not fall through Heightfield any more.
  • Fixed update bug in AABB for compound bodies.
  • Fixed bug in AABB.prototype.overlaps.

Other

  • The bundles should now work even if RequireJS is present on the same page.
  • It's now possible to pass quaternion and velocities via the Body constructor.
  • More docs!

v0.6.0

21 Sep 16:30
Compare
Choose a tag to compare

Changes

  • Renamed RigidBody to just Body and changed the constructor signature.
  • Removed the Compound class, since a Body now contains a flat Shape hierarchy.
  • Renamed property .motionState to .type in Body.
  • Renamed the 'collide' event .with property to .body.
  • Renamed ObjectPool to just Pool.
  • World now dispatches events 'addBody' and 'removeBody'.
  • Changed API for adding forces and impulses to a body. See Body.applyImpulse and Body.applyForce.
  • Removed World.collision_matrix and instead added World.collisionMatrix and World.collisionMatrixPrevious. They both now work with body indices instead of body IDs.
  • Renamed Body.calculateAABB to .computeAABB. Added Body.aabbNeedsUpdate.
  • ConvexPolyhedron constructor now calculates normals instead of taking them as a parameter.
  • Reuse of various event objects to minimize object creation in the step loop.
  • Removed unused class ContactPoint.
  • Changed the signature of Broadphase.collisionPairs to Broadphase.collisionPairs(world,pairs1,pairs2), removing the need of an array return value.
  • Renamed ContactGenerator to Narrowphase.
  • Changed direction of the available math .copy methods, now they follow the pattern dest.copy(source).
  • Rewrote large parts of the Ray class. Now it has a start point and an end point, instead of a start point and a direction.
  • Improved sleeping.
  • Renamed property .last_dt to .dt in World.

Additions

  • Added class Spring.
  • Added class SAPBroadphase.
  • Added class TupleDictionary.
  • Added method .setFromEuler to Quaternion.
  • Added methods .transpose, .setRotationFromQuaternion, .scale to class Mat3.
  • Added Broadphase.useBoundingBoxes, .doBoundingBoxBroadphase and .intersectionTest.
  • Added Body.collisionFilterGroup and Body.collisionFilterMask.
  • Added class GridBroadphase, though it only supports Plane and Sphere for now.
  • Added class SPHSystem.
  • Added classes RaycastVehicle and WheelInfo.
  • Added class RigidVehicle.
  • Added class Heightfield.