From: <qu...@ca...> - 2016-08-23 04:41:59
|
On 2016-08-22 12:38, Cobalt wrote: > Trying to figure out the roll value on an ent that I am basicly > sticking to > a wall, in this case its a gib. The code works pretty well, I gather what you want is the appearance of the gib "rolling" down the wall. I know if you want to rotate around the Z axis, you set avelocity_y... So what you likely want is some combination of _x or _z and the model facing. You might also want: MOVETYPE_TOSS = 6; // gravity Dont gibs already have that set? > self.avelocity = (vectoangles (trace_plane_normal) + self.size) * > 0.05; // This is the main calc Does this do what you want? > self.velocity_z = vlen (self.size) * -1.125; // Downward > depending on > overall size This would move something in a negative z direction. Not sure about using size to calculate the vector. What about walls that shift away from a 90 degree vertical plane? (This is the same issue as the corner problem.) makevectors(trace_plane_normal); v_up should now point vertically up along the face of the wall. Negate that for a velocity_z. > self.avelocity = (random()) * (vectoangles (self.size) + vectoangles > (self.velocity)); This will impart some random rotational velocity. > Im only grabbing trace_plane_normal once in the gibs touch field, as > Darkplaces accurately populates that field > in any .touch usually very accurately, but I think perhaps I would need > to > do a traceline continually as the gib falls You indeed must call traceline to populate the normal field. > in its think because its possible the surface of the wall may change as > well > as it reaching a corner, in which case we can either > make it fall to the floor or just hang there and bleed for a while. Some version of this "should" work: self.angles = vectoangles(trace_plane_normal); // face the normal - note this will "jump" if not close to this facing self.avelocity_z = 30; // or your size / velo based calculation -- negate if it rolls the wrong way if that isnt it try self.avelocity_x. You may also want to try setting angles to v_right (you need makevectors(trace_plane_normal); to get them.) Another thing to _possibly_ look into (it gets implemented in the HD pack) is the gyro physics package. http://www.quakewiki.net/quake-1/mods/gyro/ http://quakeone.com/forums/quake-mod-releases/finished-works/6076-small-mod-compilation.html > Added adjustable Gyro physics: Monsters, gibs and backpacks interact > with liquids and weapon projectiles Whether that will do what you want, I cant say. Nor how it gets implemented. You could install and load the small mod. I know one feature is "kicking" gibs, by walking on them. You could make some gibs, kick them around and see what they do near walls. |