Skip to content

Commit

Permalink
document function BotAimAtLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweet authored and Sweet committed Dec 22, 2023
1 parent d3e51d1 commit 9023d1b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sgame/sg_bot_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,19 @@ void BotAimAtEnemy( gentity_t *self )
}
}

// the argument 'target' is somehow related to the bot's frame of reference.
// that is, it only works with the usual absolute coordinates if the bot's
// current normal vector (x, y, z) is (0, 0, 1), as given by:
// vec3_t normalVector;
// BG_GetClientNormal( &self->client->ps, normalVector);
// this is not the case if an alien bot activates the wall climb, and is on
// a non-horizontal surface.
// TODO:
// maybe make two functions instead of this one:
// - BotAimAtLocationRelative (this function)
// - BotAimAtLocationAbsolute (for locations in the global frame of reference)
// alternatively, provide a linear map and its inverse, to transform between
// the two frames of reference.
void BotAimAtLocation( gentity_t *self, const glm::vec3 &target )
{
glm::vec3 aimVec, aimAngles, viewBase;
Expand Down

0 comments on commit 9023d1b

Please sign in to comment.