Cover the subject object with another object. An example config file using this control can be found here: https://github.com/3db/3db/tree/main/examples/unit_tests/occlusion.yaml.
Control that adds an occlusion object infront of the main object in the scene.
occlusion_ratio: Ratio of the occluded part of the object of interest. e.g., parameter 0.01 would occlude 1% of the object, and parameter 0.8 would occlude 80% of the object. (default range:
zoom: Controls distance from the occluder to the object of interest. The occluder is placed between the object of interest and the camera at a distance of
zoom * D, measured from the object of interest.
Dis the distance between the object of interest and the camera. (default range:
scale: rescale the occlusion object by a factor of
scale. Parameter 0.5 halves the occluder’s size, and parameter 2 doubles the occluder’s size. (default range:
direction: The direction from which the occluder approaches the object of interest. Takes a value between 0 and 7 represeting the indices of the
occluder: The occlusion object. This is an index of the list of the occlusion objects which is automatically initialized when the OcclusionControl is created (see Note).
DIRECTIONS= [(1, -1), (1, 0), (1, 1), (0, -1), (0, 1), (-1, -1), (-1, 0), (-1, 1)]¶
Initializes the OcclusionControl
root_folder – The root folder where the ood_objects folder containing the possible occluders exist
apply(context: Dict[str, Any], control_args: Dict[str, Any]) → None¶
Modify the target give a combination of the inputs the control needs
context (Dict[str, Any]) – A dictionary representation of the current scene.
control_args (Dict[str, Any]) – a dict containing an entry for each of the discrete and continuous parameters declared by the Control
the scene in-place (Modifies) –
return value. (no) –
unapply(context: Dict[str, Any]) → None¶
Deletes the occlusion objects. This is important to avoid clutering the scene with unneeded objects at the subsequent frames.
context (Dict[str, Any]) – The scene context object