• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Apollo · May 16, 2012 at 11:47 PM · rotationphysicsspaceangleaxis

AngularDrag -> in Just one plane

To be honest I don't fully understand angular drag: how can i use it in only on one or two planes? (ie. xyz)

I'd assume angular drag was for airplanes, but what part of an airplane pulls an equal amount of drag in every direction???

Anyway, i'm using angular drag to stabilize a space flight sim that uses RelativeTorque to spin, and angular drag to stabilize, but i don't want my object to stabilize in every direction at once, rather, once in each plane (xyz or pitch/yaw/roll)

My Question: can some one tell me how to use angularDrag in just ONE plane?

something like: rigidbody.angularDrag.x = myAngularDrag1;

obviously not a real line, but is there something like this?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · May 16, 2012 at 11:59 PM

Real drag is generated by the air-resistance of the surfaces. In most game / physics engines such calculations would be way too heavy and you actually need to consider the true shape of the object.

The drag values are just simulated drag which is just dependent on the velocity / angularVelocity. It actually wouldn't make sense to implement 3 different drag values for each local space axis since the object could have any shape (something diagonal or whatever).

I see two ways to implement the individual drag values for each local space axis:

  • Use the angularVelocity vector, bring it into local space so you know around which axis you're rotating. Normalize this vector and multiply each component with your desired drag values. Finally add up all 3 values and assign it to angularDrag. This of course need to be done in FixedUpdate.

  • The second way is to implement the drag behaviour yourself. Usually accelerated / decelerated calculations can be tricky to get them frame independent, but if you use FixedUpdate it should be easier ;)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Apollo · May 17, 2012 at 01:15 AM 0
Share

Thanks for the quick reply!

i'm not sure how to "bring it into local space so you know around which axis you're rotating", the angularVelocity vector just yields one number (magnitude) but i don't know what axis it's on or how to assign it to one :/

if i can identify the current rotation of an object, it would be super easy to just write a line for counter thrust, but i've yet to find a way of returning an objects rotation...

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotate to direction slowing as you arrive 0 Answers

Constant 3D rotation (torque, angular acceleration, etc) GLOBAL to object in space? 1 Answer

How to limit the motion direction of a GameObject? 1 Answer

reproducing hingejoint.angle 0 Answers

How to set a limit for my player rotation ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges