| sdleiF | ||
| float length RO | length | |
| string toString RO | textual form | |
| Vector toVector RO | vector of [x,y,z] | |
| float x | x | |
| float y | y | |
| float z | z | |
| snoitcnuF | ||
| function add(XYZ)doesn't return a value | addNote: it does not return a new object, just modifies the existing one | |
| function clone RO()returns XYZ | create new XYZ object copying the coordinatesNote: copying object references does not create new objects. Use clone() if a new object is needed. Example: var o1=(1,2,3), o2=o1, o3=o1.clone(); o1.y=9999; //o2 is now (1,9999,3) but o3 is still (1,2,3) | |
| function get RO(int index)returns float | get one of coordinatesthis function makes the XYZ objects "indexable" (so you can use [] for accessing subsequent fields, like in Vector) | |
| function new(float x, float y, float z)returns XYZ | create new XYZ object3D vectors objects can be also created using the (x,y,z) notation, i.e. var v=(1,2,3) is the same as var v=XYZ.new(1,2,3); | |
| function newFromVector(Vector)returns XYZ | create new XYZ objectused for deserialization | |
| function normalize()doesn't return a value | normalizescales the vector length to 1.0 | |
| function revRotate(Orient)doesn't return a value | reverse rotate using Orient object | |
| function rotate(Orient)doesn't return a value | rotate using Orient object | |
| function scale(float)doesn't return a value | multiply by scalar | |
| function set(XYZ)doesn't return a value | set (copy) coordinates from another XYZ object | |
| function set3(float x, float y, float z)doesn't return a value | set individual 3 coordinates | |
| function sub(XYZ)doesn't return a value | subtractNote: it does not return a new object, just modifies the existing one | |
| Global context |