Code Search for Developers
 
 
  

symmat4.cxx from Boson at Krugle


Show symmat4.cxx syntax highlighted

/************************************************************************

  4X4 Symmetric Matrix class
  
  $Id: symmat4.cxx 6292 2005-07-01 20:09:07Z abmann $

 ************************************************************************/
#include <gfx/symmat4.h>

SymMat4 SymMat4::I()
{
	SymMat4 A;
	A(0,0) = A(1,1) = A(2,2) = A(3,3) = 1;
	return A;
}

Mat4 SymMat4::fullmatrix() const
{
	Mat4 temp;
	for (int i=0; i<4; i++)
		for (int j=0; j<4; j++)
			temp(i,j) = (*this) (i,j);
	return temp;
}

SymMat4 SymMat4::outer_product(const Vec4& v)
{
	SymMat4 tmp;
	for(int i=0; i<4; i++)
		for(int j=0; j<4; j++)
			tmp(i,j)=v[i]*v[j];
	return tmp;
}

SymMat4 operator* (const SymMat4& n, const SymMat4& m)
{
	SymMat4 temp;
	for (int i=0; i<4; i++)
		for(int j=0; j<4; j++)
			temp(i,j)=n.row(i) * m.col(j);
	return temp;
}

double invert(Mat4& m_inv, const SymMat4& m)
{
    return invert(m_inv, m.fullmatrix());
}




See more files for this project here

Boson

Boson is an OpenGL real-time strategy game. It is designed to run on Unix (Linux) computers, and is built on top of the KDE, Qt and kdegames libraries.

Project homepage: http://sourceforge.net/projects/boson
Programming language(s): C,C++
License: other

  gfx/
    arcball.h
    array.h
    baseball.h
    geom3d.h
    geom4d.h
    gfx.h
    gl.h
    glext.h
    gltools.h
    gui.h
    intvec.h
    mat2.h
    mat3.h
    mat4.h
    mfc.h
    quat.h
    raster.h
    script.h
    symmat3.h
    symmat4.h
    trackball.h
    vec2.h
    vec3.h
    vec4.h
    wintools.h
  CMakeLists.txt
  arcball.cxx
  baseball.cxx
  config-libgfx.h.cmake
  geom3d.cxx
  geom4d.cxx
  gltools.cxx
  gui.cxx
  mat2.cxx
  mat3.cxx
  mat4.cxx
  quat.cxx
  raster-jpeg.cxx
  raster-png.cxx
  raster-pnm.cxx
  raster-tiff.cxx
  raster.cxx
  script.cxx
  symmat3.cxx
  symmat4.cxx
  time.cxx
  trackball.cxx
  wintools.cxx