#Broad Phase Query

1 messages · Page 1 of 1 (latest)

near fjord
#

Is using GetPartBoundsInRadius a good way to filter out possible entities for your detection system?

wheat glen
#

that's a spatial query not a filter

#

and while yeah you can filter within the query, i don't think that's what you were asking - actually, i'm not sure what you're asking

#

can you elaborate what you mean by detection system

still karma
# near fjord Is using GetPartBoundsInRadius a good way to filter out possible entities for yo...

I'm not entirely sure what your asking

GetPartBoundsInRadius makes use of the same logic the physics solver uses, including however broad phase is handled, so its reasonably performant most of the time.

I don't know enough to say if GetPartBoundsInRadius is strictly good or bad for your situation, it depends.

If the performance is good, it might be a fine solution.
Keep in mind I don't know what your doing, so even an O(n^2) search of everything might be faster, it depends.

near fjord
near fjord
still karma
still karma
#

it will probably be faster anyway

wheat glen
#

it depends how big the array is

#

and how often

wheat glen
#

it scales better

near fjord
near fjord
still karma
#

yeah computers are fast as fuck I would just leave it with magnitude checks

#

you can always optimize it later if it becomes a problem

near fjord
still karma
#

also, consider doing a squared distance check instead of magnitude

still karma
near fjord
still karma
wheat glen
still karma
still karma
#

especially if you do your own distance check that doesn't use square root

#

and compares squared distances

#

will be fast as fuck

near fjord
still karma
wheat glen
#

i'd still go for spatial query

#

magnitude checks lack accuracy

still karma
#

@near fjord Go with whichever one you will have an easier time implementing. If it ends up being too slow, try implementing the other one

near fjord
#

Thanks guys

#

I'll stick with the query for now but I'll look into squared checks if performance becomes an issue

near fjord
still karma
#

So performance is actually technically worse when using a whitelist/blacklist 😭
-# though not a reason to avoid using the whitelist, because if you do, you'd probably end up doing the same thing but in luau

near fjord
#

Gotcha that changes things for me

near fjord
wheat glen
#

the more you know

#

ikmoveto looks interesting i wonder why plugin only

still karma
#

and won't collide with anything in the workspace or other world models

#

If you wanted to use them, you'd have to add a part to the world model for each target and then query those.
Every frame, update those parts to match the position of the target in the workspace
When you do the query, map the matched parts to their corresponding targets

spring kernelBOT
#

studio** You are now Level 29! **studio

near fjord