arsa  2.7
Public Member Functions | Public Attributes | List of all members
irr::scene::quake3::SModifierFunction Struct Reference

#include <IQ3Shader.h>

Public Member Functions

 SModifierFunction ()
 
f32 evaluate (f32 dt) const
 

Public Attributes

eQ3ModifierFunction masterfunc0
 
eQ3ModifierFunction masterfunc1
 
eQ3ModifierFunction func
 
eQ3ModifierFunction tcgen
 
eQ3ModifierFunction rgbgen
 
eQ3ModifierFunction alphagen
 
union {
   f32   base
 
   f32   bulgewidth
 
}; 
 
union {
   f32   amp
 
   f32   bulgeheight
 
}; 
 
f32 phase
 
union {
   f32   frequency
 
   f32   bulgespeed
 
}; 
 
union {
   f32   wave
 
   f32   div
 
}; 
 
f32 x
 
f32 y
 
f32 z
 
u32 count
 

Detailed Description

Definition at line 418 of file IQ3Shader.h.

Constructor & Destructor Documentation

◆ SModifierFunction()

irr::scene::quake3::SModifierFunction::SModifierFunction ( )
inline

Definition at line 420 of file IQ3Shader.h.

423  base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ),
424  wave ( 1 ),
425  x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {}

Member Function Documentation

◆ evaluate()

f32 irr::scene::quake3::SModifierFunction::evaluate ( f32  dt) const
inline

Definition at line 469 of file IQ3Shader.h.

470  {
471  // phase in 0 and 1..
472  f32 x = core::fract( (dt + phase ) * frequency );
473  f32 y = 0.f;
474 
475  switch ( func )
476  {
477  case SINUS:
478  y = sinf ( x * core::PI * 2.f );
479  break;
480  case COSINUS:
481  y = cosf ( x * core::PI * 2.f );
482  break;
483  case SQUARE:
484  y = x < 0.5f ? 1.f : -1.f;
485  break;
486  case TRIANGLE:
487  y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f;
488  break;
489  case SAWTOOTH:
490  y = x;
491  break;
492  case SAWTOOTH_INVERSE:
493  y = 1.f - x;
494  break;
495  case NOISE:
496  y = Noiser::get();
497  break;
498  default:
499  break;
500  }
501 
502  return base + ( y * amp );
503  }
const f32 PI
Constant for PI.
Definition: irrMath.h:57
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
f32 fract(f32 x)
Definition: irrMath.h:672
GLfloat f
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
GLenum func
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574

Member Data Documentation

◆ @10

union { ... }

◆ @12

union { ... }

◆ @6

union { ... }

◆ @8

union { ... }

◆ alphagen

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::alphagen

Definition at line 436 of file IQ3Shader.h.

◆ amp

f32 irr::scene::quake3::SModifierFunction::amp

Definition at line 446 of file IQ3Shader.h.

◆ base

f32 irr::scene::quake3::SModifierFunction::base

Definition at line 440 of file IQ3Shader.h.

◆ bulgeheight

f32 irr::scene::quake3::SModifierFunction::bulgeheight

Definition at line 447 of file IQ3Shader.h.

◆ bulgespeed

f32 irr::scene::quake3::SModifierFunction::bulgespeed

Definition at line 455 of file IQ3Shader.h.

◆ bulgewidth

f32 irr::scene::quake3::SModifierFunction::bulgewidth

Definition at line 441 of file IQ3Shader.h.

◆ count

u32 irr::scene::quake3::SModifierFunction::count

Definition at line 467 of file IQ3Shader.h.

◆ div

f32 irr::scene::quake3::SModifierFunction::div

Definition at line 461 of file IQ3Shader.h.

◆ frequency

f32 irr::scene::quake3::SModifierFunction::frequency

Definition at line 454 of file IQ3Shader.h.

◆ func

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::func

Definition at line 432 of file IQ3Shader.h.

◆ masterfunc0

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::masterfunc0

Definition at line 428 of file IQ3Shader.h.

◆ masterfunc1

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::masterfunc1

Definition at line 430 of file IQ3Shader.h.

◆ phase

f32 irr::scene::quake3::SModifierFunction::phase

Definition at line 450 of file IQ3Shader.h.

◆ rgbgen

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::rgbgen

Definition at line 435 of file IQ3Shader.h.

◆ tcgen

eQ3ModifierFunction irr::scene::quake3::SModifierFunction::tcgen

Definition at line 434 of file IQ3Shader.h.

◆ wave

f32 irr::scene::quake3::SModifierFunction::wave

Definition at line 460 of file IQ3Shader.h.

◆ x

f32 irr::scene::quake3::SModifierFunction::x

Definition at line 464 of file IQ3Shader.h.

◆ y

f32 irr::scene::quake3::SModifierFunction::y

Definition at line 465 of file IQ3Shader.h.

◆ z

f32 irr::scene::quake3::SModifierFunction::z

Definition at line 466 of file IQ3Shader.h.


The documentation for this struct was generated from the following file: