From 1e5cf011817cca02b53ed7858a00210e7ad58614 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 3 Sep 2005 01:19:47 +0000 Subject: Added SetLength() --- vector.mod/vector.bmx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vector.mod/vector.bmx b/vector.mod/vector.bmx index 264f300..f32035b 100644 --- a/vector.mod/vector.bmx +++ b/vector.mod/vector.bmx @@ -25,7 +25,7 @@ Type TVector ' ' Returns null for invalid parameters. ' - Function Create:TVector(dx:Float, dy:Float, dz:Float) + Function Create:TVector(dx:Float=0.0, dy:Float=0.0, dz:Float=0.0) Local o:TVector o=New TVector @@ -64,6 +64,13 @@ Type TVector EndIf End Method + ' Set the vector to a length + ' + Method SetLength(sc:Float) + Normalise() + Scale(sc) + End Method + ' Add a scalar to the vector ' Method AddScalar(sc:Float) -- cgit v1.2.3