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

Thread: applyOffsetForce for aim?

  1. #1
    Wire Sofaking vexx21322 has a little shameless behaviour in the past vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    405

    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 will become famous soon enough Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    834

    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
    Wire Sofaking vexx21322 has a little shameless behaviour in the past vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    405

    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,504

    Default Re: applyOffsetForce for aim?

    applyOffsetTorque would have been handy for something like this.

  5. #5
    Wire Sofaking vexx21322 has a little shameless behaviour in the past vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    405

    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,504

    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
    No u

    Divran is a jewel in the rough Divran is a jewel in the rough Divran is a jewel in the rough Divran is a jewel in the rough Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    2,456

    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) | SVN Tutorial | EGP v3
    MY SVN LINK:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    


    Thanks for clicking, everyone!
    http://www.minerwars.com/?aid=927
    But if I get even more clicks, I get the full game, so keep at it!

  8. #8
    Wire Sofaking vexx21322 has a little shameless behaviour in the past vexx21322's Avatar
    Join Date
    Dec 2008
    Location
    Co, united states
    Posts
    405

    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
    20

    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
    No u

    Divran is a jewel in the rough Divran is a jewel in the rough Divran is a jewel in the rough Divran is a jewel in the rough Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    2,456

    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) | SVN Tutorial | EGP v3
    MY SVN LINK:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    


    Thanks for clicking, everyone!
    http://www.minerwars.com/?aid=927
    But if I get even more clicks, I get the full game, so keep at it!

+ 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
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots