![]() |
![]() |



Author: Mattxl
Date Submitted: 2003-12-15 22:24:04
void DrawWeapon(void)
{
com_zeromem(&cg_weapon.weapon, sizeof(cg_weapon.weapon));
cg_EulerToAxis(cg.viewangles, cg_weapon.weapon.axis[0], cg_weapon.weapon.axis[1], cg_weapon.weapon.axis[2]);
vec3_Copy(cg.view.origin, cg_weapon.weapon.origin);
cg_weapon.weapon.model = cg_weapon.model[cg_player.current_weapon];
cg_weapon.weapon.type = ITEMTYPE_MODEL;
cipher_r_AddItemToScene(&cg_weapon.weapon);
}This displays a weapon model on the screen. cg_weapon.weapon is an iteminfo_t structure. cg_weapon.model is an array of integers that have each model loaded. cg_player.current_weapon is an integer representing the current weapon that's out. This is based on the temple demo camera and player system. The weapon model may need to be moved around in the editing software until it's where you want it in the game. Sorry no collision or animation yet.
[Recent Contributions] [Recent Source Code]
User Contributed Comments