IceHPoint.cpp
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 
00025 
00026 
00028 // Precompiled Header
00029 #include "Stdafx.h"
00030 
00031 using namespace IceMaths;
00032 
00034 // Point Mul = HPoint * Matrix3x3;
00036 Point HPoint::operator*(const Matrix3x3& mat) const
00037 {
00038         return Point(
00039         x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0],
00040         x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1],
00041         x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] );
00042 }
00043 
00045 // HPoint Mul = HPoint * Matrix4x4;
00047 HPoint HPoint::operator*(const Matrix4x4& mat) const
00048 {
00049         return HPoint(
00050         x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0],
00051         x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1],
00052         x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2],
00053         x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3]);
00054 }
00055 
00057 // HPoint *= Matrix4x4
00059 HPoint& HPoint::operator*=(const Matrix4x4& mat)
00060 {
00061         float xp = x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0];
00062         float yp = x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1];
00063         float zp = x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2];
00064         float wp = x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3];
00065 
00066         x = xp; y = yp; z = zp; w = wp;
00067 
00068         return  *this;
00069 }
00070 


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:16