flachdrache Posted October 9, 2012 Share Posted October 9, 2012 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. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
cassius Posted October 9, 2012 Share Posted October 9, 2012 Just curious. Why are you using such an old version of le? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
flachdrache Posted October 9, 2012 Author Share Posted October 9, 2012 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. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Daimour Posted October 9, 2012 Share Posted October 9, 2012 You can use collision check instead. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted October 9, 2012 Author Share Posted October 9, 2012 [not helpfull ... see first post] Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Rick Posted October 9, 2012 Share Posted October 9, 2012 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. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted October 9, 2012 Author Share Posted October 9, 2012 "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 " . Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Rick Posted October 9, 2012 Share Posted October 9, 2012 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. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted October 9, 2012 Author Share Posted October 9, 2012 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. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
flachdrache Posted October 9, 2012 Author Share Posted October 9, 2012 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. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Rick Posted October 9, 2012 Share Posted October 9, 2012 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 Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted October 10, 2012 Share Posted October 10, 2012 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 Quote 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 More sharing options...
Rick Posted October 10, 2012 Share Posted October 10, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.