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

brushface_c Class Reference

A brush face. More...

#include <brush.h>


Public Methods

void create_from_plane (const plane_t *p)
 Create a face from plane.

bool cut (const plane_t *p)
 Cut this face in half.

ulong get_vertex_count ()
 Get number of vertices.

const vertex_tget_vertices ()
 Get vertices of this face.

vec3_c get_normal ()
 Get this face's plane normal.

const plane_tget_plane ()
 Get this face's plane.

void get_vertex (ulong num, vertex_t *out)
 Get a single vertex.

void get_edge (ulong num, edge_t out)
 Get a single edge.

void set_shader (const struct shader_s *_shader)
 Set face's shader.

const struct shader_sget_shader ()
 Get face's shader.

void set_tex_params (const vec2_t scale, const vec2_t offset, float rot)
 Set texture parameters.

void draw ()
 Draw this face.


Protected Methods

void createvertices ()
 called to create a big quad


Protected Attributes

ulong vertexcount
 number of vertices

vertex_tvertices
 the vertices themselves

plane_t plane
 the plane

const struct shader_sshader
 shader for this face

vec2_c offset
 texture modifiers


Detailed Description

This is the face of a brush. It has a plane, a polygon and some texturing information

Definition at line 62 of file brush.h.


Member Function Documentation

void create_from_plane const plane_t   p
 

Initializes this face using a plane_t.

Parameters:
p  Plane to use

Definition at line 68 of file x_brush.cpp.

References SafeArrayDelete.

Referenced by brush_c::add_plane().

bool cut const plane_t   p
 

Cuts this face in two pieces using p as the dividing plane. Returns true if degenerated so you know that you can be removed

Parameters:
p  Dividing plane

Definition at line 146 of file x_brush.cpp.

References _sgn(), vec2_c::copy(), vec3_c::copy(), vertex_s::diffuse, vec2_c::linear(), vertex_s::normal, plane_line_intersect(), plane_pointdist(), SafeArrayDelete, vertex_s::uv, vec3_t, vertex_copy(), and vertex_s::xyz.

Referenced by brush_c::add_plane().

void get_edge ulong    num,
edge_t    out
 

Gets edge num and stores it in out. An edge is the connection of two vertices on this face. There are as many edges as vertices. If num is larger than the vertex count it wraps around.

Parameters:
num  Index of edge
out  Where to store it

Definition at line 224 of file x_brush.cpp.

References edge_t.

Referenced by brush_c::find_edges().

vec3_c get_normal   [inline]
 

Returns the normal vector of the plane this face lies in.

Definition at line 168 of file brush.h.

References plane_s::n, and plane.

const plane_t * get_plane   [inline]
 

Returns a pointer to the plane of the face.

Definition at line 175 of file brush.h.

References plane.

Referenced by brush_c::add_plane().

const struct shader_s * get_shader   [inline]
 

Returns the shader that is used to draw the face

Definition at line 189 of file brush.h.

void get_vertex ulong    num,
vertex_t   out
 

Gets vertex num and stores it in out. If num is larger than the vertex count it wraps around.

Parameters:
num  Index of vertex
out  Where to store it

Definition at line 210 of file x_brush.cpp.

References vertex_copy().

ulong get_vertex_count   [inline]
 

Returns the number of vertices in this face

Definition at line 156 of file brush.h.

References vertexcount.

Referenced by brush_c::find_edges().

const vertex_t * get_vertices   [inline]
 

Returns a pointer to the vertices of this face.

Definition at line 162 of file brush.h.

References vertices.

void set_shader const struct shader_s   _shader [inline]
 

Sets the shader to draw this face with.

Parameters:
_shader  shader to use

Definition at line 181 of file brush.h.

References shader.

Referenced by brush_c::add_plane(), brush_c::set_face_shader(), and brush_c::set_shader().

void set_tex_params const vec2_t    scale,
const vec2_t    offset,
float    rot
 

Sets the texture parameters scale, offset and rotation.

Parameters:
_scale  scale
_offset  offset
rot  rotation angle

Definition at line 238 of file x_brush.cpp.

References vec2_t.


The documentation for this class was generated from the following files:
Generated on Wed Dec 18 15:48:49 2002 for omicron engine by doxygen1.2.18