-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlap function for BVHtree not working in BGE #786
Comments
Could you attach a little example? |
I could not reproduce this bug on linux with: mesh = …
mesh.constructBvh().overlap(mesh.constructBvh()) |
with no example , i have try just like the mathutils BVHtree : """ #Objects water = bge.logic.getCurrentController().owner #Meshes #BVHtrees #Test overlapped faces print(overlappedFacesList) where water and terrain are two intersected planes |
i have missed the brackets , sorry |
Sorry, i have to return on this issue because the overlap function work but don't return any value. |
@RomStef : the file link seems incorrect. |
The BVH is construct from the mesh and can't include the object transformation because meshes are shared. Though a lot of people will encounter this issue, @RomStef, @BluePrintRandom: Do you think interesting to pass a matrix to |
Maybe a bool, world or local?
when the tree is built, decide on world or local?
alternatively we just localize the transform of the input to object space.
local = object.worldOrientation.inverted()* ( point - object.worldPosition)
|
The mesh can't get a world transform as it is shared across objects, I will make PR tonight for passing a matrix. |
The function KX_Mesh.constructBvh can now use as first argument a transform 4x4 matrix used over all the vertices. This allow the user to create a BVH in world space by passing the object world transform. Fix issue #786.
The function KX_Mesh.constructBvh can now use as first argument a transform 4x4 matrix used over all the vertices. This allow the user to create a BVH in world space by passing the object world transform. Fix issue #786.
Strange, but in my case, seems, player and some cubes intersect always, regardless they don't actually intersect. Example: https://www.youtube.com/watch?v=4Lsk84Gb9TY Here you see, that BVHTree always says that there are some intersected faces, but if you'll look to coordinates, than you'll see that they'll be the same only when I jumped on one of that blocks. Can somebody tell me, what I'm doing wrong ?) |
Are you transforming the bvhtree to the correct world space?
…On Thu, Nov 29, 2018, 6:58 PM Vladislav ***@***.*** wrote:
Strange, but in my case, seems, player and some cubes intersect always,
regardless they don't actually intersect.
Example: https://www.youtube.com/watch?v=4Lsk84Gb9TY
Here you see, that BVHTree always says that there are some intersected
faces, but if you'll look to coordinates, than you'll see that they'll be
the same only when I jumped on one of that blocks.
Can somebody tell me, what I'm doing wrong ?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#786 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AG25Wcq73llyhW68EiViKk2fBLFWZPsnks5u0J7ngaJpZM4V4bTa>
.
|
@BluePrintRandom , ah, no. |
as i said in the title , when i call the overlap function of BVHtree for testing overlapped faces between two different BVHtree the programm says the object has no attribute 'overlap'
The text was updated successfully, but these errors were encountered: