I made an aabb infront of the camera to check what could be in front of it, but I cant figure out how to do this in lua.
so far I have this:
if window:KeyHit(Key.Q) then
local spellPointMin = Transform:Point(-2,-2,0,self.camera,nil)
local spellPointMax= Transform:Point(2,2,5,self.camera,nil)
local aabb = AABB(spellPointMin, spellPointMax)
world:ForEachEntityInAABBDo(aabb,"PushSelf")
end
the vectors for the aabb are fine, but the code snippet does not work as expected.
I have a function PushSelf on an object inside the aabb box. I guess you cant use it like this ?
Ah I understood that the parameter is a global function, and entity is the collided object.