Vec4#
- class Vec4(*args, **kwargs)#
A structure capable of holding a vector with four dimensions: x, y, z, and w.
The contents of the Vec4 structure are private and should
never be accessed directly.
Constructors#
Methods#
- class Vec4
- add(b: Vec4) Vec4#
- Adds each component of the two given vectors. - Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - divide(b: Vec4) Vec4#
- Divides each component of the first operand - aby the corresponding component of the second operand- b, and places the results into the vector- res.- Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - dot(b: Vec4) float#
- Computes the dot product of the two given vectors. - Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - equal(v2: Vec4) bool#
- Checks whether the two given - Vec4are equal.- Added in version 1.2. - Parameters:
- v2 – a - Vec4
 
 - get_xy() Vec2#
- Creates a - Vec2that contains the first two components of the given- Vec4.- Added in version 1.0. 
 - get_xyz() Vec3#
- Creates a - Vec3that contains the first three components of the given- Vec4.- Added in version 1.0. 
 - init(x: float, y: float, z: float, w: float) Vec4#
- Initializes a - Vec4using the given values.- This function can be called multiple times. - Added in version 1.0. - Parameters:
- x – the X field of the vector 
- y – the Y field of the vector 
- z – the Z field of the vector 
- w – the W field of the vector 
 
 
 - init_from_float(src: list[float]) Vec4#
- Initializes a - Vec4with the values inside the given array.- Added in version 1.0. - Parameters:
- src – an array of four floating point values 
 
 - init_from_vec2(src: Vec2, z: float, w: float) Vec4#
- Initializes a - Vec4using the components of a- Vec2and the values of- zand- w.- Added in version 1.0. - Parameters:
- src – a - Vec2
- z – the value for the third component of - v
- w – the value for the fourth component of - v
 
 
 - init_from_vec3(src: Vec3, w: float) Vec4#
- Initializes a - Vec4using the components of a- Vec3and the value of- w.- Added in version 1.0. - Parameters:
- src – a - Vec3
- w – the value for the fourth component of - v
 
 
 - init_from_vec4(src: Vec4) Vec4#
- Initializes a - Vec4using the components of another- Vec4.- Added in version 1.0. - Parameters:
- src – a - Vec4
 
 - interpolate(v2: Vec4, factor: float) Vec4#
- Linearly interpolates - v1and- v2using the given- factor.- Added in version 1.10. - Parameters:
- v2 – a - Vec4
- factor – the interpolation factor 
 
 
 - max(b: Vec4) Vec4#
- Compares each component of the two given vectors and creates a vector that contains the maximum values. - Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - min(b: Vec4) Vec4#
- Compares each component of the two given vectors and creates a vector that contains the minimum values. - Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - multiply(b: Vec4) Vec4#
- Multiplies each component of the two given vectors. - Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - near(v2: Vec4, epsilon: float) bool#
- Compares the two given - Vec4vectors and checks whether their values are within the given- epsilon.- Added in version 1.2. - Parameters:
- v2 – a - Vec4
- epsilon – the threshold between the two vectors 
 
 
 - classmethod one() Vec4#
- Retrieves a pointer to a - Vec4with all its components set to 1.- Added in version 1.0. 
 - scale(factor: float) Vec4#
- Multiplies all components of the given vector with the given scalar - factor.- Added in version 1.2. - Parameters:
- factor – the scalar factor 
 
 - subtract(b: Vec4) Vec4#
- Subtracts from each component of the first operand - athe corresponding component of the second operand- band places each result into the components of- res.- Added in version 1.0. - Parameters:
- b – a - Vec4
 
 - to_float() list[float]#
- Stores the components of the given - Vec4into an array of floating point values.- Added in version 1.0. 
 - classmethod w_axis() Vec4#
- Retrieves a pointer to a - Vec4with its components set to (0, 0, 0, 1).- Added in version 1.0. 
 - classmethod x_axis() Vec4#
- Retrieves a pointer to a - Vec4with its components set to (1, 0, 0, 0).- Added in version 1.0. 
 - classmethod y_axis() Vec4#
- Retrieves a pointer to a - Vec4with its components set to (0, 1, 0, 0).- Added in version 1.0. 
 
Fields#
- class Vec4
- value#