Constants

Details

Graphene.PI = 3.141593
Graphene.PI_2 = 1.570796
Graphene.VEC2_LEN = 2

Evaluates to the number of components of a Graphene.Vec2.

This symbol is useful when declaring a C array of floating point values to be used with Graphene.Vec2.init_from_float() and Graphene.Vec2.to_float(), e.g.

float v[GRAPHENE_VEC2_LEN];

// vec is defined elsewhere
graphene_vec2_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC2_LEN; i++)
  fprintf (stdout, "component %d: %g\n", i, v[i]);

New in version 1.0.

Graphene.VEC3_LEN = 3

Evaluates to the number of components of a Graphene.Vec3.

This symbol is useful when declaring a C array of floating point values to be used with Graphene.Vec3.init_from_float() and Graphene.Vec3.to_float(), e.g.

float v[GRAPHENE_VEC3_LEN];

// vec is defined elsewhere
graphene_vec3_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC2_LEN; i++)
  fprintf (stdout, "component %d: %g\n", i, v[i]);

New in version 1.0.

Graphene.VEC4_LEN = 4

Evaluates to the number of components of a Graphene.Vec4.

This symbol is useful when declaring a C array of floating point values to be used with Graphene.Vec4.init_from_float() and Graphene.Vec4.to_float(), e.g.

float v[GRAPHENE_VEC4_LEN];

// vec is defined elsewhere
graphene_vec4_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC4_LEN; i++)
  fprintf (stdout, "component %d: %g\n", i, v[i]);

New in version 1.0.