Vuo  2.0.0
Classes | Macros | Typedefs | Functions
VuoPoint3d

Description

A floating-point 3-dimensional Cartesian spatial location.

Classes

struct  VuoBox
 Defines a bounding box. More...
 

Typedefs

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

Functions

VuoPoint3d VuoPoint3d_makeFromJson (json_object *js)
 
char * VuoPoint3d_getSummary (const VuoPoint3d value)
 
struct json_objectVuoPoint3d_getJson (const VuoPoint3d value)
 
bool VuoPoint3d_areEqual (const VuoPoint3d value1, const VuoPoint3d value2)
 Returns true if the two points are equal (within tolerance). More...
 
bool VuoPoint3d_isLessThan (const VuoPoint3d a, const VuoPoint3d b)
 Compares a to b primarily by x-value, secondarily by y-value, and finally by z-value, returning true if a is less than b. More...
 
VuoPoint3d VuoPoint3d_random (const VuoPoint3d minimum, const VuoPoint3d maximum)
 Returns a pseudorandom value where each component is between minimum and maximum. More...
 
VuoPoint3d VuoPoint3d_randomWithState (unsigned short state[3], const VuoPoint3d minimum, const VuoPoint3d maximum)
 Returns a pseudorandom value where each component is between minimum and maximum. More...
 
static VuoPoint3d VuoPoint3d_make (float x, float y, float z) __attribute__((const))
 Returns a point with the specified coordinates. More...
 
static VuoBox VuoBox_make (VuoPoint3d center, VuoPoint3d size) __attribute__((const))
 Returns a box with the specified center and size. More...
 
static VuoBox VuoBox_makeWithPoints (float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) __attribute__((const))
 Returns an axis aligned bounding box with the specified min and max coordinates. More...
 
static VuoPoint3d VuoPoint3d_crossProduct (VuoPoint3d u, VuoPoint3d v) __attribute__((const))
 Returns the cross-product of u and v. More...
 
static float VuoPoint3d_dotProduct (VuoPoint3d u, VuoPoint3d v) __attribute__((const))
 Returns the dot product of u, v. More...
 
static float VuoPoint3d_magnitude (VuoPoint3d a) __attribute__((const))
 Returns the magnitude of the vector. More...
 
static VuoPoint3d VuoPoint3d_normalize (VuoPoint3d a) __attribute__((const))
 Returns the normalization of a. More...
 
static VuoPoint3d VuoPoint3d_add (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 a + b. More...
 
static VuoPoint3d VuoPoint3d_subtract (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 a - b. More...
 
static float VuoPoint3d_squaredMagnitude (VuoPoint3d a) __attribute__((const))
 Returns the magnitude of the vector. More...
 
static VuoPoint3d VuoPoint3d_divide (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 Component-wise division. More...
 
static VuoPoint3d VuoPoint3d_multiply (VuoPoint3d a, float b) __attribute__((const))
 a * b More...
 
static VuoPoint3d VuoPoint3d_makeNonzero (VuoPoint3d 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 VuoPoint3d_distance (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 Distance between a and b. More...
 
static VuoPoint3d VuoPoint3d_lerp (VuoPoint3d a, VuoPoint3d b, float t) __attribute__((const))
 Returns a linearly interpolated value between a and b using time t. More...
 
static VuoPoint3d VuoPoint3d_scale (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 Returns component-wise multiplication of two VuoPoint3d vectors. More...
 
static VuoPoint3d VuoPoint3d_mod (VuoPoint3d a, VuoPoint3d b) __attribute__((const))
 Returns the component-wise modulus of two VuoPoint3d vectors. More...
 
static VuoPoint3d VuoPoint3d_spring (VuoReal timeSinceDrop, VuoPoint3d dropPosition, VuoPoint3d restingPosition, VuoReal period, VuoReal damping)
 Calculates a position along the path of an oscillating spring. More...
 
static VuoPoint3d VuoPoint3d_clamp (VuoPoint3d point, VuoReal limitA, VuoReal limitB)
 Limits point to values between limitA and limitB, inclusive. More...
 
static VuoPoint3d VuoPoint3d_clampn (VuoPoint3d point, VuoPoint3d limitA, VuoPoint3d limitB)
 Limits point to values between limitA and limitB, inclusive. More...
 
static VuoPoint3d VuoPoint3d_bezier3 (VuoPoint3d p0, VuoPoint3d p1, VuoPoint3d p2, VuoPoint3d p3, VuoReal time)
 Calculates a position along a cubic bezier curve. More...
 
static VuoPoint3d VuoPoint3d_snap (VuoPoint3d a, VuoPoint3d center, VuoPoint3d snap)
 Snap value a to the nearest increment of value snap. More...
 
static VuoBox VuoBox_encapsulate (VuoBox a, VuoBox b)
 Grow the VuoBox to encapsulate b. More...
 
static VuoBoolean VuoBox_contains (VuoBox aabb, VuoPoint3d point)
 Check if a point is contained within a bounding box. More...
 
static VuoBoolean VuoBox_intersects (VuoBox a, VuoBox b)
 Check if two boxes interesect with one another. More...
 
VuoPoint4d VuoPoint4d_makeFromJson (json_object *js)
 
VuoPoint3d VuoPoint3d_makeFromString (const char *str)
 Automatically generated function. More...
 
char * VuoPoint3d_getString (const VuoPoint3d value)
 Automatically generated function. More...
 
void VuoPoint3d_retain (VuoPoint3d value)
 Automatically generated function. More...
 
void VuoPoint3d_release (VuoPoint3d value)
 Automatically generated function. More...
 

Class Documentation

◆ VuoBox

struct VuoBox
Class Members
VuoPoint3d center
VuoPoint3d size

Typedef Documentation

◆ __attribute__

typedef float __attribute__((ext_vector_type(3))) VuoPoint3d

A floating-point 3-dimensional Cartesian spatial location.

Definition at line 31 of file VuoPoint3d.h.

Function Documentation

◆ VuoBox_contains()

static VuoBoolean VuoBox_contains ( VuoBox  aabb,
VuoPoint3d  point 
)
inlinestatic

Check if a point is contained within a bounding box.

Definition at line 331 of file VuoPoint3d.h.

◆ VuoBox_encapsulate()

static VuoBox VuoBox_encapsulate ( VuoBox  a,
VuoBox  b 
)
inlinestatic

Grow the VuoBox to encapsulate b.

Definition at line 309 of file VuoPoint3d.h.

◆ VuoBox_intersects()

static VuoBoolean VuoBox_intersects ( VuoBox  a,
VuoBox  b 
)
inlinestatic

Check if two boxes interesect with one another.

Definition at line 345 of file VuoPoint3d.h.

◆ VuoBox_make()

static VuoBox VuoBox_make ( VuoPoint3d  center,
VuoPoint3d  size 
) const
inlinestatic

Returns a box with the specified center and size.

Definition at line 76 of file VuoPoint3d.h.

◆ VuoBox_makeWithPoints()

static VuoBox VuoBox_makeWithPoints ( float  xmin,
float  xmax,
float  ymin,
float  ymax,
float  zmin,
float  zmax 
) const
inlinestatic

Returns an axis aligned bounding box with the specified min and max coordinates.

Definition at line 85 of file VuoPoint3d.h.

◆ VuoPoint3d_add()

static VuoPoint3d VuoPoint3d_add ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

a + b.

Definition at line 137 of file VuoPoint3d.h.

◆ VuoPoint3d_areEqual()

bool VuoPoint3d_areEqual ( const VuoPoint3d  value1,
const VuoPoint3d  value2 
)

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

Definition at line 118 of file VuoPoint3d.c.

◆ VuoPoint3d_bezier3()

static VuoPoint3d VuoPoint3d_bezier3 ( VuoPoint3d  p0,
VuoPoint3d  p1,
VuoPoint3d  p2,
VuoPoint3d  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 284 of file VuoPoint3d.h.

◆ VuoPoint3d_clamp()

static VuoPoint3d VuoPoint3d_clamp ( VuoPoint3d  point,
VuoReal  limitA,
VuoReal  limitB 
)
inlinestatic

Limits point to values between limitA and limitB, inclusive.

Definition at line 254 of file VuoPoint3d.h.

◆ VuoPoint3d_clampn()

static VuoPoint3d VuoPoint3d_clampn ( VuoPoint3d  point,
VuoPoint3d  limitA,
VuoPoint3d  limitB 
)
inlinestatic

Limits point to values between limitA and limitB, inclusive.

Definition at line 266 of file VuoPoint3d.h.

◆ VuoPoint3d_crossProduct()

static VuoPoint3d VuoPoint3d_crossProduct ( VuoPoint3d  u,
VuoPoint3d  v 
) const
inlinestatic

Returns the cross-product of u and v.

Definition at line 97 of file VuoPoint3d.h.

◆ VuoPoint3d_distance()

static float VuoPoint3d_distance ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

Distance between a and b.

Definition at line 198 of file VuoPoint3d.h.

◆ VuoPoint3d_divide()

static VuoPoint3d VuoPoint3d_divide ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

Component-wise division.

Definition at line 165 of file VuoPoint3d.h.

◆ VuoPoint3d_dotProduct()

static float VuoPoint3d_dotProduct ( VuoPoint3d  u,
VuoPoint3d  v 
) const
inlinestatic

Returns the dot product of u, v.

Definition at line 110 of file VuoPoint3d.h.

◆ VuoPoint3d_getJson()

struct json_object* VuoPoint3d_getJson ( const VuoPoint3d  value)

Encodes value as a JSON object.

Definition at line 90 of file VuoPoint3d.c.

◆ VuoPoint3d_getString()

char* VuoPoint3d_getString ( const VuoPoint3d  value)

Automatically generated function.

◆ VuoPoint3d_getSummary()

char * VuoPoint3d_getSummary ( const VuoPoint3d  value)

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

Definition at line 110 of file VuoPoint3d.c.

◆ VuoPoint3d_isLessThan()

bool VuoPoint3d_isLessThan ( const VuoPoint3d  a,
const VuoPoint3d  b 
)

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

Changed in Vuo 2.0.0:
New.

Definition at line 131 of file VuoPoint3d.c.

◆ VuoPoint3d_lerp()

static VuoPoint3d VuoPoint3d_lerp ( VuoPoint3d  a,
VuoPoint3d  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 207 of file VuoPoint3d.h.

◆ VuoPoint3d_magnitude()

static float VuoPoint3d_magnitude ( VuoPoint3d  a) const
inlinestatic

Returns the magnitude of the vector.

Definition at line 119 of file VuoPoint3d.h.

◆ VuoPoint3d_make()

static VuoPoint3d VuoPoint3d_make ( float  x,
float  y,
float  z 
) const
inlinestatic

Returns a point with the specified coordinates.

Definition at line 67 of file VuoPoint3d.h.

◆ VuoPoint3d_makeFromJson()

VuoPoint3d VuoPoint3d_makeFromJson ( json_object js)

Decodes the JSON object js to create a new value.

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

Definition at line 42 of file VuoPoint3d.c.

◆ VuoPoint3d_makeFromString()

VuoPoint3d VuoPoint3d_makeFromString ( const char *  str)

Automatically generated function.

◆ VuoPoint3d_makeNonzero()

static VuoPoint3d VuoPoint3d_makeNonzero ( VuoPoint3d  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 183 of file VuoPoint3d.h.

◆ VuoPoint3d_mod()

static VuoPoint3d VuoPoint3d_mod ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

Returns the component-wise modulus of two VuoPoint3d vectors.

Behavior for negative values matches GLSL's mod function.

Changed in Vuo 2.0.0:
New.

Definition at line 230 of file VuoPoint3d.h.

◆ VuoPoint3d_multiply()

static VuoPoint3d VuoPoint3d_multiply ( VuoPoint3d  a,
float  b 
) const
inlinestatic

a * b

Definition at line 174 of file VuoPoint3d.h.

◆ VuoPoint3d_normalize()

static VuoPoint3d VuoPoint3d_normalize ( VuoPoint3d  a) const
inlinestatic

Returns the normalization of a.

Definition at line 128 of file VuoPoint3d.h.

◆ VuoPoint3d_random()

VuoPoint3d VuoPoint3d_random ( const VuoPoint3d  minimum,
const VuoPoint3d  maximum 
)

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

See also
VuoInteger_random

Definition at line 144 of file VuoPoint3d.c.

◆ VuoPoint3d_randomWithState()

VuoPoint3d VuoPoint3d_randomWithState ( unsigned short  state[3],
const VuoPoint3d  minimum,
const VuoPoint3d  maximum 
)

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

See also
VuoInteger_randomWithState

Definition at line 157 of file VuoPoint3d.c.

◆ VuoPoint3d_release()

void VuoPoint3d_release ( VuoPoint3d  value)

Automatically generated function.

◆ VuoPoint3d_retain()

void VuoPoint3d_retain ( VuoPoint3d  value)

Automatically generated function.

◆ VuoPoint3d_scale()

static VuoPoint3d VuoPoint3d_scale ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

Returns component-wise multiplication of two VuoPoint3d vectors.

Definition at line 216 of file VuoPoint3d.h.

◆ VuoPoint3d_snap()

static VuoPoint3d VuoPoint3d_snap ( VuoPoint3d  a,
VuoPoint3d  center,
VuoPoint3d  snap 
)
inlinestatic

Snap value a to the nearest increment of value snap.

Definition at line 296 of file VuoPoint3d.h.

◆ VuoPoint3d_spring()

static VuoPoint3d VuoPoint3d_spring ( VuoReal  timeSinceDrop,
VuoPoint3d  dropPosition,
VuoPoint3d  restingPosition,
VuoReal  period,
VuoReal  damping 
)
inlinestatic

Calculates a position along the path of an oscillating spring.

Definition at line 242 of file VuoPoint3d.h.

◆ VuoPoint3d_squaredMagnitude()

static float VuoPoint3d_squaredMagnitude ( VuoPoint3d  a) const
inlinestatic

Returns the magnitude of the vector.

Definition at line 156 of file VuoPoint3d.h.

◆ VuoPoint3d_subtract()

static VuoPoint3d VuoPoint3d_subtract ( VuoPoint3d  a,
VuoPoint3d  b 
) const
inlinestatic

a - b.

Definition at line 146 of file VuoPoint3d.h.

◆ VuoPoint4d_makeFromJson()

VuoPoint4d VuoPoint4d_makeFromJson ( json_object js)

Decodes the JSON object js to create a new value.

Example:
{
"x" : 0.5,
"y" : 1,
"z" : 0,
"w" : 0
}

Definition at line 43 of file VuoPoint4d.c.