DP md3 tag origin question

Discuss programming in the QuakeC language.
Post Reply
silverjoel
Posts: 52
Joined: Thu Sep 30, 2010 6:46 am

DP md3 tag origin question

Post by silverjoel »

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?
Supa
Posts: 164
Joined: Tue Oct 26, 2004 8:10 am

Re: DP md3 tag origin question

Post by Supa »

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
silverjoel
Posts: 52
Joined: Thu Sep 30, 2010 6:46 am

Re: DP md3 tag origin question

Post by silverjoel »

Thanks, I just found that myself. It can be a pain to read through all of dpextensions.qc.
Post Reply