diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-09-03 01:19:47 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-09-03 01:19:47 +0000 |
commit | 1e5cf011817cca02b53ed7858a00210e7ad58614 (patch) | |
tree | 45894cbf94f01078094826658cc841470d4eaae6 /vector.mod/vector.bmx | |
parent | 1be87e5a237c2dde8fff2fa864e504d2a3360dd6 (diff) |
Added SetLength()
Diffstat (limited to 'vector.mod/vector.bmx')
-rw-r--r-- | vector.mod/vector.bmx | 9 |
1 files changed, 8 insertions, 1 deletions
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) |