Forum

DP md3 tag origin question

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

DP md3 tag origin question

Postby silverjoel » Sat Feb 23, 2013 7:12 am

It seems in DP(maybe other engines) that the setattchment function gives the entity an origin of '0 0 0'. So, as the owning model's origin moves, the attachment's origin still stays at '0 0 0'. Does anyone know a way to get the actual origin of the model attached? Or better yet, a tag on the model that is attached?
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am

Re: DP md3 tag origin question

Postby Supa » Sat Feb 23, 2013 7:50 am

dpextensions.qc wrote://DP_QC_GETTAGINFO
//idea: VorteX, LordHavoc
//DarkPlaces implementation: VorteX
//builtin definitions:
float(entity ent, string tagname) gettagindex = #451;
vector(entity ent, float tagindex) gettaginfo = #452;
//description:
//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
aut viam inveniam aut faciam
User avatar
Supa
 
Posts: 164
Joined: Tue Oct 26, 2004 8:10 am

Re: DP md3 tag origin question

Postby silverjoel » Sat Feb 23, 2013 7:55 am

Thanks, I just found that myself. It can be a pain to read through all of dpextensions.qc.
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest