Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

vector.h File Reference

everything that's got to do with vectors'n'stuff :) More...

#include "vector2.h"
#include "vector4.h"

Go to the source code of this file.

Data Structures

struct  bbox_s
 a bounding box

struct  collision_s
 collision information

struct  intersection_s
 A plane/xx intersection. More...

struct  plane_s
 a 3d plane

class  vec3_c
 3d vector class

struct  vertex_s
 A standard vertex. More...


Defines

#define VECT_X   0
 X component of a vector.

#define VECT_Y   1
 Y component of a vector.

#define VECT_Z   2
 Z component of a vector.

#define VECT_W   3
 W component of a vec4.

#define ANGLE_YAW   0
 Yaw component.

#define ANGLE_PITCH   1
 Pitch component.

#define ANGLE_ROLL   2
 Roll component.

#define V2TOFS(a)   (float)a[0], (float)a[1]
 will convert a vec* into it's components, comma seperated


Typedefs

typedef float vec_t
 a scalar

typedef vec_t vec2_t [2]
 2 dimensional vector

typedef vec_t vec3_t [3]
 3 dimensional vector

typedef vec_t vec4_t [4]
 4 dimensional vector

typedef vec_t vec5_t [5]
 5 dimensional vector

typedef vec3_t edge_t [2]
 an edge

typedef spline_t patch_t [3]
 a patch

typedef collision_s collision_t
 collision information

typedef bbox_s bbox_t
 a bounding box

typedef float matrix3_t [4][4]
 3x3 matrix

typedef float matrix4_t [4][4]
 4x4 matrix

typedef plane_s plane_t
 a 3d plane

typedef vertex_s vertex_t
 A standard vertex.

typedef intersection_s intersection_t
 A plane/xx intersection.


Functions

plane_t plane_frompoints (const vec3_t a, const vec3_t b, const vec3_t c)
 create a plane

float plane_line_intersect (const vec3_t a, const vec3_t b, const plane_t *p, vec3_t out)
float plane_pointdist (const vec3_t v, const plane_t *p)
int plane_pointside (const vec3_t v, const plane_t *p)
int plane_clip_box (const plane_t *p, const bbox_t *bbox)
void vertex_set_ex (vertex_t *vert, float x, float y, float z, float u, float v, float lu, float lv)
void vertex_set (vertex_t *vert, float x, float y, float z, float u, float v)
void vertex_copy (vertex_t *in, vertex_t *out)
void matrix3_mult (const matrix3_t a, const matrix3_t b, matrix3_t out)

Variables

vec3_c spline_t [3]
 a spline


Detailed Description

All 3d Vector stuff is here :)

Definition in file vector.h.


Typedef Documentation

typedef struct intersection_s intersection_t
 

This is an intersection as it is returned by Omicron's intersetion routines.

typedef struct vertex_s vertex_t
 

The Omicron representation of a 3 dimensional vertex. It has a 3 dimensional vector as coordinates, a normal vector, 2 texture vectors

  • one for texture and one for lightmap (for those graphic adapters that support multitexturing) and a diffuse color value.


Function Documentation

void matrix3_mult const matrix3_t    a,
const matrix3_t    b,
matrix3_t    out
 

multiply two matrices Multiplies two matrices. out = a x b

Parameters:
a  first matrix
b  second matrix
out  output

Definition at line 55 of file m_matrix.cpp.

References matrix3_t.

Referenced by vec3_c::rotate_vec().

int plane_clip_box const plane_t   p,
const bbox_t   bbox
 

check box side Checks which side the box is on. Returns 1 if box is totally in front, 0 if partially in front and -1 if totally invisible.

Parameters:
p  plane
bbox  the box

Definition at line 142 of file m_plane.cpp.

References plane_pointside(), and vec3_c::set().

plane_t plane_frompoints const vec3_t    a,
const vec3_t    b,
const vec3_t    c
 

Parameters:
a  input vectors

Definition at line 53 of file m_plane.cpp.

References vec3_c::copy(), vec3_c::cross(), plane_s::d, vec3_c::dot(), plane_s::n, vec3_c::normalize(), and vec3_t.

Referenced by landscape_c::create_normals().

float plane_line_intersect const vec3_t    a,
const vec3_t    b,
const plane_t   p,
vec3_t    out
 

find intersection Finds the intersection point of a plane and a line. The result is stored in out. The return value is the fraction of the distance between b (1.0) and a (0.0).

Parameters:
a  start vector
b  end vector
p  plane to test
out  output vector

Definition at line 83 of file m_plane.cpp.

References vec3_c::copy(), and vec3_t.

Referenced by brushface_c::cut().

float plane_pointdist const vec3_t    v,
const plane_t   p
 

get the distance from a plane Returns the distance of a point from a plane.

Parameters:
v  point
p  plane

Definition at line 112 of file m_plane.cpp.

References vec3_t.

Referenced by brushface_c::cut().

int plane_pointside const vec3_t    v,
const plane_t   p
 

check which side point is on 1 if in front, 0 if coincident and -1 if behind

Parameters:
v  point
p  plane

Definition at line 127 of file m_plane.cpp.

References _sgn(), and vec3_t.

Referenced by landscape_c::is_node_visible(), and plane_clip_box().

void vertex_copy vertex_t   in,
vertex_t   out
 

copy vertex Copies a vertex into another. (out = in)

Parameters:
in  input vertex
out  output vertex

Definition at line 94 of file r_vertex.cpp.

Referenced by brushface_c::cut(), and brushface_c::get_vertex().

void vertex_set vertex_t   vert,
float    x,
float    y,
float    z,
float    u,
float    v
 

set vertex Fills a vertex with coordinates.

Parameters:
vert  vertex
x  coordinates
u  texture coords

Definition at line 76 of file r_vertex.cpp.

References vertex_set_ex().

Referenced by particle_type_c::draw().

void vertex_set_ex vertex_t   vert,
float    x,
float    y,
float    z,
float    u,
float    v,
float    lu,
float    lv
 

set vertex Fills a vertex with coordinates including lightmapped.

Parameters:
vert  vertex
x  coordinates
u  texture coords
lu  light map coords

Definition at line 53 of file r_vertex.cpp.

Referenced by vertex_set().


Generated on Wed Dec 18 15:48:49 2002 for omicron engine by doxygen1.2.18