+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 18

Thread: applyOffsetForce for aim?

  1. #1
    Wirererer vexx21322 can only hope to improve vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    251

    Default applyOffsetForce for aim?

    How can I apply applyOffsetForce() to aim a barrel?


    I want to aim the up() of the barrel at my aim with applyOffsetForce()
    Last edited by Magos Mechanicus; 02-08-2010 at 02:33 AM. Reason: Merging doublepost
    Have you checked HERE first?


  2. #2
    Master of Mars
    Magos Mechanicus will become famous soon enough Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    721

    Default Re: applyOffsetForce for aim?

    I'd suggest trying the applyTorque method. It's great for when you have a direction vector you want to aim in some direction.
    I can wire anything directly into anything! I'm the Professor!
    -Professor Hubert Farnsworth

  3. #3
    Wirererer vexx21322 can only hope to improve vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    251

    Default Re: applyOffsetForce for aim?

    I don't think that will work.
    Have you checked HERE first?


  4. #4
    Expressionism 2.0

    Syranide has disabled reputation Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,179

    Default Re: applyOffsetForce for aim?

    applyOffsetTorque would have been handy for something like this.

  5. #5
    Wirererer vexx21322 can only hope to improve vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    251

    Default Re: applyOffsetForce for aim?

    Can you help me understand how to use it?
    Have you checked HERE first?


  6. #6
    Expressionism 2.0

    Syranide has disabled reputation Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,179

    Default Re: applyOffsetForce for aim?

    Quote Originally Posted by vexx21322 View Post
    Can you help me understand how to use it?

    It does not exist at the moment.

  7. #7
    Wire Sofaking
    Divran will become famous soon enough Divran will become famous soon enough Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    1,265

    Default Re: applyOffsetForce for aim?

    Quote Originally Posted by vexx21322 View Post
    I don't think that will work.
    Yes it will.

    Code:
    Mul1 = 1000
    Mul2 = 20
    TargetAngle = (owner():aimPos() - E:pos()):toAngle() + ang(90,0,0) #<- notice +ang 90 will make it aim with the UP dir. (Edit: or maybe - ang 90)
    Torque = E:toLocal(rotationVector(quat(TargetAngle) / quat(E))+E:pos())
    E:applyTorque((Torque*Mul1-E:angVelVector()*Mul2)*E:inertia())
    
    PewPew (New GCombat): http://www.wiremod.com/forum/wiremod...w-gcombat.html
    SVN TUTORIAL: http://www.facepunch.com/showthread.php?t=688324
    E2 THREAD: http://www.wiremod.com/forum/custom-...ns-thread.html
    MY SVN LINK:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    

  8. #8
    Wirererer vexx21322 can only hope to improve vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    251

    Default Re: applyOffsetForce for aim?

    Haha, I understood till the 4th line. Mind explaining what quat() and some others do?
    Have you checked HERE first?


  9. #9
    Wire Noob lollybobi is on a distinguished road lollybobi's Avatar
    Join Date
    Aug 2009
    Posts
    11

    Default Re: applyOffsetForce for aim?

    I would solve it with setAng(), as this will be more acurrate and wont fail at all.

    I personally don't like to do aiming with force, as it's not 100% acurrate

  10. #10
    Wire Sofaking
    Divran will become famous soon enough Divran will become famous soon enough Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    1,265

    Default

    Quote Originally Posted by vexx21322 View Post
    Haha, I understood till the 4th line. Mind explaining what quat() and some others do?
    Go look at the applyTorque tutorial. I only posted that messy code because I assumed you had already read the tutorial so that you would understand it (at least somewhat understand it...).

    Quote Originally Posted by lollybobi View Post
    I personally don't like to do aiming with force, as it's not 100% acurrate
    Orly. (Tip: fullscreen)
    Extremely fucking accurate turret - Xfire Video

    Edit: Oops double post.
    Last edited by Magos Mechanicus; 02-08-2010 at 07:03 AM. Reason: Oops indeed.
    PewPew (New GCombat): http://www.wiremod.com/forum/wiremod...w-gcombat.html
    SVN TUTORIAL: http://www.facepunch.com/showthread.php?t=688324
    E2 THREAD: http://www.wiremod.com/forum/custom-...ns-thread.html
    MY SVN LINK:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts