Vuo  2.0.2
Macros | Typedefs | Functions
VuoPoint2d

Description

A floating-point 2-dimensional Cartesian spatial location.

Typedefs

typedef float __attribute__((ext_vector_type(2))) VuoPoint2d
 A floating-point 2-dimensional Cartesian spatial location. More...
 

Functions

VuoPoint2d VuoPoint2d_makeFromJson (json_object *js)
 
json_objectVuoPoint2d_getJson (const VuoPoint2d value)
 
char * VuoPoint2d_getSummary (const VuoPoint2d value)
 
bool VuoPoint2d_areEqual (const VuoPoint2d value1, const VuoPoint2d value2)
 Returns true if the two points are equal (within tolerance). More...
 
bool VuoPoint2d_isLessThan (const VuoPoint2d a, const VuoPoint2d b)
 Compares a to b primarily by x-value and secondarily by y-value, returning true if a is less than b. More...
 
VuoPoint2d VuoPoint2d_random (const VuoPoint2d minimum, const VuoPoint2d maximum)
 Returns a pseudorandom value where each component is between minimum and maximum. More...
 
VuoPoint2d VuoPoint2d_randomWithState (unsigned short state[3], const VuoPoint2d minimum, const VuoPoint2d maximum)
 Returns a pseudorandom value where each component is between minimum and maximum. More...
 
static VuoPoint2d VuoPoint2d_make (float x, float y) __attribute__((const))
 Returns a point with the specified coordinates. More...
 
static VuoPoint2d VuoPoint2d_makeFromArray (float *f)
 Returns a point using the first 2 elements in the specified array. More...
 
static void VuoPoint2d_setArray (float *f, VuoPoint2d p)
 Sets the first 2 elements in the specified array to the specified point. More...
 
static VuoPoint2d VuoPoint2d_add (VuoPoint2d a, VuoPoint2d b) __attribute__((const))
 a + b. More...
 
static VuoPoint2d VuoPoint2d_subtract (VuoPoint2d a, VuoPoint2d b) __attribute__((const))
 a - b. More...
 
static float VuoPoint2d_squaredMagnitude (VuoPoint2d a) __attribute__((const))
 Returns the squared magnitude of the vector. More...
 
static VuoPoint2d VuoPoint2d_divide (VuoPoint2d a, VuoPoint2d b) __attribute__((const))
 Component-wise division. More...
 
static VuoPoint2d VuoPoint2d_makeNonzero (VuoPoint2d a) __attribute__((const))
 If any component of the value is zero or very close to zero, moves it further from zero (either 0.000001 or -0.000001). More...
 
static float VuoPoint2d_magnitude (VuoPoint2d a) __attribute__((const))
 Returns the magnitude of the vector. More...
 
static VuoPoint2d VuoPoint2d_normalize (VuoPoint2d a) __attribute__((const))
 Returns the normalization of a. More...
 
static VuoPoint2d VuoPoint2d_multiply (VuoPoint2d a, float b) __attribute__((const))
 a * b More...
 
static float VuoPoint2d_dotProduct (VuoPoint2d u, VuoPoint2d v) __attribute__((const))
 Returns the dot product of u, v. More...
 
static float VuoPoint2d_distance (VuoPoint2d a, VuoPoint2d b) __attribute__((const))
 Distance between a and b. More...
 
static VuoPoint2d VuoPoint2d_lerp (VuoPoint2d a, VuoPoint2d b, float t) __attribute__((const))
 Returns a linearly interpolated value between a and b using time t. More...
 
static VuoPoint2d VuoPoint2d_scale (VuoPoint2d a, VuoPoint2d b) __attribute__((const))
 Returns component-wise multiplication of two VuoPoint2d vectors. More...
 
static VuoPoint2d VuoPoint2d_spring (VuoReal timeSinceDrop, VuoPoint2d dropPosition, VuoPoint2d restingPosition, VuoReal period, VuoReal damping)
 Calculates a position along the path of an oscillating spring. More...
 
static VuoPoint2d VuoPoint2d_clamp (VuoPoint2d point, VuoReal limitA, VuoReal limitB)
 Limits point to values between limitA and limitB, inclusive. More...
 
static VuoPoint2d VuoPoint2d_clampn (VuoPoint2d point, VuoPoint2d limitA, VuoPoint2d limitB)
 Limits point to values between limitA and limitB, inclusive. More...
 
static VuoPoint2d VuoPoint2d_bezier3 (VuoPoint2d p0, VuoPoint2d p1, VuoPoint2d p2, VuoPoint2d p3, VuoReal time)
 Calculates a position along a cubic bezier curve. More...
 
static VuoPoint2d VuoPoint2d_snap (VuoPoint2d a, VuoPoint2d center, VuoPoint2d snap)
 Snap value a to the nearest increment of value snap. More...
 
json_objectVuoPoint3d_getJson (const VuoPoint3d value)
 
json_objectVuoPoint4d_getJson (const VuoPoint4d value)
 
VuoPoint2d VuoPoint2d_makeFromString (const char *str)
 Automatically generated function. More...
 
char * VuoPoint2d_getString (const VuoPoint2d value)
 Automatically generated function. More...
 
void VuoPoint2d_retain (VuoPoint2d value)
 Automatically generated function. More...
 
void VuoPoint2d_release (VuoPoint2d value)
 Automatically generated function. More...
 

Typedef Documentation

◆ __attribute__

static void __attribute__

A floating-point 2-dimensional Cartesian spatial location.

Initializes VuoGlShaderPool_semaphore.

Shaders, keyed by type (vertex, fragment, ...) and source code hash.

The reference count for each OpenGL Buffer Object.

Definition at line 31 of file VuoPoint2d.h.

Function Documentation

◆ VuoPoint2d_add()

static VuoPoint2d VuoPoint2d_add ( VuoPoint2d  a,
VuoPoint2d  b 
) const
inlinestatic

a + b.

Definition at line 88 of file VuoPoint2d.h.

◆ VuoPoint2d_areEqual()

bool VuoPoint2d_areEqual ( const VuoPoint2d  value1,
const VuoPoint2d  value2 
)

Returns true if the two points are equal (within tolerance).

Definition at line 106 of file VuoPoint2d.c.

◆ VuoPoint2d_bezier3()

static VuoPoint2d VuoPoint2d_bezier3 ( VuoPoint2d  p0,
VuoPoint2d  p1,
VuoPoint2d  p2,
VuoPoint2d  p3,
VuoReal  time 
)
inlinestatic

Calculates a position along a cubic bezier curve.

Parameters
p0The curve's starting position.
p1The control point for the curve's starting position.
p2The control point for the curve's ending position.
p3The curve's ending position.
timeWhich value along the curve should be returned. 0 = starting position, 1 = ending position.

Definition at line 239 of file VuoPoint2d.h.

◆ VuoPoint2d_clamp()

static VuoPoint2d VuoPoint2d_clamp ( VuoPoint2d  point,
VuoReal  limitA,
VuoReal  limitB 
)
inlinestatic

Limits point to values between limitA and limitB, inclusive.

Definition at line 211 of file VuoPoint2d.h.

◆ VuoPoint2d_clampn()

static VuoPoint2d VuoPoint2d_clampn ( VuoPoint2d  point,
VuoPoint2d  limitA,
VuoPoint2d  limitB 
)
inlinestatic

Limits point to values between limitA and limitB, inclusive.

Definition at line 222 of file VuoPoint2d.h.

◆ VuoPoint2d_distance()

static float VuoPoint2d_distance ( VuoPoint2d  a,
VuoPoint2d  b 
) const
inlinestatic

Distance between a and b.

Definition at line 174 of file VuoPoint2d.h.

◆ VuoPoint2d_divide()

static VuoPoint2d VuoPoint2d_divide ( VuoPoint2d  a,
VuoPoint2d  b 
) const
inlinestatic

Component-wise division.

Definition at line 116 of file VuoPoint2d.h.

◆ VuoPoint2d_dotProduct()

static float VuoPoint2d_dotProduct ( VuoPoint2d  u,
VuoPoint2d  v 
) const
inlinestatic

Returns the dot product of u, v.

Definition at line 165 of file VuoPoint2d.h.

◆ VuoPoint2d_getJson()

struct json_object * VuoPoint2d_getJson ( const VuoPoint2d  value)

Encodes value as a JSON object.

Definition at line 81 of file VuoPoint2d.c.

◆ VuoPoint2d_getString()

char* VuoPoint2d_getString ( const VuoPoint2d  value)

Automatically generated function.

◆ VuoPoint2d_getSummary()

char * VuoPoint2d_getSummary ( const VuoPoint2d  value)

Returns a compact string representation of value (comma-separated coordinates).

Definition at line 98 of file VuoPoint2d.c.

◆ VuoPoint2d_isLessThan()

bool VuoPoint2d_isLessThan ( const VuoPoint2d  a,
const VuoPoint2d  b 
)

Compares a to b primarily by x-value and secondarily by y-value, returning true if a is less than b.

Changed in Vuo 2.0.0:
New.

Definition at line 118 of file VuoPoint2d.c.

◆ VuoPoint2d_lerp()

static VuoPoint2d VuoPoint2d_lerp ( VuoPoint2d  a,
VuoPoint2d  b,
float  t 
) const
inlinestatic

Returns a linearly interpolated value between a and b using time t.

t is between 0 and 1.

Definition at line 183 of file VuoPoint2d.h.

◆ VuoPoint2d_magnitude()

static float VuoPoint2d_magnitude ( VuoPoint2d  a) const
inlinestatic

Returns the magnitude of the vector.

Definition at line 138 of file VuoPoint2d.h.

◆ VuoPoint2d_make()

static VuoPoint2d VuoPoint2d_make ( float  x,
float  y 
) const
inlinestatic

Returns a point with the specified coordinates.

Changed in Vuo 2.0.0:
New.

Definition at line 60 of file VuoPoint2d.h.

◆ VuoPoint2d_makeFromArray()

static VuoPoint2d VuoPoint2d_makeFromArray ( float *  f)
inlinestatic

Returns a point using the first 2 elements in the specified array.

Changed in Vuo 2.0.0:
New.

Definition at line 70 of file VuoPoint2d.h.

◆ VuoPoint2d_makeFromJson()

VuoPoint2d VuoPoint2d_makeFromJson ( json_object js)

Decodes the JSON object js to create a new value.

Example:
{
"x" : 0.5,
"y" : 1
}

Definition at line 40 of file VuoPoint2d.c.

◆ VuoPoint2d_makeFromString()

VuoPoint2d VuoPoint2d_makeFromString ( const char *  str)

Automatically generated function.

◆ VuoPoint2d_makeNonzero()

static VuoPoint2d VuoPoint2d_makeNonzero ( VuoPoint2d  a) const
inlinestatic

If any component of the value is zero or very close to zero, moves it further from zero (either 0.000001 or -0.000001).

Definition at line 125 of file VuoPoint2d.h.

◆ VuoPoint2d_multiply()

static VuoPoint2d VuoPoint2d_multiply ( VuoPoint2d  a,
float  b 
) const
inlinestatic

a * b

Definition at line 156 of file VuoPoint2d.h.

◆ VuoPoint2d_normalize()

static VuoPoint2d VuoPoint2d_normalize ( VuoPoint2d  a) const
inlinestatic

Returns the normalization of a.

Definition at line 147 of file VuoPoint2d.h.

◆ VuoPoint2d_random()

VuoPoint2d VuoPoint2d_random ( const VuoPoint2d  minimum,
const VuoPoint2d  maximum 
)

Returns a pseudorandom value where each component is between minimum and maximum.

See also
VuoInteger_random

Definition at line 130 of file VuoPoint2d.c.

◆ VuoPoint2d_randomWithState()

VuoPoint2d VuoPoint2d_randomWithState ( unsigned short  state[3],
const VuoPoint2d  minimum,
const VuoPoint2d  maximum 
)

Returns a pseudorandom value where each component is between minimum and maximum.

See also
VuoInteger_randomWithState

Definition at line 142 of file VuoPoint2d.c.

◆ VuoPoint2d_release()

void VuoPoint2d_release ( VuoPoint2d  value)

Automatically generated function.

◆ VuoPoint2d_retain()

void VuoPoint2d_retain ( VuoPoint2d  value)

Automatically generated function.

◆ VuoPoint2d_scale()

static VuoPoint2d VuoPoint2d_scale ( VuoPoint2d  a,
VuoPoint2d  b 
) const
inlinestatic

Returns component-wise multiplication of two VuoPoint2d vectors.

Definition at line 192 of file VuoPoint2d.h.

◆ VuoPoint2d_setArray()

static void VuoPoint2d_setArray ( float *  f,
VuoPoint2d  p 
)
inlinestatic

Sets the first 2 elements in the specified array to the specified point.

Definition at line 78 of file VuoPoint2d.h.

◆ VuoPoint2d_snap()

static VuoPoint2d VuoPoint2d_snap ( VuoPoint2d  a,
VuoPoint2d  center,
VuoPoint2d  snap 
)
inlinestatic

Snap value a to the nearest increment of value snap.

Definition at line 250 of file VuoPoint2d.h.

◆ VuoPoint2d_spring()

static VuoPoint2d VuoPoint2d_spring ( VuoReal  timeSinceDrop,
VuoPoint2d  dropPosition,
VuoPoint2d  restingPosition,
VuoReal  period,
VuoReal  damping 
)
inlinestatic

Calculates a position along the path of an oscillating spring.

Definition at line 200 of file VuoPoint2d.h.

◆ VuoPoint2d_squaredMagnitude()

static float VuoPoint2d_squaredMagnitude ( VuoPoint2d  a) const
inlinestatic

Returns the squared magnitude of the vector.

Definition at line 107 of file VuoPoint2d.h.

◆ VuoPoint2d_subtract()

static VuoPoint2d VuoPoint2d_subtract ( VuoPoint2d  a,
VuoPoint2d  b 
) const
inlinestatic

a - b.

Definition at line 97 of file VuoPoint2d.h.

◆ VuoPoint3d_getJson()

json_object* VuoPoint3d_getJson ( const VuoPoint3d  value)

Encodes value as a JSON object.

Definition at line 90 of file VuoPoint3d.c.

◆ VuoPoint4d_getJson()

json_object* VuoPoint4d_getJson ( const VuoPoint4d  value)

Encodes value as a JSON object.

Definition at line 98 of file VuoPoint4d.c.