forked from derandark/DungeonViewerAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Frame.cpp
633 lines (489 loc) · 17.4 KB
/
Frame.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
#include "StdAfx.h"
#include "Frame.h"
#include "LandDefs.h"
AFrame::AFrame()
{
m_origin = Vector(0, 0, 0);
m_angles = Quaternion(1.0, 0, 0, 0);
}
BOOL AFrame::UnPack(BYTE **ppData, ULONG iSize)
{
UNPACK_OBJ(m_origin);
UNPACK_OBJ(m_angles);
if (!IsValid())
return FALSE;
return TRUE;
}
BOOL AFrame::IsValid()
{
if (!m_origin.IsValid())
return FALSE;
if (!m_angles.IsValid())
return FALSE;
return TRUE;
}
Frame::Frame()
{
m_origin = Vector(0, 0, 0);
m_angles = Quaternion(1.0, 0, 0, 0);
cache();
}
BOOL Frame::IsValid()
{
if (!m_origin.IsValid())
return FALSE;
if (!m_angles.IsValid())
return FALSE;
return TRUE;
}
ULONG Frame::pack_size()
{
return(m_origin.pack_size() + m_angles.pack_size());
}
ULONG Frame::Pack(BYTE **ppData, ULONG iSize)
{
UNFINISHED("Frame::Pack");
return 0;
}
BOOL Frame::UnPack(BYTE **ppData, ULONG iSize)
{
if (iSize < pack_size())
return FALSE;
UNPACK_OBJ(m_origin);
UNPACK_OBJ(m_angles);
if (!IsValid())
return FALSE;
cache();
return TRUE;
}
void EulGetOrd(int ord, int& i, int& j, int& k, int& h, int& n, int& s, int& f)
{
#define EulFrmS 0
#define EulFrmR 1
#define EulFrm(ord) ((unsigned)(ord)&1)
#define EulRepNo 0
#define EulRepYes 1
#define EulRep(ord) (((unsigned)(ord)>>1)&1)
#define EulParEven 0
#define EulParOdd 1
#define EulSafe "\000\001\002\000"
#define EulNext "\001\002\000\001"
int o = ord;
f = o & 1; o >>=1;
s = o & 1; o >>= 1;
n = o & 1; o >>= 1;
i = EulSafe[ o & 3 ];
j = EulNext[ i + n ];
k = EulNext[ i + 1 - n ];
h = s ? k : i;
}
void Frame::euler_set_rotate(Vector Angles, int order)
{
Quaternion qu;
float a[3];
float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
int i, j, k, h, n, s, f;
EulGetOrd(order, i, j, k, h, n, s, f);
if (f == EulFrmR)
{
// Rotate
float t = Angles.x;
Angles.x = Angles.z;
Angles.z = t;
}
if (n == EulParOdd)
Angles.y = -Angles.y;
ti = Angles.x * 0.5f; tj = Angles.y * 0.5f; th = Angles.z * 0.5f;
ci = cos(ti); cj = cos(tj); ch = cos(th);
si = sin(ti); sj = sin(tj); sh = sin(th);
cc = ci * ch; cs = ci * sh; sc = si * ch; ss = si * sh;
if (s == EulRepYes)
{
a[i] = cj * (cs + sc); /* Could speed up with */
a[j] = sj * (cc + ss); /* trig identities. */
a[k] = sj * (cs - sc);
qu.w = cj * (cc - ss);
}
else
{
a[i] = cj * sc - sj * cs;
a[j] = cj * ss + sj * cc;
a[k] = cj * cs - sj * sc;
qu.w = cj * cc + sj * ss;
}
if (n == EulParOdd)
a[j] = -a[j];
qu.x = a[0];
qu.y = a[1];
qu.z = a[2];
set_rotate(qu);
}
void Frame::set_rotate(Quaternion angles)
{
m_angles = angles;
m_angles.normalize();
cache();
}
void Frame::rotate_around_axis_to_vector(int axis, const Vector& target)
{
Vector axe = *((Vector *)(&m00 + (axis * 3)));
Vector dir = target - (axe * axe.dot_product(target));
int next_ord[3] = { 2, 0, 1 };
if (!dir.normalize_check_small())
dir = *((Vector *)(&m00 + (next_ord[axis] * 3)));
if ((F_EPSILON * 5.0f) < abs(dir.dot_product(axe)))
return;
int axe_x, axe_y;
axe_x = next_ord[axis];
*((Vector *)(&m00 + axe_x)) = dir;
axe_y = next_ord[axe_x];
*((Vector *)(&m00 + axe_y)) = cross_product(dir, axe);
// Finish me.
cache_quaternion();
}
void Frame::set_heading(float DegreeHeading)
{
float RadianHeading = D3DXToRadian(DegreeHeading);
Vector vechead(sin(RadianHeading), cos(RadianHeading), m12 + (m02 + m22 * 0.0));
set_vector_heading(vechead);
}
void Frame::set_vector_heading(const Vector& Heading)
{
Vector NormalHeading = Heading;
if (NormalHeading.normalize_check_small())
return;
double zrotate = D3DXToRadian(-fmod(450 - D3DXToDegree(atan2(NormalHeading.y, NormalHeading.x)), 360));
double xrotate = asin(NormalHeading.z);
euler_set_rotate(Vector(xrotate, 0, zrotate), 0);
}
void Frame::subtract1(const Frame* a, const AFrame* b)
{
Quaternion TempQuat;
TempQuat.w = (((a->m_angles.w * b->m_angles.w) + (a->m_angles.x * b->m_angles.x)) + (a->m_angles.y * b->m_angles.y)) + (a->m_angles.z * b->m_angles.z);
TempQuat.x = ((a->m_angles.x * b->m_angles.w) - (a->m_angles.w * b->m_angles.x) - (a->m_angles.y * b->m_angles.z)) + (a->m_angles.z * b->m_angles.y);
TempQuat.y = ((a->m_angles.x * b->m_angles.z) - (a->m_angles.w * b->m_angles.y)) + (a->m_angles.y * b->m_angles.w) - (a->m_angles.z * b->m_angles.x);
TempQuat.z = (((a->m_angles.x * b->m_angles.y) + (a->m_angles.w * b->m_angles.z)) - (a->m_angles.y * b->m_angles.x)) + (a->m_angles.z * b->m_angles.w);
set_rotate(TempQuat);
Vector TempVec;
TempVec.x = m_origin.x + (-(b->m_origin.x) * m00) + (-(b->m_origin.y) * m10) + (-(b->m_origin.z) * m20);
TempVec.y = m_origin.y + (-(b->m_origin.x) * m01) + (-(b->m_origin.y) * m11) + (-(b->m_origin.z) * m21);
TempVec.z = m_origin.z + (-(b->m_origin.x) * m02) + (-(b->m_origin.y) * m12) + (-(b->m_origin.z) * m22);
m_origin = TempVec;
}
void Frame::combine(const Frame* a, const AFrame* b)
{
Vector TempVec;
TempVec.x = a->m_origin.x + (b->m_origin.x * a->m00) + (b->m_origin.y * a->m10) + (b->m_origin.z * a->m20);
TempVec.y = a->m_origin.y + (b->m_origin.x * a->m01) + (b->m_origin.y * a->m11) + (b->m_origin.z * a->m21);
TempVec.z = a->m_origin.z + (b->m_origin.x * a->m02) + (b->m_origin.y * a->m12) + (b->m_origin.z * a->m22);
m_origin = TempVec;
Quaternion TempQuat;
TempQuat.w = (((a->m_angles.w * b->m_angles.w) - (a->m_angles.x * b->m_angles.x)) - (a->m_angles.y * b->m_angles.y)) - (a->m_angles.z * b->m_angles.z);
TempQuat.x = ((a->m_angles.x * b->m_angles.w) + (a->m_angles.w * b->m_angles.x) + (a->m_angles.y * b->m_angles.z)) - (a->m_angles.z * b->m_angles.y);
TempQuat.y = ((a->m_angles.w * b->m_angles.y) - (a->m_angles.x * b->m_angles.z)) + (a->m_angles.y * b->m_angles.w) + (a->m_angles.z * b->m_angles.x);
TempQuat.z = (((a->m_angles.x * b->m_angles.y) + (a->m_angles.w * b->m_angles.z)) - (a->m_angles.y * b->m_angles.x)) + (a->m_angles.z * b->m_angles.w);
set_rotate(TempQuat);
}
void Frame::combine(const Frame* a, const AFrame* b, const Vector* scale)
{
Vector ScaledVec;
ScaledVec.x = b->m_origin.x * scale->x;
ScaledVec.y = b->m_origin.y * scale->y;
ScaledVec.z = b->m_origin.z * scale->z;
Vector TempVec;
TempVec.x = a->m_origin.x + (ScaledVec.x * a->m00) + (ScaledVec.y * a->m10) + (ScaledVec.z * a->m20);
TempVec.y = a->m_origin.y + (ScaledVec.x * a->m01) + (ScaledVec.y * a->m11) + (ScaledVec.z * a->m21);
TempVec.z = a->m_origin.z + (ScaledVec.x * a->m02) + (ScaledVec.y * a->m12) + (ScaledVec.z * a->m22);
m_origin = TempVec;
Quaternion TempQuat;
TempQuat.w = (((a->m_angles.w * b->m_angles.w) - (a->m_angles.x * b->m_angles.x)) - (a->m_angles.y * b->m_angles.y)) - (a->m_angles.z * b->m_angles.z);
TempQuat.x = ((a->m_angles.x * b->m_angles.w) + (a->m_angles.w * b->m_angles.x) + (a->m_angles.y * b->m_angles.z)) - (a->m_angles.z * b->m_angles.y);
TempQuat.y = ((a->m_angles.w * b->m_angles.y) - (a->m_angles.x * b->m_angles.z)) + (a->m_angles.y * b->m_angles.w) + (a->m_angles.z * b->m_angles.x);
TempQuat.z = (((a->m_angles.x * b->m_angles.y) + (a->m_angles.w * b->m_angles.z)) - (a->m_angles.y * b->m_angles.x)) + (a->m_angles.z * b->m_angles.w);
set_rotate(TempQuat);
}
void Frame::rotate(const Vector& angles)
{
Vector Rotation;
Rotation.x = (m00 * angles.x) + (m10 * angles.y) + (m20 * angles.z);
Rotation.y = (m01 * angles.x) + (m11 * angles.y) + (m21 * angles.z);
Rotation.z = (m02 * angles.x) + (m12 * angles.y) + (m22 * angles.z);
grotate(Rotation);
}
void Frame::grotate(Vector& angles)
{
float magn = angles.magnitude();
if (magn < F_EPSILON)
return;
angles.x *= 1 / magn;
angles.y *= 1 / magn;
angles.z *= 1 / magn;
Quaternion qu;
qu.w = cos(magn * 0.5f);
qu.x = angles.x * sin(magn * 0.5f);
qu.y = angles.y * sin(magn * 0.5f);
qu.z = angles.z * sin(magn * 0.5f);
Quaternion rot;
rot.w = (((qu.w * m_angles.w) - (qu.x * m_angles.x)) - (qu.y * m_angles.y)) - (qu.z * m_angles.z);
rot.x = ((qu.x * m_angles.w) + (qu.w * m_angles.x) + (qu.y * m_angles.z)) - (qu.z * m_angles.y);
rot.y = ((qu.w * m_angles.y) - (qu.x * m_angles.z)) + (qu.y * m_angles.w) + (qu.z * m_angles.x);
rot.z = (((qu.x * m_angles.y) + (qu.w * m_angles.z)) - (qu.y * m_angles.x)) + (qu.z * m_angles.w);
// Normalize Rotation and Cache
set_rotate(rot);
}
Vector Frame::globaltolocal(const Vector& point) const
{
Vector point_offset = point - m_origin;
float x = (point_offset.x * m00) + (point_offset.y * m01) + (point_offset.z * m02);
float y = (point_offset.x * m10) + (point_offset.y * m11) + (point_offset.z * m12);
float z = (point_offset.x * m20) + (point_offset.y * m21) + (point_offset.z * m22);
return Vector(x, y, z);
}
Vector Frame::globaltolocalvec(const Vector& point) const
{
float x = (point.x * m00) + (point.y * m01) + (point.z * m02);
float y = (point.x * m10) + (point.y * m11) + (point.z * m12);
float z = (point.x * m20) + (point.y * m21) + (point.z * m22);
return Vector(x, y, z);
}
Vector Frame::localtoglobal(const Vector& point) const
{
float x = m_origin.x + (point.x * m00) + (point.y * m10) + (point.z * m20);
float y = m_origin.y + (point.x * m01) + (point.y * m11) + (point.z * m21);
float z = m_origin.z + (point.x * m02) + (point.y * m12) + (point.z * m22);
return Vector(x, y, z);
}
Vector Frame::localtoglobalvec(const Vector& point) const
{
float x = (point.x * m00) + (point.y * m10) + (point.z * m20);
float y = (point.x * m01) + (point.y * m11) + (point.z * m21);
float z = (point.x * m02) + (point.y * m12) + (point.z * m22);
return Vector(x, y, z);
}
Vector Frame::localtolocal(const Frame& frame, const Vector& point) const
{
Vector global_point = frame.localtoglobal(point);
return globaltolocal(global_point);
}
void Frame::MakeD3DMatrix(D3DXMATRIX* pOut, Vector& ObjScale)
{
D3DXMATRIX ObjectMatrix;
ObjectMatrix._11 = ObjScale.x * m[0][0];
ObjectMatrix._21 = ObjScale.y * m[1][0];
ObjectMatrix._31 = ObjScale.z * m[2][0];
ObjectMatrix._41 = m_origin.x;
ObjectMatrix._12 = ObjScale.x * m[0][2];
ObjectMatrix._22 = ObjScale.y * m[1][2];
ObjectMatrix._32 = ObjScale.z * m[2][2];
ObjectMatrix._42 = m_origin.z;
ObjectMatrix._13 = ObjScale.x * m[0][1];
ObjectMatrix._23 = ObjScale.y * m[1][1];
ObjectMatrix._33 = ObjScale.z * m[2][1];
ObjectMatrix._43 = m_origin.y;
ObjectMatrix._14 = 0.0f;
ObjectMatrix._24 = 0.0f;
ObjectMatrix._34 = 0.0f;
ObjectMatrix._44 = 1.0f;
*pOut = ObjectMatrix;
}
void Frame::cache_quaternion()
{
float W, X, Y, Z, S, T;
T = m00 + m11 + m22 + 1.0f;
if (T > F_EPSILON)
{
S = sqrt(T) * 2;
X = (m12 - m21) / S;
Y = (m20 - m02) / S;
Z = (m01 - m10) / S;
W = 0.25 * S;
}
else
{
// I'd rather not reverse this.
// Ripped from http://skal.planet-d.net/demo/matrixfaq.htm#Q55
// This matrix is a flipped 3x3 from the documentation's 4x4 :P
if (m00 > m11 && m00 > m22)
{ // Column 0:
S = sqrt(1.0 + m00 - m11 - m22) * 2;
X = 0.25 * S;
Y = (m01 + m10) / S;
Z = (m20 + m02) / S;
W = (m12 - m21) / S;
} else if (m11 > m22)
{ // Column 1:
S = sqrt(1.0 + m11 - m00 - m22) * 2;
X = (m01 + m10) / S;
Y = 0.25 * S;
Z = (m12 + m21) / S;
W = (m20 - m02) / S;
}
else
{ // Column 2:
S = sqrt(1.0 + m22 - m00 - m11) * 2;
X = (m20 + m02) / S;
Y = (m12 + m21) / S;
Z = 0.25 * S;
W = (m01 - m10) / S;
}
}
set_rotate(Quaternion(W, X, Y, Z));
}
void Frame::cache()
{
m00 = (1 - (m_angles.y * (m_angles.y * 2))) - (m_angles.z * (m_angles.z * 2));
m01 = (m_angles.x * (m_angles.y * 2)) + (m_angles.w * (m_angles.z * 2));
m02 = (m_angles.x * (m_angles.z * 2)) - (m_angles.w * (m_angles.y * 2));
m10 = (m_angles.x * (m_angles.y * 2)) - (m_angles.w * (m_angles.z * 2));
m11 = (1 - (m_angles.x * (m_angles.x * 2))) - (m_angles.z * (m_angles.z * 2));
m12 = (m_angles.y * (m_angles.z * 2)) + (m_angles.w * (m_angles.x * 2));
m20 = (m_angles.x * (m_angles.z * 2)) + (m_angles.w * (m_angles.y * 2));
m21 = (m_angles.y * (m_angles.z * 2)) - (m_angles.w * (m_angles.x * 2));
m22 = (1 - (m_angles.x * (m_angles.x * 2))) - (m_angles.y * (m_angles.y * 2));
}
BOOL Frame::is_vector_equal(const Frame& F) const
{
if (fabs(m_origin.x - F.m_origin.x) >= F_EPSILON)
return FALSE;
if (fabs(m_origin.y - F.m_origin.y) >= F_EPSILON)
return FALSE;
if (fabs(m_origin.z - F.m_origin.z) >= F_EPSILON)
return FALSE;
return TRUE;
}
BOOL Frame::is_quaternion_equal(const Frame& F) const
{
if (fabs(m_angles.w - F.m_angles.w) >= F_EPSILON)
return FALSE;
if (fabs(m_angles.x - F.m_angles.x) >= F_EPSILON)
return FALSE;
if (fabs(m_angles.y - F.m_angles.y) >= F_EPSILON)
return FALSE;
if (fabs(m_angles.z - F.m_angles.z) >= F_EPSILON)
return FALSE;
return TRUE;
}
float Frame::get_heading(void) const
{
// Untested?
Vector Heading;
Heading.x = ((m00 + m20) * 0.0f) + m10;
Heading.y = ((m01 + m21) * 0.0f) + m11;
return fmod(450 - D3DXToDegree(atan2(Heading.y, Heading.x)), 360);
}
Position::Position(const Position& Pos)
{
*this = Pos;
}
Position::Position()
{
m_LandCell = 0;
}
Position::~Position()
{
}
Position& Position::operator=(const Position& Pos)
{
m_LandCell = Pos.m_LandCell;
m_Frame = Pos.m_Frame;
return *this;
}
ULONG Position::pack_size()
{
// Actually: sizeof(DWORD) + m_Frame.Pack(.., 0);
return(sizeof(DWORD) + m_Frame.pack_size());
}
BOOL Position::UnPack(BYTE **ppData, ULONG iSize)
{
if (iSize < pack_size())
return FALSE;
UNPACK(DWORD, m_LandCell);
return UNPACK_OBJ(m_Frame);
}
ULONG Position::origin_pack_size()
{
// This function was made up.
return(sizeof(DWORD) + m_Frame.m_origin.pack_size());
}
BOOL Position::UnPackOrigin(BYTE **ppData, ULONG iSize)
{
if (iSize < origin_pack_size())
return FALSE;
UNPACK(DWORD, m_LandCell);
return UNPACK_OBJ(m_Frame);
}
BOOL Position::operator==(const Position& Pos) const
{
if (m_LandCell != Pos.m_LandCell)
return FALSE;
if (!m_Frame.is_vector_equal(Pos.m_Frame))
return FALSE;
if (!m_Frame.is_quaternion_equal(Pos.m_Frame))
return FALSE;
return TRUE;
}
Vector Position::localtolocal(const Position& Pos, const Vector& Offset) const
{
Vector cell_offset = Pos.m_Frame.localtoglobal(Offset);
Vector block_offset =
LandDefs::get_block_offset(m_LandCell, Pos.m_LandCell);
return m_Frame.globaltolocal(block_offset + cell_offset);
}
Vector Position::globaltolocalvec(const Vector& point) const
{
return m_Frame.globaltolocalvec(point);
}
Vector Position::localtoglobal(const Position& Pos, const Vector& point) const
{
Vector cell_offset = Pos.m_Frame.localtoglobal(point);
Vector block_offset =
LandDefs::get_block_offset(m_LandCell, Pos.m_LandCell);
return(block_offset + cell_offset);
}
Vector Position::localtoglobal(const Vector& point) const
{
// DOES NOT factor in block offsets
return m_Frame.localtoglobal(point);
}
// Duplicate function name? sub_42A3C0
Vector Position::get_offset(const Position& pos) const
{
Vector block_offset =
LandDefs::get_block_offset(m_LandCell, pos.m_LandCell);
Vector global_offset = block_offset + pos.m_Frame.m_origin - m_Frame.m_origin;
return global_offset;
}
Vector Position::get_offset(const Position& pos, const Vector& rotation) const
{
Vector block_offset =
LandDefs::get_block_offset(m_LandCell, pos.m_LandCell);
Vector rotated_origin = pos.localtoglobal(rotation);
return(block_offset + rotated_origin - m_Frame.m_origin);
}
float Position::distance(const Position& pos) const
{
return get_offset(pos).magnitude();
}
/*
void Render::CalcObjectMatrix()
{
D3DXMATRIX ObjectMatrix;
ObjectMatrix._11 = object_scale_vec.x * FrameCurrent.m[0][0]; // 0x40
ObjectMatrix._21 = object_scale_vec.y * FrameCurrent.m[1][0]; // 0x4C
ObjectMatrix._31 = object_scale_vec.z * FrameCurrent.m[2][0]; // 0x58
ObjectMatrix._41 = FrameCurrent.m_origin.x;// FrameCurrent.m_fScale[0]; // 0x64
ObjectMatrix._12 = object_scale_vec.x * FrameCurrent.m[0][2];
ObjectMatrix._22 = object_scale_vec.y * FrameCurrent.m[1][2];
ObjectMatrix._32 = object_scale_vec.z * FrameCurrent.m[2][2];
ObjectMatrix._42 = FrameCurrent.m_origin.z;// FrameCurrent.m_fScale[2]; // 0x6C
ObjectMatrix._13 = object_scale_vec.x * FrameCurrent.m[0][1];
ObjectMatrix._23 = object_scale_vec.y * FrameCurrent.m[1][1];
ObjectMatrix._33 = object_scale_vec.z * FrameCurrent.m[2][1];
ObjectMatrix._43 = FrameCurrent.m_origin.y;// FrameCurrent.m_fScale[1]; // 0x68
ObjectMatrix._14 = 0.0f;
ObjectMatrix._24 = 0.0f;
ObjectMatrix._34 = 0.0f;
ObjectMatrix._44 = 1.0f;
SetWorldMatrix(&ObjectMatrix);
}
*/