Search the Community
Showing results for tags 'aabb'.
-
-=END=- AABB not see entity I copied code in: It turned out somehow so : function Script:Call(entity,extra) self.see=true System:Print("see") end function Script:UpdatePhysics() local position = self.entity:GetPosition(true) local aabb = AABB() aabb.min.x=position.x-30 aabb.min.y=position.y-30 aabb.min.z=position.z-30 aabb.max.x=position.x+30 aabb.max.y=position.y+30 aabb.max.z=position.z+30 aabb:Update() self.entity.world:ForEachEntityInAABBDo(aabb,"Call", self.entity) end But at the approach of any other object(e.g. the player) to this object, nothing happens. -=RUS=- AABB не видит объекты. Я взял код из Получилось как-то так : function Script:Call(entity,extra) self.see=true System:Print("see") end function Script:UpdatePhysics() local position = self.entity:GetPosition(true) local aabb = AABB() aabb.min.x=position.x-30 aabb.min.y=position.y-30 aabb.min.z=position.z-30 aabb.max.x=position.x+30 aabb.max.y=position.y+30 aabb.max.z=position.z+30 aabb:Update() self.entity.world:ForEachEntityInAABBDo(aabb,"Call", self.entity) end Но при подходе любого другого объекта(например, игрок) к этому объекту, ничего не происходит.
-
If I make an aabb in front of the player's camera like this : if window:KeyHit(Key.Q) then --local model1 = Model:Box() --local model2 = Model:Box() local spellPointMin = Transform:Point(-2,-2,0.1, self.camera, nil) local spellPointMax= Transform:Point(2,2,5, self.camera, nil) --model1:SetPosition(spellPointMin) --model2:SetPosition(spellPointMax) local aabb = AABB(spellPointMin, spellPointMax) world:ForEachEntityInAABBDo(aabb,"Callback") end I believe it will work in the standard fpsplayer script, and it uses various functions like ForEachEntity which should call the global "Callback" function on an entity the callback function looks as follows (and works): function Callback(entity,extra) --this function needs to be global, for the aabb in the player script (Somewhere around ...Key.Q... line) if (entity:GetClass()==Object.ModelClass) then if(entity:GetKeyValue("type") == "movEntity") then entity:SetColor(1,0,0) end end end And to make a moveable Entity detect I set a key value as above to the entity. It works all fine, but only sometimes. When I walk toward an object with the KeyValue and constantly press q, nothing happens. However if I then move, and press q again, it works fine. If the angle is right (it sometimes will never work under certain angles no matter if its obfuscated or not) Here is a video : 2019-02-07 22-21-18.mp4 Thats it. I hope someone can help me solve this problem, and its not a bug.
-
I think this counts as bad behaviour on leadwerks engine side, I posted this thread and so far haven't been able to solve it:
-
How can I manually change the min and max values of a models AABB? I've used the following code which seems to set the model->aabb okay but debugging the entity boxes doesn't show it and the model still disappears at the wrong times. model->aabb.min.x = -256.0; model->aabb.min.y = -256.0; model->aabb.min.z = -256.0; model->aabb.max.x = 256.0; model->aabb.max.y = 256.0; model->aabb.max.z = 256.0; model->aabb.Update();