Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IceHPoint.cpp
Go to the documentation of this file.
1 
8 
11 
25 
28 // Precompiled Header
29 #include "Stdafx.h"
30 
31 
32 using namespace Opcode;
33 
35 // Point Mul = HPoint * Matrix3x3;
38 {
39  return Point(
40  x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0],
41  x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1],
42  x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] );
43 }
44 
46 // HPoint Mul = HPoint * Matrix4x4;
49 {
50  return HPoint(
51  x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0],
52  x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1],
53  x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2],
54  x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3]);
55 }
56 
58 // HPoint *= Matrix4x4
61 {
62  float xp = x * mat.m[0][0] + y * mat.m[1][0] + z * mat.m[2][0] + w * mat.m[3][0];
63  float yp = x * mat.m[0][1] + y * mat.m[1][1] + z * mat.m[2][1] + w * mat.m[3][1];
64  float zp = x * mat.m[0][2] + y * mat.m[1][2] + z * mat.m[2][2] + w * mat.m[3][2];
65  float wp = x * mat.m[0][3] + y * mat.m[1][3] + z * mat.m[2][3] + w * mat.m[3][3];
66 
67  x = xp; y = yp; z = zp; w = wp;
68 
69  return *this;
70 }
71