ArBuZ Posted May 4, 2010 Posted May 4, 2010 Hi! I want to make controller to move to some point. PointEntity doesn't work with controller. But UpdateController() has angle parameter. So how can I calculate angle parameter? Thanks in advance. Best regards, Alex. Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com
DarthRaff Posted May 4, 2010 Posted May 4, 2010 Hi, I use this to point an entity to another: void SlowPointEnt(TEntity ent1,TEntity ent2,float speed) { TVec3 ent1pos=EntityPosition(ent1); TVec3 ent1rot=EntityRotation(ent1,0); TVec3 ent2pos=EntityPosition(ent2); float dx=0.0; float dy=0.0; float dz=0.0; float rz=0.0; //float speed=1.0; dx=ent1pos.X-ent2pos.X; dy=ent1pos.Y-ent2pos.Y; dz=ent1pos.Z-ent2pos.Z; rz=ent1rot.Z; return AlignToVector(ent1,Vec3(dx,rz,dz),3,speed); } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.