Jump to content

What is forEachEntityInAABB ?


flachdrache
 Share

Recommended Posts

I need to write some equivalent for the "ForEachEntityInAABBDo" function in lua -

i use Le2.31 and its not exposed in that version but i need to check if the camera bbox is inside the bbox of a teleporter model ... help appreciated.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

because it was the most bug free version for a long time (till 2.5), i have all my dynamic entity colliders (from .obj) processed for Le2.31 and i might need to recompile some of my lua libs for luaJIT in 2.5.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

You could just check if the camera position is inside the teleporter AABB each frame. I think you can get the AABB of all models from Lua. So then just do a check of x,y,z values between the 2 to see if the camera position is inside the teleporter bbox. Does the camera even have a bbox? Even if you make up a bbox of the camera, just check the x,y,z values to see if they are all inside the x,y,z values of the teleporter.

Link to comment
Share on other sites

"validPointInEntityBBox" is something i`ll try next - fw.camera does have a aabb but seams to inherit its world aabb e.g. i get strange, view dependant results. However, iam not sure about the algo in general - hence the straight question " what is ForEachEntityInAABBDo " .

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Well, thats what the function name already tells me ....

 

define "cycles through every entity" -

define "AABB is in the AABB" -

define "the callback" ....

 

i guess you can forget it .... i asked many question on the forum and people simply seam to be unable.

I can deal with starters willing to learn but programmers which cant grasp defined context ... well.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Ps :

while i got you on the topic Rick - i think i merge some of your lua Pi-scripts with my lua based "engine integration". Is there something you would have liked to add to your integration design but didnt found the time to do so ?!

 

hope you dont mind ... no offense here. :D

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Well, thats what the function name already tells me ....

 

define "cycles through every entity" -

define "AABB is in the AABB" -

define "the callback" ....

 

i guess you can forget it .... i asked many question on the forum and people simply seam to be unable.

I can deal with starters willing to learn but programmers which cant grasp defined context ... well.

 

hmm I guess we might be confused with the parts you are confused with. cycles through every entity is just that. every LE entity that's loaded will be iterated over. AABB is in AABB means just what it says. You define an AABB and if any entities lies inside the AABB you defined then the callback function will be called. The callback is a C function (should be in the documentation on the signature) that the engine will call when the AABB of an entity being iterated lies within the AABB you defined.

 

The Pi stuff was pretty incomplete and there would be a ton of things I'd want to do with them, but going to wait and do them with LE3. You can do whatever you like with them, that's why I put them out there :)

Link to comment
Share on other sites

It cycles through every entity and if any of their AABB is in the AABB you pass to that function, the callback will be called passing in that entity.

I certainly hope this is what it's not doing. It should be using some form of spacial indexing (an octree for instance) to avoid having to do this which is very inefficient.

 

But in essence this is correct, the functionality is to return all entities whose bounding boxes intersect or completely lie within a given volume

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I certainly hope this is what it's not doing. It should be using some form of spacial indexing (an octree for instance) to avoid having to do this which is very inefficient.

 

Yeah good call, but I'm just confused as to why he's confused about the function.

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...