MCPcopy Create free account
hub / github.com/JACoders/OpenJK / GetOriginAxisFromBolt

Method GetOriginAxisFromBolt

codemp/client/FxSystem.cpp:114–147  ·  view source on GitHub ↗

------------------------------------------------------

Source from the content-addressed store, hash-verified

112
113//------------------------------------------------------
114qboolean SFxHelper::GetOriginAxisFromBolt(CGhoul2Info_v *pGhoul2, int mEntNum, int modelNum, int boltNum, vec3_t /*out*/origin, vec3_t /*out*/axis[3])
115{
116 qboolean doesBoltExist;
117 mdxaBone_t boltMatrix;
118 TCGGetBoltData *data = (TCGGetBoltData*)cl.mSharedMemory;
119 data->mEntityNum = mEntNum;
120 CGVM_GetLerpData();//this func will zero out pitch and roll for players, and ridable vehicles
121
122 //Fixme: optimize these VM calls away by storing
123
124 // go away and get me the bolt position for this frame please
125 doesBoltExist = re->G2API_GetBoltMatrix(*pGhoul2, modelNum, boltNum,
126 &boltMatrix, data->mAngles, data->mOrigin, theFxHelper.mOldTime, 0, data->mScale);
127
128 if (doesBoltExist)
129 { // set up the axis and origin we need for the actual effect spawning
130 origin[0] = boltMatrix.matrix[0][3];
131 origin[1] = boltMatrix.matrix[1][3];
132 origin[2] = boltMatrix.matrix[2][3];
133
134 axis[1][0] = boltMatrix.matrix[0][0];
135 axis[1][1] = boltMatrix.matrix[1][0];
136 axis[1][2] = boltMatrix.matrix[2][0];
137
138 axis[0][0] = boltMatrix.matrix[0][1];
139 axis[0][1] = boltMatrix.matrix[1][1];
140 axis[0][2] = boltMatrix.matrix[2][1];
141
142 axis[2][0] = boltMatrix.matrix[0][2];
143 axis[2][1] = boltMatrix.matrix[1][2];
144 axis[2][2] = boltMatrix.matrix[2][2];
145 }
146 return doesBoltExist;
147}

Callers 2

UpdateMethod · 0.45
AddScheduledEffectsMethod · 0.45

Calls 1

CGVM_GetLerpDataFunction · 0.85

Tested by

no test coverage detected