Module vector3

Module vector3 

Source

Functions§

free_vector_components
Free memory of an array of vector components at the given address.
free_vector_memory
Free memory at the address of the vector pointer.
new_vector3
Initialize a 3-vector from raw components and retrieve the C pointer to its address.
normalize_vector
Normalizes an existing vector stored at the address of a pointer (vec_ptr)
scale_vector
Scales an existing vector stored at the address of a pointer (vec_ptr) by a float factor
vector_add
Adds two vectors and returns a pointer to the memory of the result
vector_cross_product
Computes the cross product of two vectors and returns a pointer to the memory of the result
vector_dot_product
Computes the dot product of two vectors
vector_get_components
Get the components of a vector as a list of C doubles, the order of the components will be (x, y, z).
vector_get_normalized
Initializes a normalized copy of a vector stored at the address of a pointer (vec_ptr) and returns a pointer to the memory of the result
vector_get_scaled
Initializes a scaled copy of a vector stored at the address of a pointer (vec_ptr) and returns a pointer to the memory of the result
vector_set_x
Set the x component of an existing vector stored at the address of a pointer.
vector_set_y
Set the y component of an existing vector stored at the address of a pointer.
vector_set_z
Set the z component of an existing vector stored at the address of a pointer.
vector_subtract
Subtracts two vectors and returns a pointer to the memory of the result