-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 1520 calculator structure #1523
Conversation
Vector.cs * Add Equals override method * Add == and != operators
CalculatorStructure.cs * Reduce dependence on Structure.TryOperation * Throw exceptions instead of TryOperation * Give the KOSName for types instead of C# name Add unit tests for scalar and structure.
CalculatorStructure.cs * Fixed the root of the recursion issue. Some types (specifically Vector) have implicit conversions that caused TryCoerceImplicit to continue to call over and over until running out of memory.
// Check the equality of the quaternion components | ||
if (d.rotation.x == rotation.x && | ||
d.rotation.y == rotation.y && | ||
d.rotation.z == rotation.z) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnityEngine.Quaternion
already has its own Equals()
operator method defined. It might be a good idea to just defer to using that instead of re-implementing it (and I had a peek in ILSpy and it turns out what you're doing here isn't quite the same thing Unity is doing for Equals. You only compare the x
, y
, and z
and Unity is comparing all 4 components (including the w
).)
Removed milestone because we want more time to work this through and test it - just took the infnite recursion fix and nothing else for now. |
I'm adding the 1.0 milestone so that we don't miss it in that version |
…er null checking of course).
I've added .Equals and == operators to Direction and TimeStamp which didn't have them before. As I understand this is to help move away from TryOperation.