Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

vertex.h File Reference

Vertex (3 dimensional vector). More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define LSG_VERTEX_H   1

Typedefs

typedef float Vertex [3]
 3 dimensional vector


Functions

void vertex_assign (Vertex dst, float x, float y, float z)
void vertex_copy (Vertex dst, const Vertex src)
void vertex_add (Vertex dst, const Vertex src)
void vertex_sub (Vertex dst, const Vertex src)
void vertex_mul (Vertex dst, const Vertex src)
void vertex_div (Vertex dst, const Vertex src)
void vertex_min (Vertex dst, const Vertex src)
void vertex_max (Vertex dst, const Vertex src)
void vertex_scale (Vertex dst, float scale)
float vertex_dot (const Vertex a, const Vertex b)
void vertex_cross (Vertex dst, const Vertex src)
float vertex_length (const Vertex src)
void vertex_normalize (Vertex dst)


Detailed Description

Vertex (3 dimensional vector).


Typedef Documentation

typedef float Vertex[3]
 

3 dimensional vector

A three dimensional vector


Function Documentation

void vertex_assign Vertex  dst,
float  x,
float  y,
float  z
 

Assign all three components of a vertex.

Parameters:
dst The destination vertex
x The value for the first component
y The value for the second component
z The value for the third component

void vertex_copy Vertex  dst,
const Vertex  src
 

Copy a vertex into another.

Parameters:
dst The destination vertex
src The source vertex

void vertex_add Vertex  dst,
const Vertex  src
 

Add a vertex to another.

Parameters:
dst The destination vertex
srx The vertex to add

void vertex_sub Vertex  dst,
const Vertex  src
 

Subtract a vertex from another.

Parameters:
dst The destination vertex
src The vertex to subtract

void vertex_mul Vertex  dst,
const Vertex  src
 

Multiply two vertices component wise.

Parameters:
dst The destination vertex
src The vertex to multiply onto dst

void vertex_div Vertex  dst,
const Vertex  src
 

Divide two vertices component wise.

Parameters:
dst The destination vertex
src The vertex by which to divide dst

void vertex_min Vertex  dst,
const Vertex  src
 

Compute the component wise minimum of two vertices.

Parameters:
dst The destination vertex
src The second vertex

void vertex_max Vertex  dst,
const Vertex  src
 

Compute the component wise maximum of two vertices.

Parameters:
dst The destination vertex
src The second vertex

void vertex_scale Vertex  dst,
float  scale
 

Scale a vertex by a scalar value.

Parameters:
dst The vertex to scale
scale The scale factor

float vertex_dot const Vertex  a,
const Vertex  b
 

Compute the dot product of two vertices.

Parameters:
a The first vertex
b The second vertex
Returns:
The dot product of a and b (a * b == |a| * |b| * cos(a, b))

void vertex_cross Vertex  dst,
const Vertex  src
 

Compute the cross product of two vertices. dst = dst x src

Parameters:
dst The destination vertex and the first factor
src The second factor

float vertex_length const Vertex  src  ) 
 

Compute the euclidean length of a vertex.

Parameters:
src The vertex
Returns:
The euclidean length of vertex src (|src|)

void vertex_normalize Vertex  dst  ) 
 

Normalize a vertex so that its length is 1.

Parameters:
dst The vertex to normalize


(c) 2003, by Enno Cramer
generated on 13 Jul 2003
lescegra - doxygen