diguyRegion

Generated from diguyRegion.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguyRegion.h. Do not edit this file directly; the changes will be lost.
Includes: declspec_diguy.h | diguy_constants.h

Contents:

Alphabetical Index

Link against: libdiguy

Summary

API for accessing diguyRegion objects generated by the crowd and region painter.

For information on subregions, see the documentation for the diguySubregionIndex and diguySubregionMask enumerations in diguy_constants.h.

class diguyRegion

class BDI_DECLSPEC_diguy diguyRegion
{
public:
    const char* get_name();
    int is_point_in_region(diguySubregionMask subregion_mask,
        float x, float y, float z);
    int get_point_in_region(diguySubregionIndex subregion_index,
        float* res_x, float* res_y, float* res_z);
    int get_point_in_region_near_point(diguySubregionIndex subregion_index,
        float seed_x, float seed_y, float seed_z,
        float radius,
        float* res_x, float* res_y, float* res_z);
    int get_nearest_point_in_region(diguySubregionMask subregion_mask,
        float seed_x, float seed_y, float seed_z,
        float* res_x, float* res_y, float* res_z);
    int get_nearest_reachable_point(diguySubregionMask subregion_mask,
        float seed_x, float seed_y, float seed_z,
        float* res_x, float* res_y, float* res_z);
    int get_num_rows();
    int get_num_columns();
    float get_resolution();
    float get_random_factor();
    int shrink();
    int clear_region();
    int clear_subregion(diguySubregionIndex subregion_index);
    int resample_mesh(float resolution);
    int paint(diguySubregionIndex subregion_index,
        float x, float y, float z,
        float radius,
        int force_visual_update = 0);
    int paint_rectangle(diguySubregionIndex subregion_index,
        float min_x, float min_y, float min_z,
        float max_x, float max_y, float max_z,
        int force_visual_update = 0);
    int erase(diguySubregionIndex subregion_index,
        float x, float y, float z,
        float radius,
        int force_visual_update = 0);
    int erase_rectangle(diguySubregionIndex subregion_index,
        float min_x, float min_y, float min_z,
        float max_x, float max_y, float max_z,
        int force_visual_update = 0);
    int generate_navmesh(float min_x, float min_y, float min_z,
        float max_x, float max_y, float max_z);
Query Functions

function diguyRegion::get_name

Prototype:

const char* get_name();
Description:

Returns the name of the region. This pointer will never be NULL.

Returns:

name of the region

Callable From:

function diguyRegion::is_point_in_region

Prototype:

int is_point_in_region(diguySubregionMask subregion_mask,
    float x, float y, float z);
Description:

Returns 1 if a point is approximately inside the region. Supports multiple subregions via or'ing masks together.

Use the base mask (DIGUY_SUBREGION_MASK_BASE) to test against the base of the region.

Returns:

1 if the point is in the region, 0 if not

Callable From:

function diguyRegion::get_point_in_region

Prototype:

int get_point_in_region(diguySubregionIndex subregion_index,
    float* res_x, float* res_y, float* res_z);
Description:

Returns a random x, y, z point in the region specified. This function takes a region index (e.g. DIGUY_SUBREGION_BASE).

Arguments:

subregion_indexsubregion in which to find the point
res_x, res_y, res_z return point
Returns:

0 if a point was successfully generated, -1 on failure

Callable From:

function diguyRegion::get_point_in_region_near_point

Prototype:

int get_point_in_region_near_point(diguySubregionIndex subregion_index,
    float seed_x, float seed_y, float seed_z,
    float radius,
    float* res_x, float* res_y, float* res_z);
Description:

Returns a random x, y, z point, near the seed location, in the subregion specified.

Arguments:

subregion_index subregion in which to find the point
seed_x, seed_y, seed_zlocation to use as the seed point
radius radius around the seed point within which the result point should be located
res_x, res_y, res_z return point
Returns:

0 if a point was successfully generated, -1 on failure

Callable From:

function diguyRegion::get_nearest_point_in_region

Prototype:

int get_nearest_point_in_region(diguySubregionMask subregion_mask,
    float seed_x, float seed_y, float seed_z,
    float* res_x, float* res_y, float* res_z);
Description:

Returns the nearest point in the region near the seed location, in the subregion(s) specified.

Arguments:

subregion_mask subregion(s) to search
seed_x, seed_y, seed_zlocation to use as the search seed point
res_x, res_y, res_z return point
Returns:

0 if a point was successfully generated, -1 on failure

Callable From:

function diguyRegion::get_nearest_reachable_point

Prototype:

int get_nearest_reachable_point(diguySubregionMask subregion_mask,
    float seed_x, float seed_y, float seed_z,
    float* res_x, float* res_y, float* res_z);
Description:

Returns the nearest reachable point to the seed location, inside the subregion(s) specified by the mask.

Determining reachability involves guaranteeing that there is a contiguous section of the base region between the seed point and the resulting point.

Arguments:

subregion_mask the subregion(s) to search
seed_x, seed_y, seed_zthe location to use as the search seed point
res_x, res_y, res_z return point
Returns:

0 if a point was successfully found, -1 on failure

Callable From:

function diguyRegion::get_num_rows

Prototype:

int get_num_rows();
Returns:

the number of rows in the region

Callable From:

function diguyRegion::get_num_columns

Prototype:

int get_num_columns();
Returns:

the number of columns in the region

Callable From:

function diguyRegion::get_resolution

Prototype:

float get_resolution();
Returns:

the resolution of the region in meters per point

Callable From:

function diguyRegion::get_random_factor

Prototype:

float get_random_factor();
Description:

This function returns a random factor between 0 and 1 computed for this region. This number can be used, for example, to modify colors or depths of region visuals.

The number will remain the same for the lifetime of the region.

Returns:

a random factor between 0 and 1

Callable From:

Editing Functions

function diguyRegion::shrink

Prototype:

int shrink();
Description:

Shrinks the region's bounds to just the area with tagged data in it. Can help conserve memory. Currently always returns 0.

Callable From:

function diguyRegion::clear_region

Prototype:

int clear_region();
Description:

Erases all region data and then shrinks the region.

Callable From:

function diguyRegion::clear_subregion

Prototype:

int clear_subregion(diguySubregionIndex subregion_index);
Description:

Erases all subregion data and then shrinks the region.

Callable From:

function diguyRegion::resample_mesh

Prototype:

int resample_mesh(float resolution);
Description:

Resamples the mesh and sets the resolution of the mesh to the new resolution.

Note that the resampled data is currently rough and will probably need to be touched up by hand. The system is currently limited to creating meshes with a resolution of 0.25 meters per point.

Callable From:

function diguyRegion::paint

Prototype:

int paint(diguySubregionIndex subregion_index,
    float x, float y, float z,
    float radius,
    int force_visual_update = 0);
Description:

This function adds to the specified subregion with a spherical brush centered at the specified point and with the specified radius.

If you are doing a number of edits to the mesh at once, it's preferable to wait until the last one before setting force_visual_update to 1.

Callable From:

function diguyRegion::paint_rectangle

Prototype:

int paint_rectangle(diguySubregionIndex subregion_index,
    float min_x, float min_y, float min_z,
    float max_x, float max_y, float max_z,
    int force_visual_update = 0);
Description:

This function adds to the specified subregion with a rectangular brush stretching from the min point to the max point specified.

If you are doing a number of edits to the mesh at once, it's preferable to wait until the last one before setting force_visual_update to 1.

Callable From:

function diguyRegion::erase

Prototype:

int erase(diguySubregionIndex subregion_index,
    float x, float y, float z,
    float radius,
    int force_visual_update = 0);
Description:

This function removes from the specified subregion with a spherical brush centered at the specified point and with the specified radius.

If you are doing a number of edits to the mesh at once, it's preferable to wait until the last one before setting force_visual_update to 1.

Returns:

1 if any points were erased, 0 if not

Callable From:

function diguyRegion::erase_rectangle

Prototype:

int erase_rectangle(diguySubregionIndex subregion_index,
    float min_x, float min_y, float min_z,
    float max_x, float max_y, float max_z,
    int force_visual_update = 0);
Description:

This function removes from the specified subregion with a rectangular brush stretching from min point to the max point specified.

If you are doing a number of edits to the mesh at once, it's preferable to wait until the last one before setting force_visual_update to 1.

Returns:

1 if any points were erased, 0 if not

Callable From:

function diguyRegion::generate_navmesh

Prototype:

int generate_navmesh(float min_x, float min_y, float min_z,
    float max_x, float max_y, float max_z);
Description:

This function attempts to grow the region to encompass the min and max points specified as well as determine the reachability of all of those points at once. Note: the navmesh reachability algorithm is not perfect and the results will probably need to be touched up by hand.

Callable From:


Alphabetical Index




Copyright (C) 1992-2012 Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.