Got concave corners working:
Now I have concave/convex/"straight" edges and concave/convex corners working (i.e. all geometry that's possible in my game).
Raycasting in spherical 2D [custom algorithm]
I created a mobius strip in my game, this means that you can walk on both the outside and inside of the 2D surface by going around the circuit "twice".
Here's a link to another mobius strip in case you're curious of what a 3D version looks like in real life: https://www.youtube.com/watch?v=Vxror-fnOL4
Why yes, math is useful outside school
1) I'm loving the zoom effect in 2D virtual reality.
2) My camera code just got really simple.
3) Today marks the first day (technically) I've played a 2D virtual reality game, since I previously has the typical 65mm eye-to-eye distance.
This is approximately the 10th time I've gotten collisions/movement "working" with all of the 6+ prototypes and constant refactoring.
Now I have a custom collider component that I can add to objects, though.
Just got my 3-sphere collision system working:
The intersection of two spheres captures a collision for a circle in 3D space, and three spheres captures an arc in 3D space.
This is a nice read for Unity programmers on how to use Update/FixedUpdate less:
Until just now I was planning on only supporting FixedUpdate for my game engine XD
I mean, even if I did do that, I forgot that inputs gets "eaten" if you write your code that way.
It's also inefficient, of course.
My code is getting so fast, all of these optimizations make me so happy :D
Also, it's so interesting when I get to support another Unity feature (previously deemed "too slow") e.g. CollisionDetectionMode.Continuous
Poll: what do people think when they see "2D VR"?
Rendering is more or less done, off to work on Rigidbodies and refactor Colliders.
Unity (programming) PSA: Show more
Remember that UnityEngine.Object overrides the definition of "null".
This is an example for an optional<Type> C# generics:
To determine if the object existed I (erroneously) set `exists = (original != null);` (spoiler: that doesn't work).
If you care about speedrunning design:
Research & development might just be my favorite asocial activity.
~2.5 years - 6 months ago I was frequently saying there were far better candidates for making my project(s) but it turns out I'm pretty good at making the new algorithms and architectures.
I might have found another 2D VR game: The Lost Bear
It seems to be a 2D + 3D VR game throughout, but I'm gonna try to find a way to play it.
And--not even--it's easier than that: https://answers.unity.com/questions/705717/same-sorting-layer-and-order-in-layer-rendering.html
This is so amazingly easy compared to what I was doing before.
I get to delete a lot of code and just switch to a random sortingOrder + user defined sortingLayer.
Lol, I'm a scrub, the "Beginner" Unity tutorial explains sortingOrder really well:
This will definitely work better than my solution, although I might have to do something about ZWriting/ZTesting for shaders depending on how that works (maybe Offset?).
Hey Unity programmers:
What are the downsides to using Renderer.sortingOrder?
Can it batch meshes/sprites effectively (for sortingOrder sequences with the same shader) or are there weird gotchas?
I realized like 2 minutes ago I was doing so many z-buffer/z/distance calculations (to hand craft positions that wouldn't z-fight), which feels like it's the wrong way to approach the problem.
Programmers: Show more
I was just reminded of this tweet: https://twitter.com/ID_AA_Carmack/status/908488180512575489
clamp(minimum, maximum, value),
clamp(minimum, value, maximum),
clamp(value, maximum, minimum),
clamp(value, minimum, maximum),
or one of the other two permutations,
and why? [needn't be C++]
Subquestion: any overloads or defaults?