{"id":6919,"date":"2014-05-11T17:45:18","date_gmt":"2014-05-11T17:45:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/multiplying-a-vector2-by-a-scalar-libgdx-collection-of-common-programming-errors\/"},"modified":"2014-05-11T17:45:18","modified_gmt":"2014-05-11T17:45:18","slug":"multiplying-a-vector2-by-a-scalar-libgdx-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/multiplying-a-vector2-by-a-scalar-libgdx-collection-of-common-programming-errors\/","title":{"rendered":"Multiplying a Vector2 by a Scalar (LibGDX)-Collection of common programming errors"},"content":{"rendered":"<p>I am attempting to multiply the type &#8220;Vector2&#8221; by a scalar of value delta and type float. Information on the type Vector2 can be found here:<\/p>\n<p>http:\/\/libgdx.badlogicgames.com\/nightlies\/docs\/api\/com\/badlogic\/gdx\/math\/class-use\/Vector2.html<\/p>\n<p>Specifically on that page, I am referencing:<\/p>\n<p>Vector2 &#8212; Vector2.scl(float scalar) Multiplies this vector by a scalar<\/p>\n<p>position is a Vector2 velocity is a Vector2<\/p>\n<p>I am being given the error: &#8220;The method scl(float) is undefined for the type Vector2&#8221;<\/p>\n<pre><code>public void update(float delta) {\n    position.add(velocity.cpy()).scl(delta); \n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I am attempting to multiply the type &#8220;Vector2&#8221; by a scalar of value delta and type float. Information on the type Vector2 can be found here: http:\/\/libgdx.badlogicgames.com\/nightlies\/docs\/api\/com\/badlogic\/gdx\/math\/class-use\/Vector2.html Specifically on that page, I am referencing: Vector2 &#8212; Vector2.scl(float scalar) Multiplies this vector by a scalar position is a Vector2 velocity is a Vector2 I am being [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6919","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6919"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6919\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}