GhoulPrimitive::Primitive Class Reference

#include <GhoulPrimitives.h>

Inheritance diagram for GhoulPrimitive::Primitive:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void Update (Drawer &drawer, bool bHasNormals=true, bool bHasTexCoords=true)
 (abstract) Base Class with utility functions
 Primitive ()
virtual ~Primitive ()

Static Public Member Functions

static void Circle (Real *a, size_t blocks, size_t components=2, kReal radius=1.0, kReal startang=0.0, kReal endang=pi2, bool setOtherComponentsToZero=true)
 utils
static void Ellipse (Real *a, size_t blocks, size_t components=2, kReal radiusx=1.0, kReal radiusy=1.0, kReal startang=0.0, kReal endang=pi2, bool setOtherComponentsToZero=true)
static void InterpolatateFloatV (kReal *source, Real *dest, kReal t, size_t num=1, size_t startoff=0, size_t bufsize=2, eInterpolationMode mode=kInterpolate_Linear, size_t stride=0)
static Real InterpolatateFloat (kReal *source, kReal t, size_t startoff=0, size_t bufsize=2, eInterpolationMode mode=kInterpolate_Linear, size_t stride=0)
static Real InterpolatateFloat_Linear (kReal p1, kReal p2, kReal t)
 t=0 -> p1, t=1 -> p2
static Real InterpolatateFloat_Smooth (kReal q1, kReal p1, kReal p2, kReal q2, kReal t)
 t=0 -> p1, t=1 -> p2


Detailed Description

Definition at line 141 of file GhoulPrimitives.h.


Constructor & Destructor Documentation

Primitive::Primitive (  ) 

Definition at line 23 of file GhoulPrimitives.cpp.

Primitive::~Primitive (  )  [virtual]

Definition at line 24 of file GhoulPrimitives.cpp.


Member Function Documentation

void Primitive::Update ( Drawer drawer,
bool  bHasNormals = true,
bool  bHasTexCoords = true 
) [virtual]

(abstract) Base Class with utility functions

interface

Reimplemented in GhoulPrimitive::Loft.

Definition at line 25 of file GhoulPrimitives.cpp.

void Primitive::Circle ( Real a,
size_t  blocks,
size_t  components = 2,
kReal  radius = 1.0,
kReal  startang = 0.0,
kReal  endang = pi2,
bool  setOtherComponentsToZero = true 
) [static]

utils

Definition at line 52 of file GhoulPrimitives.cpp.

References Ellipse(), and PROFILE.

void Primitive::Ellipse ( Real a,
size_t  blocks,
size_t  components = 2,
kReal  radiusx = 1.0,
kReal  radiusy = 1.0,
kReal  startang = 0.0,
kReal  endang = pi2,
bool  setOtherComponentsToZero = true 
) [static]

writes the coordinates for points on a 2D circle into an array

Remarks:
TODO : optimize me using sin,cos tables ?
Parameters:
a The array to write to, must hold at least blocks * components
blocks number of blocks(e.g. vectors) in the array
components each "block" consists of this many Reals, only the first 2 receive circle coords
startang for partial circle, 0.0 results in the first point being on (0,1),...,(1,0)... (clockwise)
endang for partial circle
setOtherComponentsToZero initializes components after the second to zero

Definition at line 37 of file GhoulPrimitives.cpp.

References assert, and PROFILE.

Referenced by Circle(), GhoulPrimitive::Cone::SetParams(), and GhoulPrimitive::Ellipsoid::SetParams().

void Primitive::InterpolatateFloatV ( kReal source,
Real dest,
kReal  t,
size_t  num = 1,
size_t  startoff = 0,
size_t  bufsize = 2,
eInterpolationMode  mode = kInterpolate_Linear,
size_t  stride = 0 
) [static]

n float interpolation (vectors,colors,..)

Parameters:
source array with source values, must have at least space for "bufsize" Reals
dest result is written here, must have at least space for "num" Reals
t "time" for interpolation, [0.0;1.0]
num number of Reals to synchronously interpolate, e.g. 3 for 3dvectors x,y,z
startoff the offset (in Reals) of the first coordinate at t=0.0, the entries this one are also considered for quadric mode, if they are inside the buffer
bufsize the number of floats in the buffer
mode see eInterpolationMode
See also:
eInterpolationMode
Parameters:
stride number of "unused" (e.g. not interpolated) Reals after a "num" block, useful if quaternions etc are in the same buffer, and are interpolated differently

Definition at line 68 of file GhoulPrimitives.cpp.

References ASSERT, GhoulPrimitive::kInterpolate_Constant, GhoulPrimitive::kInterpolate_Linear, GhoulPrimitive::kInterpolate_SmoothQuadric, and PROFILE.

Referenced by InterpolatateFloat().

Real Primitive::InterpolatateFloat ( kReal source,
kReal  t,
size_t  startoff = 0,
size_t  bufsize = 2,
eInterpolationMode  mode = kInterpolate_Linear,
size_t  stride = 0 
) [static]

Definition at line 128 of file GhoulPrimitives.cpp.

References InterpolatateFloatV(), and PROFILE.

Referenced by InterpolatateFloat_Linear(), and InterpolatateFloat_Smooth().

static Real GhoulPrimitive::Primitive::InterpolatateFloat_Linear ( kReal  p1,
kReal  p2,
kReal  t 
) [static]

t=0 -> p1, t=1 -> p2

static Real GhoulPrimitive::Primitive::InterpolatateFloat_Smooth ( kReal  q1,
kReal  p1,
kReal  p2,
kReal  q2,
kReal  t 
) [static]

t=0 -> p1, t=1 -> p2


The documentation for this class was generated from the following files:

Generated on Tue May 22 06:00:35 2012 for cpp by  doxygen 1.5.6