//idea: LordHavoc
//darkplaces implementation: LordHavoc
//globals:
-.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
-float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
-float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
-float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
+.int dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+int trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
+int trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+int trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
string trace_dphittexturename; // texture name of impacted surface
//constants:
const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
vector oldup = v_up;
vector v = eyetarget - self.origin;
vector modeleyetarget;
- modeleyetarget_x = v * v_forward;
- modeleyetarget_y = 0-v * v_right;
- modeleyetarget_z = v * v_up;
+ modeleyetarget.x = v * v_forward;
+ modeleyetarget.y = 0-v * v_right;
+ modeleyetarget.z = v * v_up;
// this is an eyeball, make it point at the target location
// first get all the data we can...
vector relorg = skel_get_bonerel(self.skeletonindex, bonenum);
// get the vector from the eyeball to the target
vector u = modeleyetarget - boneorg;
// now transform it inversely by the parent matrix to produce new rel vectors
- v_x = u * parentforward;
- v_y = u * parentright;
- v_z = u * parentup;
+ v.x = u * parentforward;
+ v.y = u * parentright;
+ v.z = u * parentup;
vector ang = vectoangles2(v, relup);
- ang_x = 0 - ang.x;
+ ang.x = 0 - ang.x;
makevectors(ang);
// set the relative bone matrix
skel_set_bone(self.skeletonindex, bonenum, relorg);