Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
This question was closed Jun 10, 2020 at 12:58 PM by pako for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by link30224 · Jun 07, 2018 at 06:21 PM · doublefloatingpoint

Why don't you allow doubles and or long for Vector3 and Quaternion....?

this is the most frustrating thing to not be allowed to use doubles for this as float isn't up to the precision that i require. ,I think this is a major flaw with unity to not allow anything but floats for Vector3's at this point it makes me not want to use the game engine at all and see if unreal engine allows me to do it and if I find out it does i'm probably going to immediately switch to unreal.

Comment
Add comment · Show 2
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 toddisarockstar · Jun 08, 2018 at 01:26 AM 0
Share

floats have 32 bit precition. another words the accuracy of an objects position is approximatly 2,147,483,647 possibilitys across the moniter,. which is far far more acurracy than what could be displayed on a users screen witch is limited to 1080 parts/pixels for the screen). if you describe what you need this precition for or what you are not able to accomplish through unity. im sure someone here can answer your question if you are specific about your problem.

avatar image Hellium · Jun 08, 2018 at 07:08 AM 0
Share

If you are not satisfied with the Unity's Vector and Quaternions, you can create your own custom structs with double / long. But you will have to reimplement all the functions currently taking floats (including the $$anonymous$$athf class)

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by MaximBesters · Jun 10, 2020 at 12:23 PM

Unreal also works with floats. I think the underlying engine (D3D / or opengl) use float too. Float is faster and Processor performance is often indicated in flops: (floating point operations per second) and that is what a cpu is optimized for.

Imagine a space scene with planets in a galaxy and houses on the planets. You would measure everything in meters (or feet, whatever) and the distance to the outer planets of your galaxy would be around 100,000,000,000,000,000,000 meters (units). Even a double only has 16 decimal places. (opposed to 7 or 8 in a float) That would make our sun look like a cube of one double precision unit in size. Also, the Unity scene view would be useless. You;d see an empty scene with tiny specs for solar systems even planets would be totally invisible.

You can use workarounds for this because you hardly really need double precision, actually. You could, for instance, have multiple camera's in different spaces. One camera for the total overview (everything will be smaller than one pixel, so not sure what you'd show here) Scale the whole galaxy down a billion times. No-one would notice. A camera for on the planet, or even a special camera for inside a city, With some clever math you can seamlessly integrate the blending of the camera. See where I am going? I hope this all makes any sense.

Comment
Add comment · 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

Follow this Question

Answers Answers and Comments

84 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How should I convert timestamp in unity, which is a double, in a webserver-like BIGINT number ? 5 Answers

Is iPhoneInput.lastLocation.timestamp broken on Android ? 2 Answers

How do I initialize a float texture by script? 1 Answer

Why this prints (0, 0, 0): Debug.Log("" + ((new Vector3(1, 0, 0)) * 0.016f)); 1 Answer

About character doublejumping. 1 Answer


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