Page MenuHomeFeedback Tracker

[Feature Request] New scripting command: clipLOD (clipped version of bounding box)
New, NormalPublic

Description

This is kind of a weird request, but I hope it's possible.

What I'm requesting is a command that can give you the 'clipped' version of the bounding box of an object at a certain height for a given LOD.

For example:
Let's say I want to place an object next to the trunk of a tree. But since trees typically have large bounding boxes (due to the branches, which are irrelevant in this case), I'd have to 'refine' the BB by checking multiple line intersects to determine the actual bounds of the Geometry LOD at a certain height.

But there's always some error associated with this method (you'd have to do this at discrete steps, which means you could miss a surface between the gaps)

Since the game can "see" all the LODs, it would be much more convenient if there was a command that clipped the LOD at a certain height.

Something like this (it is created with the workaround method described above):


Which is the clipped version of the geometry LOD:

obj clipLOD [LOD, z1, z2]
LOD: String. Name of the LOD (e.g. "Geometry")
z1: Number. Z value where the clipping starts from in model coordinates.
z2: Number. Z value where the clipping ends at in model coordinates.
Return value: Array. Clipped LOD in format [[x1,y1,z1],[x2,y2,z2]] (similar to boundingBox format)

For the above example, this would be:

_z1 = (boundingBoxReal tree)#0#2; //the very bottom of the bounding box
_z2 = (tree worldToModel (ASLtoAGL getPosASL tree))#2 + 0.5; //0.5 meter above the land contact, in model coordinates (assuming the object is perfectly upright, i.e vectorUp isEqualTo [0,0,1])
tree clipLOD ["Geometry", _z1, _z2]

Other examples where such command comes in handy:

  1. Path generation.
  2. Detecting cover positions next to an object, such as a tree.
  3. Creating alternative version of findEmptyPosition (sometimes it puts the object into another object's BB, causing explosions)

If we could also choose the "up" vector during clipping, it would be even better (X, Y or Z in model coordinates).
Because sometimes, objects might be on their sides. (e.g vectorUp = [1,0,0])

obj clipLOD [LOD, z1, z2, upDir]
upDir (optional): Number. 0: X direction; 1: Y direction; 2: Z direction (Default, 2)

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Feature Request

Event Timeline

Leopard20 created this task.Aug 6 2020, 1:51 PM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)Aug 6 2020, 2:19 PM
Leopard20 updated the task description. (Show Details)
h- added a subscriber: h-.Aug 6 2020, 2:24 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 2:41 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 5:32 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 5:55 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 5:57 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 6:11 PM
Leopard20 updated the task description. (Show Details)Aug 6 2020, 6:41 PM
DrSova added a subscriber: DrSova.Sep 4 2020, 3:18 PM