Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Num verts #14

Merged
merged 2 commits into from

2 participants

Hao Wu Joseph Gentle
Hao Wu

this will make those 2 functions work.

but imo, while making it a single dimension array seams faster, you still need to convert them to x,y objects some time later

Joseph Gentle josephg merged commit ca60424 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +7 −7 cp.js
14 cp.js
View
@@ -1235,17 +1235,17 @@ PolyShape.prototype.segmentQuery = function(a, b)
}
};
-/*
-PolyShape.getNumVerts = function()
+
+PolyShape.prototype.getNumVerts = function()
{
- return this.verts.length;
-};*/
+ return this.verts.length/2;
+};
+
-/*
PolyShape.prototype.getVert = function(idx)
{
- return this.verts[idx];
-};*/
+ return new Vect(this.verts[idx*2],this.verts[idx*2+1]);
+};
PolyShape.prototype.valueOnAxis = function(n, d)
{
Something went wrong with that request. Please try again.