Negate the x and y coords of this vector. If false is passed for notify, none of the observers will be called. Sets the x and y coordinates of this vector. Calling this function without a fn will remove all observers. Pass a fn to remove it from the observers list. Calling this method without a function causes it to notify observers.įn signature: function(vec, prev) - where prev is a clone of the vector before the last operation. Supported operationsĪdd an observer fn that will be called whenever this vector changes. Otherwise the operation will be applied to this and this will be returned.Īlso, since Infinityand NaN are so insidious, this library will throw as soon as it detects either of these so you can take action to fix your data/algorithm. If passed a truthy value, a new vector will be returned to you. Stuff to Note: most of the Vec2's methods take a returnNew as the last parameter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |