Hello, I've been working on a simple auto turret based on code in server/hl2/func_tank.cpp, and I've got a few questions about making something like a turret barrel rotate smoothly when tracking a target:
- func_tank uses SetMoveDoneTime() in a few places, but it never sets the callback with SetMoveDone(). I've a little confused by this, because I figured that it would/should use SetMoveDone() to reevaluate whether or not the barrel should stop rotating, but instead it does this on every think interval by calling SetLocalANgularVelocity(vec3_angle). Why does this class bother setting SetMoveDoneTime()? - In my turret code that's based on func_tank, I tried using SetMoveDone() and SetMoveDoneTime(), but the callback never got called... After looking through the sdk a bit, I'm wondering if these functions are only for vphysics/MOVETYPE_PUSH objects? Why? - In any event, right now when I want to aim the turret barrel at a target now, I just call SetLocalAngles() instead of SetLocalAngularVelocity(). I suppose this would produce choppy rotation in a network with more latency, and ideally, I'd like to have smooth rotation. What's the best way to do something like that? It seems like if I use SetLocalAngularVelocity() the rotation might be smooth, but if the Think interval isn't fast enough, the turret barrel willl never be able to stop when it reaches the ideal/target angle. Is there a good way to tell an object to smoothly rotate until it reaches an target angle? - Right now my turret has a fixe base and a head model that gets rotated with SetLocalAngles(), but I'd like to use a model that takes yaw/pitch parameters to achieve this animation. Are there any good examples of models and QC files that can pitch 360 degrees and have a more limited yaw range? Should I just make a model that takes a yaw pose parameter for vertical aiming, and then use something like SetLocalAngles() to control the pitch? What would this look like in QC (an animation/sequence that only takes a yaw parameter)? Sorry for all of the questions, but on a separate note: - I've made several player models and did the aim layer animation similar to the SDK examples for humans (hl2mp), but I have one problem: The aim direction appears to be inverted! (using thirdperson to view) I tried inverting the parameters in the QC file, but it doesn't appear to have any effect. I think I've reached the point where I need to really understand how the animation blending subsystem works so that I can sort out these aim layer problems, and maybe make a turret model as well. There's no documentation about "calcblend", and despite tons of googling, I still don't fully understand the blend/blendwidth options for generating sequences (the order of the aim directions, how the input parameter affects which two keyframes are being interpolated...). Does anyone have some definitive examples of how blending works, or is there some really detailed documentation of these features somewhere? Any help on this subject would be very helpful. Thanks, Eric _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders