Skip to content

Commit

Permalink
Update nShift function
Browse files Browse the repository at this point in the history
  • Loading branch information
Smilebags committed Mar 3, 2017
1 parent 7df2dbc commit 37cc1b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/p5.dimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,12 @@ interface nMatrix {
};
p5.prototype.nObject = nObject;

function nShift(object, forces) {
if (forces.length != object.dimension) {
function nShift(object:nObject, forces:nVector) {
if (forces.dimension() != object.dimension) {
throw "P5JS ERROR: You have too many dimensional movements!"
} else {
for (var n = 0; n < object.vertices.length; n++) {
for (var i = 0; i < forces.length; i++) {
for (var i = 0; i < forces.dimension(); i++) {
object.vertices[n][dimensionalSymbols[i]] += forces[i]
}
}
Expand Down

0 comments on commit 37cc1b9

Please sign in to comment.