ObjFW  Diff

Differences From Artifact [7871015766]:

To Artifact [ccf7b44cda]:


84
85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	OFHashFinalize(&hash);

	return hash;
}

- (void)multiplyWithMatrix: (OFMatrix4x4 *)matrix
{
	float right[4][4];
	memcpy(right, _values, sizeof(right));


#define left matrix->_values
	_values[0][0] = left[0][0] * right[0][0] + left[0][1] * right[1][0] +
	    left[0][2] * right[2][0] + left[0][3] * right[3][0];
	_values[0][1] = left[0][0] * right[0][1] + left[0][1] * right[1][1] +
	    left[0][2] * right[2][1] + left[0][3] * right[3][1];
	_values[0][2] = left[0][0] * right[0][2] + left[0][1] * right[1][2] +
	    left[0][2] * right[2][2] + left[0][3] * right[3][2];
	_values[0][3] = left[0][0] * right[0][3] + left[0][1] * right[1][3] +
	    left[0][2] * right[2][3] + left[0][3] * right[3][3];

	_values[1][0] = left[1][0] * right[0][0] + left[1][1] * right[1][0] +
	    left[1][2] * right[2][0] + left[1][3] * right[3][0];
	_values[1][1] = left[1][0] * right[0][1] + left[1][1] * right[1][1] +
	    left[1][2] * right[2][1] + left[1][3] * right[3][1];
	_values[1][2] = left[1][0] * right[0][2] + left[1][1] * right[1][2] +
	    left[1][2] * right[2][2] + left[1][3] * right[3][2];
	_values[1][3] = left[1][0] * right[0][3] + left[1][1] * right[1][3] +
	    left[1][2] * right[2][3] + left[1][3] * right[3][3];

	_values[2][0] = left[2][0] * right[0][0] + left[2][1] * right[1][0] +
	    left[2][2] * right[2][0] + left[2][3] * right[3][0];
	_values[2][1] = left[2][0] * right[0][1] + left[2][1] * right[1][1] +
	    left[2][2] * right[2][1] + left[2][3] * right[3][1];
	_values[2][2] = left[2][0] * right[0][2] + left[2][1] * right[1][2] +
	    left[2][2] * right[2][2] + left[2][3] * right[3][2];
	_values[2][3] = left[2][0] * right[0][3] + left[2][1] * right[1][3] +
	    left[2][2] * right[2][3] + left[2][3] * right[3][3];

	_values[3][0] = left[3][0] * right[0][0] + left[3][1] * right[1][0] +
	    left[3][2] * right[2][0] + left[3][3] * right[3][0];
	_values[3][1] = left[3][0] * right[0][1] + left[3][1] * right[1][1] +
	    left[3][2] * right[2][1] + left[3][3] * right[3][1];
	_values[3][2] = left[3][0] * right[0][2] + left[3][1] * right[1][2] +
	    left[3][2] * right[2][2] + left[3][3] * right[3][2];
	_values[3][3] = left[3][0] * right[0][3] + left[3][1] * right[1][3] +
	    left[3][2] * right[2][3] + left[3][3] * right[3][3];
#undef left
}

- (void)translateWithVector: (OFVector3D)vector
{
	OFMatrix4x4 *translation = [[OFMatrix4x4 alloc] initWithValues:
	    (const float [4][4]){
		{ 1, 0, 0, vector.x },







|
<

>
|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<

|
<
<
<
<
<
<
<
<







84
85
86
87
88
89
90
91

92
93
94








95








96
97







98
99








100
101
102
103
104
105
106
	OFHashFinalize(&hash);

	return hash;
}

- (void)multiplyWithMatrix: (OFMatrix4x4 *)matrix
{
	float result[4][4] = {{ 0 }};


	for (uint_fast8_t i = 0; i < 4; i++)
		for (uint_fast8_t j = 0; j < 4; j++)








			for (uint_fast8_t k = 0; k < 4; k++)








				result[i][j] +=
				    matrix->_values[i][k] * _values[k][j];








	memcpy(_values, result, sizeof(result));








}

- (void)translateWithVector: (OFVector3D)vector
{
	OFMatrix4x4 *translation = [[OFMatrix4x4 alloc] initWithValues:
	    (const float [4][4]){
		{ 1, 0, 0, vector.x },