View Issue Details

IDProjectCategoryView StatusLast Update
0009373New Feature Requests[All Projects] Generalpublic2017-07-04 21:29
ReporterdrifterCZAssigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status acknowledgedResolutionopen 
Summary0009373: [Request] isPositionWithinColShape
Description

this function would be very useful in some cases. I need it for checking if some vehicle part (not the vehicle itself) is in polygon. And i think some other scripters would also like this function

Steps To Reproduce

there is already isElementWithinColShape, where element position is retrieved, this function would contain the same, except it will get the position right in input and won't have to get position of element

Additional Information

Now I have to use a invisible dummy element and position it to the coordinates i want to check and then do isElementWithinColShape ( dummy, colshape ) which is kind a stupid way, but no better way actualy.

TagsNo tags attached.

Activities

codylewiz

2016-09-11 21:50

viewer   ~~0025176

function isPositionInColShape(x,y,z,col)
local object = createObject(3003,x,y,z)
local incol = isElementWithinColShape(object,col)
destroyElement(object)
return incol
end

qaisjp

2016-09-13 03:15

administrator   ~~0025187

How about renaming isElementWithinColShape/isElementWithinMarker to isWithin, and then allowing it to also take a Vector3 (as well as marker/shape)?

Jusonex

2016-09-13 12:04

administrator   ~~0025190

isWithin breaks consistency in my opinion.

Instead, what do you think about deprecating isElementWithinMarker and letting isElementWithinColShape accept both colshape and marker + adding something like queryColShapePosition (following the convention <verb> <element-type> <noun/action>)

qaisjp

2016-09-14 15:36

administrator   ~~0025198

I'm definitely up for deprecating isElementWithinMarker, and allowing markers to be used with isElementWithinColShape.

I'm not sure about adding another function that does essentially the same thing (but with different types)... how about "checkColShapeCollision" (checks if vectors/elements are inside a colshape/marker)?

drifterCZ

2016-09-14 22:40

viewer   ~~0025201

Last edited: 2016-09-14 22:41

View 2 revisions

maybe just improve isElementWithinColShape (or implement isElementWithin for both markers/colshapes) and make it capable of accepting vectors or x,y,z. Well the "Element" in the name of function will be a bit confusing. But most people will still use the elements, instead of position, but they will have option to use the position, if they have to

Issue History

Date Modified Username Field Change