Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by _-_ · May 27, 2013 at 01:19 PM · c#monossesimd

Mono.Simd not working properly

In my previous question (http://answers.unity3d.com/questions/462539/how-to-use-monosimd.html), I've asked how I could use Mono.Simd in my project. I got that sort of working right now (I did that by taking "mono.simd.dll" and putting it in my assets in the project). And now I can create vector, which seems to use SSE/SIMD to improve speed (since multiplying a bunch of Vector4f's with each other is significantly faster than just multiplying 4 floats). The only problem is that only half of the things are working, I can use *, -, + and / to do basic operations on vectors, however I can't use any function, such as Sqrt(), InvSqrt(), or Reciprocal() for example (see the Mono.simd-documentation http://docs.go-mono.com/?link=N%3aMono.Simd).

For example:

 Vector4f V1 = new Vector4f(0.5f,0.8f,1.6f,38.5f); //Create a vector
 V1.Sqrt(); //Take the squareroot of this vector
 UnityEngine.Debug.Log(V1); //Show results

Just outputs <0.5, 0.8, 1.6, 38.5>

It doesn't matter what function I take or with what vectors I try it with (Vector2d, Vector4f, Vector4i, Vector 8s and so forth), I always get the exact same numbers I put in the vector to begin with (but, as mentioned, *-+ and / do work as they're supposed to work). Does anyone know what I'm doing wrong here (BTW, my computerchip handles SSE up and till 4, so that's not the problem)?

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 Graham-Dunnett ♦♦ · May 27, 2013 at 01:52 PM 0
Share

Do you have this working correctly in a native $$anonymous$$ono application? Looking at the docs for the Sqrt function over on the $$anonymous$$ono site it looks to me that the function returns a Vector4f.

avatar image _-_ · May 27, 2013 at 09:53 PM 0
Share

No, I've got the exact same problem if I'm using it in a native $$anonymous$$ono application. And the functions should take one vector, and changing that vector, so you can't say Vector2 = Vector1.Sqrt(), but you have to be using it like Vector1.Sqrt() (which takes the squareroot of every number inside that vector).

Does anyone else have any suggestions on how to fix this? Or does anyone need more information in order to help?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by _-_ · May 27, 2013 at 10:21 PM

Fixed it, turned out the correct syntax was "Vector1 = Vector1.Sqrt()" after all. Pretty sure I've tried that at least a hundred times yesterday, but I guessed I overlooked something since it was late.

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

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.

Follow this Question

Answers Answers and Comments

14 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Support the MONO AOT Compilation on Android 0 Answers

Mono library to connect to Java/Python/Node backend? 1 Answer

Compatibility level and writing *.txt files 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