3 ms·
This is fascinating stuff. You write its easily expandable to higher dimensions. My particular interest is 4D, but instead of classical hypersphere I am trying
by MaxikCZ 4y ago
This is fascinating stuff.
You write its easily expandable to higher dimensions. My particular interest is 4D, but instead of classical hypersphere I am trying to get a shape, that when sliced to 3D looks like this:
Starts at a single point, and all following slices is a sphere that's increasing in radius quadratically.
I understand a hypercone would provide me with above for linearly growing sphere, but I have trouble imagining (or mathematically deriving) the 4D shape for quadratic growth.
My main worry is the resulting shape would not be convex, but I am not sure about it yet. Do you think your algorithm could be adapted for such shapes instead of hyperspheres?
- don_shadaman 4y agoThe engine simply divides the space into parts to decrease the number of checks necessary. It doesn't constrain you in any way regarding to what shapes you want to insert, however the broad "hitbox" must be a hypercube, and later on you can do your own math to inspect if in fact your "real" hitboxes are in contact. It doesn't matter if your shapes are convex or not, the engine sees them all as hypercubes, so all you need is provide one that's equal to or larger than your model. This has it's downsides, namely that for very slim yet long objects you will have a pretty big hitbox, but I wouldn't worry about it that much, since the collision detection step is done really quickly. Or, you can always insert multiple smaller hypercubes to ease it up a little bit, but then you need to be vary of duplicate collisions. If you really want, I can extend the existing codebase to also include 4D. I hope I will be able to correctly deduce the 4D cells that need to be checked for collision haha, I think nobody is good at visualising 4D very well. As for the math equation for the shape you are looking for, I'm not a 4D guru, so I can't help you with that, sorry. I tried some research just now, but this just isn't for me.