Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

DP MOVETYPEFOLLOW

From Quake Wiki

Revision as of 02:14, 25 March 2013 by Hectate (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

.movetype definitions:

float MOVETYPE_FOLLOW = 12;

MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:

  • aiment - the entity this is attached to.
  • punchangle - the original angles when the follow began.
  • view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
  • v_angle - the relative angles.

Here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:

hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
hole.solid = SOLID_NOT;          // MOVETYPE_FOLLOW is always non-solid
hole.aiment = bmodel;            // make the hole follow bmodel
hole.punchangle = bmodel.angles; // the original angles of bmodel
hole.view_ofs = hole.origin - bmodel.origin; // relative origin
hole.v_angle = hole.angles - bmodel.angles;  // relative angles