# HG changeset patch # User postspectacular # Date 1326688006 0 # Node ID 41c8859a9c9b4eae0ebfd7908202fac878e18fc7 # Parent 7cba972224d41034ef0a648a0985298b748fda8a adding Ray2D/3D.setNormalizedDirection() for pre-normalized vectors diff -r 7cba972224d41034ef0a648a0985298b748fda8a -r 41c8859a9c9b4eae0ebfd7908202fac878e18fc7 src.core/toxi/geom/Ray2D.java --- a/src.core/toxi/geom/Ray2D.java Mon Jan 16 04:26:04 2012 +0000 +++ b/src.core/toxi/geom/Ray2D.java Mon Jan 16 04:26:46 2012 +0000 @@ -91,6 +91,11 @@ return this; } + public Ray2D setNormalizedDirection(ReadonlyVec2D d) { + dir.set(d); + return this; + } + /** * Converts the ray into a 2D Line segment with its start point coinciding * with the ray origin and its other end point at the given distance along diff -r 7cba972224d41034ef0a648a0985298b748fda8a -r 41c8859a9c9b4eae0ebfd7908202fac878e18fc7 src.core/toxi/geom/Ray3D.java --- a/src.core/toxi/geom/Ray3D.java Mon Jan 16 04:26:04 2012 +0000 +++ b/src.core/toxi/geom/Ray3D.java Mon Jan 16 04:26:46 2012 +0000 @@ -98,6 +98,11 @@ return this; } + public Ray3D setNormalizedDirection(ReadonlyVec3D d) { + dir.set(d); + return this; + } + /** * Converts the ray into a 3D Line segment with its start point coinciding * with the ray origin and its other end point at the given distance along