Skip to content

Commit 30ea43b

Browse files
committed
Vector4 missing methods
1 parent 8bccacc commit 30ea43b

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

elements/Vector/Vector4.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,123 @@ oop_only_methods:
2424
optional: true
2525
description: If vectorOrX is a float, this is the W coordinate
2626

27+
- name: dot
28+
type: method
29+
description: |
30+
Calculates the dot (scalar) product of two vectors.
31+
signature: float Vector4:dot ( Vector4 vector )
32+
parameters:
33+
- name: vector
34+
type: Vector4
35+
description: Vector to calculate the dot product with.
36+
returns:
37+
type: float
38+
description: The scalar dot product.
39+
40+
- name: getX
41+
type: method
42+
description: Returns the X component of the vector.
43+
signature: float Vector4:getX ( )
44+
returns:
45+
type: float
46+
description: The X coordinate.
47+
48+
- name: setX
49+
type: method
50+
description: Sets the X component of the vector.
51+
signature: nil Vector4:setX ( float x )
52+
parameters:
53+
- name: x
54+
type: float
55+
description: The new X value.
56+
57+
- name: getY
58+
type: method
59+
description: Returns the Y component of the vector.
60+
signature: float Vector4:getY ( )
61+
returns:
62+
type: float
63+
description: The Y coordinate.
64+
65+
- name: setY
66+
type: method
67+
description: Sets the Y component of the vector.
68+
signature: nil Vector4:setY ( float y )
69+
parameters:
70+
- name: "y"
71+
type: float
72+
description: The new Y value.
73+
74+
- name: getZ
75+
type: method
76+
description: Returns the Z component of the vector.
77+
signature: float Vector4:getZ ( )
78+
returns:
79+
type: float
80+
description: The Z coordinate.
81+
82+
- name: setZ
83+
type: method
84+
description: Sets the Z component of the vector.
85+
signature: nil Vector4:setZ ( float z )
86+
parameters:
87+
- name: z
88+
type: float
89+
description: The new Z value.
90+
91+
- name: getW
92+
type: method
93+
description: Returns the W component of the vector.
94+
signature: float Vector4:getW ( )
95+
returns:
96+
type: float
97+
description: The W coordinate.
98+
99+
- name: setW
100+
type: method
101+
description: Sets the W component of the vector.
102+
signature: nil Vector4:setW ( float w )
103+
parameters:
104+
- name: w
105+
type: float
106+
description: The new W value.
107+
108+
- name: normalize
109+
type: method
110+
description: |
111+
Normalizes the vector to a unit vector (length of 1). Modifies the original vector.
112+
signature: bool Vector4:normalize ( )
113+
returns:
114+
type: bool
115+
description: Whether the operation succeeded (e.g., the vector was not zero-length).
116+
117+
- name: getNormalized
118+
type: method
119+
description: |
120+
Returns a normalized version of the vector without modifying the original.
121+
signature: Vector4 Vector4:getNormalized ( )
122+
returns:
123+
type: Vector4
124+
description: A new normalized vector.
125+
126+
- name: getLength
127+
type: method
128+
description: |
129+
Returns the length (magnitude) of the vector.
130+
signature: float Vector4:getLength ( )
131+
returns:
132+
type: float
133+
description: The vector's length.
134+
135+
- name: getSquaredLength
136+
type: method
137+
description: |
138+
Returns the squared length of the vector (useful to anil square root operations).
139+
signature: float Vector4:getSquaredLength ( )
140+
returns:
141+
type: float
142+
description: The squared length of the vector.
143+
27144
examples:
28145
- path: examples/vector4-1.lua
29146
description: This example adds a command called "/garage", allowing you to get any garage bounding box.

0 commit comments

Comments
 (0)