Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

float4 Class Reference

Representation of an array of 4 floats. Convenient for passing COLOR + alpha, Wpt, or Wvec to OpenGL:. More...

#include <gl_util.H>

List of all members.

Public Member Functions

 operator GLfloat * ()
 Define implicit cast from float4 to GLfloat*:.
Constructors
 float4 (CCOLOR &c, double alpha=1.0)
 float4 (CWpt &p)
 float4 (CWvec &v)

Private Attributes

GLfloat _data [4]


Detailed Description

Representation of an array of 4 floats. Convenient for passing COLOR + alpha, Wpt, or Wvec to OpenGL:.

Examples:

// Set current color and alpha: COLOR c = Color::orange4; double a = 0.7; // alpha glColor4fv(float4(c, a));

// Pass a position or direction to define light coordinates, // where the homogeneous coordinate h is 1 or 0, respectively: Wpt p; Wvec v; if (positional_light) glLightfv(GL_LIGHT0, GL_POSITION, float4(p)); // h == 1 else glLightfv(GL_LIGHT0, GL_POSITION, float4(v)); // h == 0

Definition at line 40 of file gl_util.H.


Constructor & Destructor Documentation

float4::float4 CCOLOR c,
double  alpha = 1.0
[inline]
 

Definition at line 44 of file gl_util.H.

References _data.

float4::float4 CWpt p  )  [inline]
 

Definition at line 50 of file gl_util.H.

References _data.

float4::float4 CWvec v  )  [inline]
 

Definition at line 56 of file gl_util.H.

References _data.


Member Function Documentation

float4::operator GLfloat *  )  [inline]
 

Define implicit cast from float4 to GLfloat*:.

Definition at line 65 of file gl_util.H.

References _data.


Member Data Documentation

GLfloat float4::_data[4] [private]
 

Definition at line 68 of file gl_util.H.

Referenced by float4(), and operator GLfloat *().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:45:22 2006 for jot by  doxygen 1.4.4