IceHPoint.cpp
Go to the documentation of this file.
1 
8 
11 
25 
28 // Precompiled Header
29 #include "Stdafx.h"
30 
31 using namespace IceMaths;
32 
34 // Point Mul = HPoint * Matrix3x3;
37 {
38  return Point(
39  x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0],
40  x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1],
41  x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] );
42 }
43 
45 // HPoint Mul = HPoint * Matrix4x4;
48 {
49  return HPoint(
50  x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0],
51  x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1],
52  x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2],
53  x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3]);
54 }
55 
57 // HPoint *= Matrix4x4
60 {
61  float xp = x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0];
62  float yp = x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1];
63  float zp = x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2];
64  float wp = x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3];
65 
66  x = xp; y = yp; z = zp; w = wp;
67 
68  return *this;
69 }
70 
inline_ HPoint & operator*=(const HPoint &p)
Operator for HPoint *= HPoint;.
Definition: OPC_IceHook.h:121
inline_ HPoint operator*(const HPoint &p) const
Operator for HPoint Mul = HPoint * HPoint;.
Definition: OPC_IceHook.h:93
inline_ Point()
Empty constructor.
Definition: OPC_IceHook.h:31
float w
Cast a HPoint to a Point. w is discarded.
Definition: OPC_IceHook.h:157
inline_ HPoint()
Empty constructor.
Definition: OPC_IceHook.h:21


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:38