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

utils.cpp File Reference

#include "utils.h"
#include <math.h>
#include <stdio.h>
#include <gfx/gl.h>
#include <ClanLib/core.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.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

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

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

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 convert_path (string path)


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.

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().

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