Permalink
Browse files

AngularVelocity, and sensor added to lib/cpBody / lib/cpShape

Updated cp.min.js as well
  • Loading branch information...
1 parent 62285ea commit cbf9cacbb5dc4c13c1ecf90554ba3c0893db8c7b @ricardoquesada ricardoquesada committed Sep 28, 2012
Showing with 10 additions and 3 deletions.
  1. +0 −1 cp.js
  2. +2 −2 cp.min.js
  3. +6 −0 lib/cpBody.js
  4. +2 −0 lib/cpShape.js
View
1 cp.js
@@ -711,7 +711,6 @@ Shape.prototype.setLayers = function(layers) { this.body.activate(); this.layers
Shape.prototype.setSensor = function(sensor) { this.body.activate(); this.sensor = sensor; };
Shape.prototype.setCollisionType = function(collision_type) { this.body.activate(); this.collision_type = collision_type; };
-
Shape.prototype.active = function()
{
// return shape->prev || shape->body->shapeList == shape;
View
4 cp.min.js
2 additions, 2 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 lib/cpBody.js
@@ -211,6 +211,12 @@ Body.prototype.setVelocity = function(velocity)
this.vy = velocity.y;
};
+Body.prototype.setAngularVelocity = function(w)
+{
+ this.activate();
+ this.w = w;
+};
+
Body.prototype.setAngleInternal = function(angle)
{
assert(!isNaN(angle), "Internal Error: Attempting to set body's angle to NaN");
View
2 lib/cpShape.js
@@ -82,6 +82,8 @@ var Shape = cp.Shape = function(body) {
Shape.prototype.setElasticity = function(e) { this.e = e; };
Shape.prototype.setFriction = function(u) { this.body.activate(); this.u = u; };
Shape.prototype.setLayers = function(layers) { this.body.activate(); this.layers = layers; };
+Shape.prototype.setSensor = function(sensor) { this.body.activate(); this.sensor = sensor; };
+Shape.prototype.setCollisionType = function(collision_type) { this.body.activate(); this.collision_type = collision_type; };
Shape.prototype.active = function()
{

0 comments on commit cbf9cac

Please sign in to comment.