Coding for Fun: Measuring Models and Making Advanced Collision Responses
-
Wow, this is quite a lot to take in! I’ve had a similar thing on my to do list for quite some time, and it looks like you’ve done all I was hoping to do and more! I won’t be able to drag-and-drop this but I’ll be studying it for sure.
Is there any advantage to using sprites as the base rather than a struct?
-
I had memory leaks the first time I implemented something else with structs (it was when I did sprite splicing to add to the possible animations). I don't know if this was the problem exactly, but I think that structs were copied into each function instead of being passed by reference (without being deleted). FUZE4 silently crashed without an error (which isn't something it does if I load too many models), so it is a bit of conjecture on my part.
Regardless, structs are limited to their preset attributes. I may try to extend it to allow optional spherical boundaries, which will add attributes that aren't always present (i.e., radius).
Let me know if you have any questions, and thanks for your interest.
Jason -
Do you know about the ref keyword?
-
I definitely tried to use it for the sprite-splicing related project, but since that was a while ago (and I reimplemented it with sprites too), I can't just post it as an example case. I'll try to make a short program that makes it crash that way with structs later.
-
I figured you’d already know about it. I just thought I’d mention it just in case.
I’m excited to have a look at all of this here, especially curious about the rotational velocity stuff, which I had decided was ‘maybe sometime down the road, but not now’.
I will definitely write back here if I have any questions. In the meantime, thanks again! :)
-
Huh, I had all of the struct code for the sprites conveniently commented out because of the problem I'd had, but when I reintroduced them (and waited for a crash) nothing bad happened. Maybe I didn't wait long enough, or maybe there was a patch?
At any rate, I rescind my comment about the struct crash, for now xD.
Sprite splicing:
With structs N1WGDMNDN5
Without structs NSYMENNDN5 -
@Chronos You have shared these programs but they are currently only visible to your Switch Friends. If you want them to be downloadable by code they have to be submitted for approval.Take a look here: https://fuzearena.com/forum/topic/725/new-community-sharing-on-fuze4.
-
Done! Thanks for the tip.
-
Hiya! Just got around to downloading this, and I can tell straight away that it’s going to make my kids happy. They’re always shocked and offended when in my game, the player character can just walk straight through buildings as if they’re not there. Looking forward to having a good dive into this, thanks again :)
-
thanks soo much for this i use it to know objects dimensions for my projects well i use it to find the values i need, i don't use the code in my project