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

m_plane.cpp File Reference

plane calculations More...

#include "omicron/internal.h"
#include <math.h>

Go to the source code of this file.

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)


Detailed Description

Definition in file m_plane.cpp.


Function Documentation

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().


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