⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gw_quaternion.h

📁 fast marching method
💻 H
字号:
/*----------------------------------------------------------------------------*/
/*                         GW_Quaternion.h                                    */
/*----------------------------------------------------------------------------*/
/* a quaternion                                                               */
/*----------------------------------------------------------------------------*/


/** \file 
	This file contains the defintion of a quaternion, wich can be used to 
	represent a rotation, and is mainly used for animation purposes.
	\author Gabriel.
**/

#ifndef _GW_QUATERNION_H_
#define _GW_QUATERNION_H_

#include "GW_MathsConfig.h"
#include "GW_Maths.h"
#include "GW_Matrix3x3.h"

namespace GW
{
	
class GW_Matrix3x3;

/*--------------------------------------------------------------------*/
/*                       class GW_Quaternion                          */
/*--------------------------------------------------------------------*/
/* a quaternion                                                       */
/*--------------------------------------------------------------------*/

/*! \ingroup group_primitive
 *  \brief class GW_Quaternion in group group primitive
 */

/// A quatenion has 4 components, and represent rotation matrix.
/** 
	The quaternion algebra is known to be the only real algebra (with division)
	of finite dimension after the complex plane. 
	This result is due to Frobenius
	\author Gabriel
*/

class GW_Quaternion
{

public:

    GW_Quaternion::GW_Quaternion()
	{
		x=y=z=0;
		w=1;
	}

	GW_Quaternion::GW_Quaternion(const GW_Float _w, const GW_Float _x, 
								const GW_Float _y, const GW_Float _z)
	{
		x=_x;
		y=_y;
		z=_z;
		w=_w;
	}

	GW_Quaternion::GW_Quaternion(const GW_Float _w, const GW_Float axe[3])
	{
		x=axe[X];
		y=axe[Y];
		z=axe[Z];
		w=_w;
	}


	/*------------------------------------------------------------------------------*/
	/** 
	* Name : GW_Quaternion constructor
	*
	*  \param  axe the axe of the quaternion
	*  \author Gabriel Peyr

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -