graphene.vec2
Module for [Vec2] class
class Vec2
Types 1
classVec2 : gobject.boxed.Boxed
A structure capable of holding a vector with two dimensions, x and y.
The contents of the #graphene_vec2_t structure are private and should never be accessed directly.
Methods
void add(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowAdds each component of the two passed vectors and places each result into the components of res.void divide(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowDivides each component of the first operand `a` by the corresponding component of the second operand `b`, and places the results into the vector res.float getX() nothrowRetrieves the X component of the #graphene_vec2_t. Returns: the value of the X componentfloat getY() nothrowRetrieves the Y component of the #graphene_vec2_t. Returns: the value of the Y componentgraphene.vec2.Vec2 init_(float x, float y) nothrowInitializes a #graphene_vec2_t using the given values.graphene.vec2.Vec2 initFromFloat(float[] src) nothrowInitializes `v` with the contents of the given array.void interpolate(graphene.vec2.Vec2 v2, double factor, out graphene.vec2.Vec2 res) nothrowLinearly interpolates v1 and v2 using the given factor.void max(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowCompares the two given vectors and places the maximum values of each component into res.void min(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowCompares the two given vectors and places the minimum values of each component into res.void multiply(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowMultiplies each component of the two passed vectors and places each result into the components of res.bool near(graphene.vec2.Vec2 v2, float epsilon) nothrowCompares the two given #graphene_vec2_t vectors and checks whether their values are within the given epsilon.void normalize(out graphene.vec2.Vec2 res) nothrowComputes the normalized vector for the given vector `v`.void scale(float factor, out graphene.vec2.Vec2 res) nothrowMultiplies all components of the given vector with the given scalar factor.void subtract(graphene.vec2.Vec2 b, out graphene.vec2.Vec2 res) nothrowSubtracts from each component of the first operand `a` the corresponding component of the second operand `b` and places each result into the components of res.graphene.vec2.Vec2 one() static nothrowRetrieves a constant vector with (1, 1) components. Returns: the one vectorgraphene.vec2.Vec2 xAxis() static nothrowRetrieves a constant vector with (1, 0) components. Returns: the X axis vectorgraphene.vec2.Vec2 yAxis() static nothrowRetrieves a constant vector with (0, 1) components. Returns: the Y axis vectorgraphene.vec2.Vec2 zero() static nothrowRetrieves a constant vector with (0, 0) components. Returns: the zero vector