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

Function xEntMove

src/SB/Core/x/xEnt.cpp:1115–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113}
1114
1115void xEntMove(xEnt* ent, xScene* sc, F32 dt)
1116{
1117 if (ent->moreFlags & 0x20)
1118 {
1119 anim_coll::pre_move(*ent);
1120 }
1121
1122 ent->move(ent, sc, dt, ent->frame);
1123
1124 xEntMotionToMatrix(ent, ent->frame);
1125
1126 if (ent->driver)
1127 {
1128 xEntFrame* dframe = ent->driver->frame;
1129
1130 if (ent->driveMode == 0)
1131 {
1132 xVec3 dpos;
1133 xVec3Sub(&dpos, &dframe->mat.pos, &dframe->oldmat.pos);
1134
1135 ent->transl(ent, &dpos, NULL);
1136 }
1137 else if (ent->driveMode == 1)
1138 {
1139 RwMatrixUpdate((RwMatrix*)&dframe->oldmat);
1140
1141 xMat4x3 invOldmat;
1142 RwMatrixInvert((RwMatrix*)&invOldmat, (RwMatrix*)&dframe->oldmat);
1143
1144 xMat4x3 deltaMat;
1145 xMat4x3Mul(&deltaMat, &invOldmat, &dframe->mat);
1146
1147 ent->transl(ent, NULL, &deltaMat);
1148 }
1149 }
1150
1151 if (ent->moreFlags & 0x20)
1152 {
1153 anim_coll::post_move(*ent);
1154 }
1155}
1156
1157namespace
1158{

Callers 3

ProcessMethod · 0.70
update_stacked_entityFunction · 0.70
xEntUpdateFunction · 0.70

Calls 6

pre_moveFunction · 0.85
xEntMotionToMatrixFunction · 0.85
xVec3SubFunction · 0.85
xMat4x3MulFunction · 0.85
post_moveFunction · 0.85
moveMethod · 0.45

Tested by

no test coverage detected