Page MenuHomeFeedback Tracker

get objects/entities in a square area
New, NormalPublic

Description

I'm requesting scripting commands that allow us to get objects/entities in a square's area. The current commands we have only allow for a circle's radius:

https://community.bistudio.com/wiki/nearEntities
https://community.bistudio.com/wiki/nearObjects
https://community.bistudio.com/wiki/nearestObjects
https://community.bistudio.com/wiki/nearestObject

Either these commands should be modified to allow us to check a square's radius or there should be new commands added in.

Details

Legacy ID
374944597
Severity
Minor
Resolution
Open
Reproducibility
N/A
Category
Scripting

Event Timeline

GossamerSolid edited Additional Information. (Show Details)
GossamerSolid set Category to Scripting.
GossamerSolid set Reproducibility to N/A.
GossamerSolid set Severity to Minor.
GossamerSolid set Resolution to Open.
GossamerSolid set Legacy ID to 374944597.May 7 2016, 1:18 PM
Bohemia added a subscriber: ceeeb.Mar 30 2013, 4:10 AM

Please please please! :D

If you really need all entities inside a square, you could write a function that checks if the returned entities by nearObjects etc are inside a square.

See http://math.stackexchange.com/questions/190111/how-to-check-if-a-point-is-inside-a-rectangle

The issue I have with these functions is that if you use this in a square you will miss what is in the corners. But if you make the search radius bigger, say 1.41421356237309504880 so that it covers the corners, you get a bunch of extra objects you don't need/want due to the expansion of the search radius.