Jump to content

Need help with function ForEachEntityInAABBDo()


Marcousik
 Share

Recommended Posts

Hey,

It seems I have a problem to catch only the entities that intersect the aabb... Instead of this I get all entities in the world, that's my code:

----------------------------------------
function Callback(entity,extra)

        if entity.script~=nil and entity.script.name~=nil then        
        System:Print(entity.script.name)         end
end

 


function Script:UpdatePhysics()
    local aabb=self.entity:GetAABB()
    world:ForEachEntityInAABBDo(aabb,"Callback")
    --System:Print("AABB: "..aabb:ToString())
end
-------------------------------

I put this script on a box in the map.

This returns names of a few entities that are not intersecting the box... What do I wrong ? thx for any Idea

--------------------------------

It seems this works well with primitives but wrong with models, that's mean models seem to be caught as intersecting when they are not...

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...