Main Page | Namespace List | Class List | File List | Class Members | File Members

utils.h File Reference

Header file for Utils class. More...

#include "main.h"
#include "material.h"
#include <string>
#include <gfx/mat4.h>
#include <gfx/vec3.h>
#include <ClanLib/core.h>

Go to the source code of this file.

Functions

Vec3 world_to_screen (Vec3 world)
 convert world coords to screen

Vec3 screen_to_world (Vec3 screen)
 convert screen coords to world

Mat4 rotation_matrix_angles_rad (const Vec3 &angles)
 Make a rotation matrix out of a triplet of angles to rotate around each axis.

void set_translation (Mat4 &mat, const Vec3 &translate)
 Set the translation vectors for a transformation matrix.

Mat4 inverse_t_r (const Mat4 &mat)
 Invert a translation*rotation matrix.

void draw_cylinder (Vec3 center, Vec3 dir, const Material &mat, double width, double height)
 Draw a cylinder at center along direction dir, with material mat, with the given width and height.

string get_string (const CL_DomElement &element, string name)
int get_int (const CL_DomElement &element, string name)
float get_float (const CL_DomElement &element, string name)
double get_double (const CL_DomElement &element, string name)
bool get_bool (const CL_DomElement &element, string name)
Vec3 get_vec3 (const CL_DomElement &element, string name)
CL_DomElement get_element (CL_ResourceManager &manager, string resource)
Vec3 vec_mult (Vec3 a, Vec3 b)
 component-wise multiplication of Vec's

Vec3 vec_dropw (Vec4 a)
string to_string (bool x)
string to_string (int x)
string to_string (double x)
string to_string (Vec3 v)
string convert_path (string path)


Detailed Description

Header file for Utils class.

Copyright 2003-2004 by GameBuilders. Distributed WITHOUT WARRANTY under the GPL. See COPYING for details.

Definition in file utils.h.


Function Documentation

string convert_path string  path  ) 
 

Definition at line 129 of file utils.cpp.

References BAD_PATH_SEP, and PATH_SEP.

void draw_cylinder Vec3  center,
Vec3  dir,
const Material &  mat,
double  width,
double  height
 

Draw a cylinder at center along direction dir, with material mat, with the given width and height.

Definition at line 103 of file utils.cpp.

References RAD_TO_DEG.

bool get_bool const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 73 of file utils.h.

double get_double const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 68 of file utils.h.

CL_DomElement get_element CL_ResourceManager &  manager,
string  resource
[inline]
 

Definition at line 88 of file utils.h.

float get_float const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 63 of file utils.h.

int get_int const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 58 of file utils.h.

string get_string const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 53 of file utils.h.

Vec3 get_vec3 const CL_DomElement &  element,
string  name
[inline]
 

Definition at line 78 of file utils.h.

Mat4 inverse_t_r const Mat4 &  mat  ) 
 

Invert a translation*rotation matrix.

Optimized inverse for T*R matrix.

Definition at line 90 of file utils.cpp.

References set_translation().

Mat4 rotation_matrix_angles_rad const Vec3 &  angles  ) 
 

Make a rotation matrix out of a triplet of angles to rotate around each axis.

Milkshape3D likes to store their rotations this way.

Definition at line 60 of file utils.cpp.

Vec3 screen_to_world Vec3  screen  ) 
 

convert screen coords to world

Definition at line 31 of file utils.cpp.

void set_translation Mat4 &  mat,
const Vec3 &  translate
 

Set the translation vectors for a transformation matrix.

Definition at line 51 of file utils.cpp.

Referenced by inverse_t_r().

string to_string Vec3  v  )  [inline]
 

Definition at line 119 of file utils.h.

string to_string double  x  )  [inline]
 

Definition at line 114 of file utils.h.

string to_string int  x  )  [inline]
 

Definition at line 109 of file utils.h.

string to_string bool  x  )  [inline]
 

Definition at line 104 of file utils.h.

Vec3 vec_dropw Vec4  a  )  [inline]
 

Definition at line 99 of file utils.h.

Vec3 vec_mult Vec3  a,
Vec3  b
[inline]
 

component-wise multiplication of Vec's

Definition at line 94 of file utils.h.

Vec3 world_to_screen Vec3  world  ) 
 

convert world coords to screen

Definition at line 11 of file utils.cpp.


Generated on Sat Mar 13 14:58:32 2004 for Ars Physica by doxygen 1.3.5