![eazydraw independent scale not available eazydraw independent scale not available](https://xamlbrewer.files.wordpress.com/2021/12/radialgaugenuget2.png)
But what about hits that aren't directly frontal, but where my spaceships collides with something at the sides?ĭo you know if there's some elegant solution to detect such hits? I've bee trying to use the detect collision function from rigidbodies and it sort of works, but there's a major problem.
#EAZYDRAW INDEPENDENT SCALE NOT AVAILABLE CODE#
There've been code suggestions for raycast collision detections and that works well enough for frontal collisions. I've just been facing a few practical problems right now that have only barely been adressed here: How do I get serious collision physics to work with a continous floating origin (CFO) setup? I'm sorry for Necroing this, I saw this thread and found it very helpful for programming my space game. By observing this error at a distance of > 10^11 (near an average Mars orbit), the reparenting magnification + whatever is done in my scripts, is around 45 times what my rule predicts. Although I use this rule, magnification tends to overwhelm it and it hard to predict when you only write some of the code: unity may contribute more than your code.įor example, I find the Unity reparenting operation generates noticeable error in the transform value. On top of that, there is the magnification of spatial resolution base error due mainly to multiplications (if you multiply a number by 10, the error is multiplied by 10). In other words, most of the time you will get 1cm or so accuracy, but occasionally it will be 4cm. So my rule (3.4*distance*machine epsilon for single/double precision) gives a value of 4cm worst-case accuracy for single precision between two points/vertices at 99,999.99 distance. My aim was to provide people with a proven way to estimate accuracy limits. The reason is that I asked myself similar questions some time ago and I ended up making some theory and rules to predict base worst-case accuracy. Awesome stuff.Ĭlick to expand.Hi I'm curious about how you arrived at 1cm accuracy for that distance. The slightly more involved process of implementing this hybrid approach is creating the script to instantiate both worlds on top of each-other, strip the mesh colliders on one, and the mesh renderers on the other - but that should not pose much difficulty for most Unity programmers.īig thanks to CosmoChristo for his posts and research papers. Since player rotation is generally local anyway I believe you can just use a direct copy of the player's rotation from the "regular collision layer" for most situations. A good piece of advice to make your life easier is to simply use the reverse transform.position on the CFO "display layer" - no need to map the controls backwards or anything over-complicated. Nothing is changed about how a player interacts with that world - just that its mesh renderers are stripped so it isn't actually being rendered.Ĥ. A big benefit to this approach is that it also allows you to use regular control methods on the "regular collision layer". I'll have to do more research to verify this, but the early tests I did seemed promising.ģ. I found that even without colliders, the CFO method struggles with moving immense numbers of game objects under a root parent node in Unity - However, some tests I tried indicated that this may be easily resolved if game objects are set inactive that are not near the player. I didn't really consider this because the game I'm creating is multiplayer, and the server would be verifying hit calculations on the "collider world" anyway.Ģ. You actually could resolve some physics issues at those distances by using the "Continuous Floating Origin (CFO)" "display layer" to calculate physics from near the origin on the "floating error corrected" representations of enemies (will have to watch video to understand what I mean by that). Other things I thought of that are not in the video:ġ.