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

Method Rotate

code/icarus/TaskManager.cpp:1240–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1238*/
1239
1240int CTaskManager::Rotate( CTask *task , CIcarus* icarus)
1241{
1242 vec3_t vector;
1243 CBlock *block = task->GetBlock();
1244 char *tagName;
1245 float tagLookup, duration;
1246 int memberNum = 0;
1247
1248 //Check for a tag reference
1249 if ( Check( CIcarus::ID_TAG, block, memberNum ) )
1250 {
1251 memberNum++;
1252
1253 ICARUS_VALIDATE( Get( m_ownerID, block, memberNum, &tagName, icarus ) );
1254 ICARUS_VALIDATE( GetFloat( m_ownerID, block, memberNum, tagLookup, icarus ) );
1255
1256 if ( icarus->GetGame()->GetTag( m_ownerID, tagName, (int) tagLookup, vector ) == false )
1257 {
1258 //TODO: Emit warning
1259 icarus->GetGame()->DebugPrint(IGameInterface::WL_ERROR, "Unable to find tag \"%s\"!\n", tagName );
1260 assert(0);
1261 return TASK_FAILED;
1262 }
1263 }
1264 else
1265 {
1266 //Get a normal vector
1267 ICARUS_VALIDATE( GetVector( m_ownerID, block, memberNum, vector, icarus ) );
1268 }
1269
1270 //Find the duration
1271 ICARUS_VALIDATE( GetFloat( m_ownerID, block, memberNum, duration, icarus ) );
1272
1273 icarus->GetGame()->DebugPrint(IGameInterface::WL_DEBUG, "%4d rotate( <%f,%f,%f>, %d); [%d]", m_ownerID, vector[0], vector[1], vector[2], (int) duration, task->GetTimeStamp() );
1274 icarus->GetGame()->Lerp2Angles( task->GetGUID(), m_ownerID, vector, duration );
1275
1276 return TASK_OK;
1277}
1278
1279/*
1280-------------------------

Callers

nothing calls this directly

Calls 7

DebugPrintMethod · 0.80
Lerp2AnglesMethod · 0.80
GetBlockMethod · 0.45
GetTagMethod · 0.45
GetGameMethod · 0.45
GetTimeStampMethod · 0.45
GetGUIDMethod · 0.45

Tested by

no test coverage detected