summaryrefslogtreecommitdiff
path: root/vector.mod
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-09-03 01:19:47 +0000
committerIan C <ianc@noddybox.co.uk>2005-09-03 01:19:47 +0000
commit1e5cf011817cca02b53ed7858a00210e7ad58614 (patch)
tree45894cbf94f01078094826658cc841470d4eaae6 /vector.mod
parent1be87e5a237c2dde8fff2fa864e504d2a3360dd6 (diff)
Added SetLength()
Diffstat (limited to 'vector.mod')
-rw-r--r--vector.mod/vector.bmx9
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)