default
tkmath
tkmathtkmath.Vector4fadd(Vector4f v) - Add vector or array-like object
addf(float v) - Add scalar value to all components
bilinearQuadPos() - Calc interpolated quad position from normalized (0..1) coordinates (0;0=left/top)
clamp(float l) - Clamp to length
distanceToPlane(Vector4f q, n) : float - Calc distance of vertex to plane defined by Vector4f q (on plane) and plane normal n
distanceToSphere(Vector4f p, float radius) : float - Calc distance of vertex to sphere defined by Vector4f p (sphere center) and sphere radius.
divw() - Divide by W and return Vector3f
divz() - Divide by Z and return Vector2f
dot(Vector4f v) : float - Calculate scalar dot product from this instance and v
getAbs() : float - Return length of vector
getAbsSqr() : float - Return squared length of vector
getString() : String - Get string representation of vector (x, y, z, w)
getW() : float - Get value of w element
getX() : float - Get value of x element
getXy() : float - Get xy Vector2f
getXyz() : float - Get xyz Vector3f
getXz() : float - Get xz Vector2f
getY() : float - Get value of y element
getYz() : float - Get yz Vector2f
getZ() : float - Get value of z element
init(float x, y, z, w) - Initialize vector from scalars
initScalef(Vector4f v, float s) - Initialise vector to s*v
intersectPlane(Vector4f q, n, p1, p2) : boolean - Calc intersection between line (p1->p2) and plane (q,n).
isWithinSphere(Vector4f p, float radiusSquared) : boolean - Check if vertex is located within sphere defined by Vector4f p (sphere center) and squared sphere radius 'radiusSquared'.
lerp(Vector4f o) - Linear interpolate to another vector
mul(Vector4f v) - Multiply the x element of this instance by the x element of v and do the same with the y, z and w elements
mulf(float v) - Multiply this instance by scalar value v
New(float x, y, z, w) : Vector4f - Initialize and return new Vector4f instance
project() - Convert clip to window coordinates
rotate(Matrix4f m) - Multiply matrix by this vector and replace this vector by the result
setW(float a) - Set w element to a
setX(float a) - Set x element to a
setY(float a) - Set y element to a
setZ(float a) - Set z element to a
sub(Vector4f v) - Substract vector or array-like object
tensor(Vector4f v) : Matrix4f - Create resulting matrix of tensor product from this instance and v
transform(Matrix4f m) - Multiply matrix by this vector
unit() - Set length to 1
unitScale(float s) - Set length to sMethod add | |||||
Add vector or array-like object | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method addf | |||||
Add scalar value to all components | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method bilinearQuadPos | |||
Calc interpolated quad position from normalized (0..1) coordinates (0;0=left/top) | |||
Signature | |||
|
Method clamp | |||||
Clamp to length | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method distanceToPlane | |||
Calc distance of vertex to plane defined by Vector4f q (on plane) and plane normal n | |||
Signature | |||
Arguments | |||
Returns | |||
|
Method distanceToSphere | ||||||||||||||||||||
Calc distance of vertex to sphere defined by Vector4f p (sphere center) and sphere radius. | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Method divw | |||
Divide by W and return Vector3f | |||
Signature | |||
|
Method divz | |||
Divide by Z and return Vector2f | |||
Signature | |||
|
Method dot | ||||||||||
Calculate scalar dot product from this instance and v | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method getAbs | |||||
Return length of vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getAbsSqr | |||||
Return squared length of vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getString | |||||
Get string representation of vector (x, y, z, w) | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getW | |||||
Get value of w element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getX | |||||
Get value of x element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getXy | |||||
Get xy Vector2f | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getXyz | |||||
Get xyz Vector3f | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getXz | |||||
Get xz Vector2f | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getY | |||||
Get value of y element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getYz | |||||
Get yz Vector2f | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getZ | |||||
Get value of z element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method init | |||||||||||||||||||||||||
Initialize vector from scalars | |||||||||||||||||||||||||
Signature | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
Arguments | |||||||||||||||||||||||||
|
Method initScalef | |||||||||||||||
Initialise vector to s*v | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
|
Method intersectPlane | |||
Calc intersection between line (p1->p2) and plane (q,n). | |||
Signature | |||
Arguments | |||
Returns | |||
|
Method isWithinSphere | ||||||||||||||||||||
Check if vertex is located within sphere defined by Vector4f p (sphere center) and squared sphere radius 'radiusSquared'. | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Method lerp | |||||
Linear interpolate to another vector | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method mul | |||||
Multiply the x element of this instance by the x element of v and do the same with the y, z and w elements | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method mulf | |||||
Multiply this instance by scalar value v | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method New | ||||||||||||||||||||||||||||||
Initialize and return new Vector4f instance | ||||||||||||||||||||||||||||||
Signature | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
Arguments | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
Returns | ||||||||||||||||||||||||||||||
Method project | |||
Convert clip to window coordinates | |||
Signature | |||
|
Method rotate | |||||
Multiply matrix by this vector and replace this vector by the result | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
This is a convenience method to remove the need for temporary Vector4f variables in scripts (the temporary is created on the stack instead). |
Method setW | |||||
Set w element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setX | |||||
Set x element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setY | |||||
Set y element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setZ | |||||
Set z element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method sub | |||||
Substract vector or array-like object | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method tensor | ||||
Create resulting matrix of tensor product from this instance and v | ||||
Signature | ||||
Arguments | ||||
| ||||
Returns | ||||
|
Method unit | |||
Set length to 1 | |||
Signature | |||
|
Method unitScale | |||||
Set length to s | |||||
Signature | |||||
| |||||
Arguments | |||||
|
auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:42:00