MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xEntDriveMount

Function xEntDriveMount

src/SB/Core/x/xEntDrive.cpp:27–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void xEntDriveMount(xEntDrive* drv, xEnt* driver, F32 mt, const xCollis* coll)
28{
29 if (drv->driven == NULL || drv->driven->frame == NULL || driver == NULL ||
30 driver->frame == NULL)
31 {
32 xEntDriveInit(drv, drv->driven);
33 return;
34 }
35 drv->dloc = 0.0f;
36 if (driver == drv->odriver && drv->os)
37 {
38 drv->driver = driver;
39 driver->driving_count++;
40 if (mt < 0.0f)
41 {
42 drv->s = 1.0f;
43 drv->tmr = 0.0f;
44 }
45 else
46 {
47 drv->s = drv->os;
48 drv->tmr = mt * (1.0f - drv->s);
49 }
50
51 drv->tm = mt;
52 drv->odriver = NULL;
53 drv->os = 0.0f;
54 drv->otm = 0.0f;
55 drv->otmr = 0.0f;
56 }
57 else
58 {
59 drv->driver = driver;
60 driver->driving_count++;
61 if (mt < 0.0f)
62 {
63 drv->s = 1.0f;
64 drv->tmr = 0.0f;
65 }
66 else
67 {
68 drv->s = 0.0f;
69 drv->tmr = mt;
70 }
71 drv->tm = mt;
72 }
73
74 xVec3 euler;
75 xMat3x3 a_descaled;
76 if (drv->flags & 1)
77 {
78 {
79 F32 len2 = SQR(drv->driver->frame->mat.right.x) + SQR(drv->driver->frame->mat.right.y) +
80 SQR(drv->driver->frame->mat.right.z);
81 if (xabs(len2 - 1) <= 0.00001f)
82 {
83 a_descaled.right.x = drv->driver->frame->mat.right.x;
84 a_descaled.right.y = drv->driver->frame->mat.right.y;

Callers 3

CollideReviewMethod · 0.50
zEntPickupEventCBFunction · 0.50
zPlatformEventCBFunction · 0.50

Calls 6

xEntDriveInitFunction · 0.85
xsqrtFunction · 0.85
xMat4x3TolocalFunction · 0.85
xVec3CopyFunction · 0.85
xMat3x3GetEulerFunction · 0.70
xCollisTriHitFunction · 0.70

Tested by

no test coverage detected