diguyCharacterGroup

Generated from diguyCharacterGroup.h

DI-Guy API Version 12.5.1

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

Contents:

Alphabetical Index

class diguyCharacterGroup

class BDI_DECLSPEC_diguy diguyCharacterGroup
{
public:
    const char* get_name();
    int set_name(const char* name);
    int add_member(diguyCharacter* character);
    int add_all_characters_as_members();
    int remove_member(diguyCharacter* character);
    int remove_all_members();
    int is_member(diguyCharacter* character);
    int get_num_members();
    diguyCharacter* get_member_at_index(int index);
    int get_index_of_member(diguyCharacter* character);
    int get_subgroup_number(diguyFormation* formation, int index);
    int get_index_in_subgroup(diguyFormation* formation, int index);
    int set_all_members_enabled(int enabled);
    int update_all_members(float t);
#ifdef CPLUSPLUS_ONLY
    int draw_all_members();
    int draw_pass1_all_members();
    int draw_pass2_all_members();
#endif
    int set_all_members_current_tin(float tin);
    int set_all_members_current_tout(float tout);
    diguyViewLabel* get_label();
    void set_label_offset_above_centroid(float offset);
    float get_label_offset_above_centroid();
    int	get_num_variables();
    diguyVariable* get_variable_at_index(int index);
    diguyVariable* find_variable(const char* name);
    diguyVariable* find_or_create_variable(const char* name);
    int destroy_variable(diguyVariable* variable);
    int translate_all_paths(float tx, float ty, float tz);
    int rotate_all_paths_about_point(float rz, float rx, float ry,
        float rotation_pt_x, float rotation_pt_y, float rotation_pt_z);
    int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry);
    diguyCharacter* get_nearest_character_to_point(float x, float y, float z);
    diguyCharacter* get_farthest_character_to_point(float x, float y, float z);
    int get_group_centroid(float* x, float* y, float* z);
    int get_group_min_circle(float* x, float* y, float* z, float* radius);
    int send_message_to_all_members(const char* sender,
        const char* message_type,
        const char* message,
        const char* message_params = NULL);
    int apply_formation_to_group_with_dir(diguyCharacter* leader,
        diguyFormation* formation,
        float dir_x,
        float dir_y,
        float desired_radius = -1.0f,
        int require_sort = 1);
    int apply_formation_to_group_with_goal(diguyCharacter* leader,
        diguyFormation* formation,
        float goal_x,
        float goal_y,
        float desired_radius = -1.0f,
        int require_sort = 1);
    int apply_formation_to_group(diguyCharacter* leader,
        diguyFormation* formation,
        float desired_radius = -1.0f,
        int require_sort = 1);
    diguyFormation* get_current_formation();
    int sort_group_based_on_pos(float x,
        float y,
        float z,
        diguyFormation* formation = NULL,
        diguyCharacter* leader = NULL);
    diguyCharacter* get_sorted_member_at_index(int index);
    int get_num_active_members();

function diguyCharacterGroup::get_name

Prototype:

const char* get_name();
Returns:

name of the group; this value will never be NULL

Callable From:

function diguyCharacterGroup::set_name

Prototype:

int set_name(const char* name);
Description:

This function sets the name of this object.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::add_member

Prototype:

int add_member(diguyCharacter* character);
Description:

Adds the passed character to the group if not already in it.

Returns:

0 if the character is now a part of the group, -1 if not

Callable From:

function diguyCharacterGroup::add_all_characters_as_members

Prototype:

int add_all_characters_as_members();
Description:

Adds all characters of the scenario as members of the group.

Returns:

Always return 0.

Callable From:

function diguyCharacterGroup::remove_member

Prototype:

int remove_member(diguyCharacter* character);
Description:

Removes the passed character from the group if it is a member.

Returns:

0 if the character was part of the group and removed; -1 if not

Callable From:

function diguyCharacterGroup::remove_all_members

Prototype:

int remove_all_members();
Description:

Removes all members of the group.

Returns:

Always return 0.

Callable From:

function diguyCharacterGroup::is_member

Prototype:

int is_member(diguyCharacter* character);
Description:

The function can be used to check if a specific character is in this group.

Also see diguyCharacter::is_group_member().

Returns:

1 if the passed character is a member of the group; 0 if not

Callable From:

function diguyCharacterGroup::get_num_members

Prototype:

int get_num_members();
Returns:

number of member characters in group

Callable From:

function diguyCharacterGroup::get_member_at_index

Prototype:

diguyCharacter* get_member_at_index(int index);
Returns:

group member at specified index; NULL if no character at specified index

Callable From:

function diguyCharacterGroup::get_index_of_member

Prototype:

int get_index_of_member(diguyCharacter* character);
Returns:

index of member, or -1 if not found

Callable From:

function diguyCharacterGroup::get_subgroup_number

Prototype:

int get_subgroup_number(diguyFormation* formation, int index);
Description:

See diguyFormation for a description of subgroups.

Returns:

subgroup number within formation of character at index, or -1

Callable From:

function diguyCharacterGroup::get_index_in_subgroup

Prototype:

int get_index_in_subgroup(diguyFormation* formation, int index);
Description:

See diguyFormation for a description of subgroups.

Returns:

index within subgroup, or 0

Callable From:

function diguyCharacterGroup::set_all_members_enabled

Prototype:

int set_all_members_enabled(int enabled);
Description:

Sets whether all characters in group are enabled. Equivalent to calling diguyCharacter::set_enabled() for group members.

Returns:

Always return 0.

Callable From:

function diguyCharacterGroup::update_all_members

Prototype:

int update_all_members(float t);
Description:

Updates all characters in the group. Equivalent to calling diguyCharacter::update() for all group members.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::draw_all_members

Prototype:

int draw_all_members();
Description:

This function draws all members of the group. See diguyCharacter::draw().

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::draw_pass1_all_members

Prototype:

int draw_pass1_all_members();
Description:

This function draws pass 1 of all members of the group. See diguyCharacter::draw_pass1().

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::draw_pass2_all_members

Prototype:

int draw_pass2_all_members();
Description:

This function draws pass 2 all members of the group. See diguyCharacter::draw_pass2().

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::set_all_members_current_tin

Prototype:

int set_all_members_current_tin(float tin);
Description:

This function sets the current tin time of all characters in the group. See diguyCharacter::set_current_tin().

Arguments:

tinnew value of current tin in seconds
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::set_all_members_current_tout

Prototype:

int set_all_members_current_tout(float tout);
Description:

This function sets the current tout time of all characters in the group. See diguyCharacter::set_current_tout().

Arguments:

toutnew value of current tout in seconds
Returns:

0 on success, -1 on failure

Callable From:

Label Functions
The functions in this section control the text, visibility, and colors of group labels.

Currently group labels are only enabled in DI-Guy Scenario.

function diguyCharacterGroup::get_label

Prototype:

diguyViewLabel* get_label();
Description:

This function returns a pointer to the label object of the group.

Currently group labels are only enabled in DI-Guy Scenario.

Returns:

pointer to the group's label

Callable From:

function diguyCharacterGroup::set_label_offset_above_centroid

Prototype:

void set_label_offset_above_centroid(float offset);
Description:

This function sets how high the label of the group will float above the group's centroid.

Arguments:

offsetoffset, in meters, of label above group
Callable From:

function diguyCharacterGroup::get_label_offset_above_centroid

Prototype:

float get_label_offset_above_centroid();
Returns:

how high the label of the group will float above the group centroid

Callable From:

Variable Functions

function diguyCharacterGroup::get_num_variables

Prototype:

int    get_num_variables();
Returns:

number of variables the group has

Callable From:

function diguyCharacterGroup::get_variable_at_index

Prototype:

diguyVariable* get_variable_at_index(int index);
Returns:

pointer of type diguyVariable; NULL if no variable at the specified index

Arguments:

indexindex of the variable; indices start at 0
Callable From:

function diguyCharacterGroup::find_variable

Prototype:

diguyVariable* find_variable(const char* name);
Description:

This function returns a pointer to the specified variable.

Arguments:

namename of variable to be found
Returns:

pointer of type diguyVariable; NULL if not found

Callable From:

function diguyCharacterGroup::find_or_create_variable

Prototype:

diguyVariable* find_or_create_variable(const char* name);
Description:

This function finds the variable with the given name or creates it if it doesn't exist.

Arguments:

namename of the variable to find or create
Returns:

pointer of type diguyVariable; should never be NULL

Callable From:

function diguyCharacterGroup::destroy_variable

Prototype:

int destroy_variable(diguyVariable* variable);
Description:

This function destroys the passed variable.

Arguments:

variablepointer to a diguyVariable
Returns:

0 on success, -1 on failure

Callable From:

Experimental Functions

function diguyCharacterGroup::translate_all_paths

Prototype:

int translate_all_paths(float tx, float ty, float tz);

function diguyCharacterGroup::rotate_all_paths_about_point

Prototype:

int rotate_all_paths_about_point(float rz, float rx, float ry,
    float rotation_pt_x, float rotation_pt_y, float rotation_pt_z);

function diguyCharacterGroup::rotate_all_paths_about_current_waypoint

Prototype:

int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry);

function diguyCharacterGroup::get_nearest_character_to_point

Prototype:

diguyCharacter* get_nearest_character_to_point(float x, float y, float z);
Description:

Get the character closest to the specified point.

Arguments:

x, y, zposition in meters from the origin
Returns:

pointer to diguyCharacter, or NULL in none found

Callable From:

function diguyCharacterGroup::get_farthest_character_to_point

Prototype:

diguyCharacter* get_farthest_character_to_point(float x, float y, float z);
Description:

Get the character furthest from the specified point.

Arguments:

x, y, zposition in meters from the origin
Returns:

pointer to diguyCharacter, or NULL if none found

Callable From:

function diguyCharacterGroup::get_group_centroid

Prototype:

int get_group_centroid(float* x, float* y, float* z);
Description:

Get centroid of group (average of character positions).

Arguments:

x, y, zposition in meters from the origin
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::get_group_min_circle

Prototype:

int get_group_min_circle(float* x, float* y, float* z, float* radius);
Description:

Get minimum enclosing circle of group. Note that this is slower than getting the centroid.

Arguments:

x, y, zcenter of circle of group in meters from the origin
radius radius of circle
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::send_message_to_all_members

Prototype:

int send_message_to_all_members(const char* sender,
    const char* message_type,
    const char* message,
    const char* message_params = NULL);
Description:

Send a message to all characters in group. See diguyCharacter::agent_accept_message().

Arguments:

sender who is sending the message
message_type what type of message is being sent
message the message string
message_paramsoptional parameter string
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::apply_formation_to_group_with_dir

Prototype:

int apply_formation_to_group_with_dir(diguyCharacter* leader,
    diguyFormation* formation,
    float dir_x,
    float dir_y,
    float desired_radius = -1.0f,
    int require_sort = 1);
Description:

Puts the group into the specified formation, applying agent_pursue_character_with_offset() to each character except the leader.

Arguments:

leader leader; can be NULL
formation name of formation
dir_x x component of the formation's heading
dir_y y component of the formation's heading
desired_radiusif not given (-1.0), get radius from formation
require_sort if 1, group must be resorted; if 0, it may still be
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::apply_formation_to_group_with_goal

Prototype:

int apply_formation_to_group_with_goal(diguyCharacter* leader,
    diguyFormation* formation,
    float goal_x,
    float goal_y,
    float desired_radius = -1.0f,
    int require_sort = 1);
Description:

Puts the group into the specified formation, applying agent_pursue_character_with_offset() to each character except the leader.

Arguments:

leader leader; can be NULL
formation name of formation
goal_x x component of the formation's goal point
goal_y y component of the formation's goal point
desired_radiusif not given (-1.0), get radius from formation
require_sort if 1, group must be resorted; if 0, it may still be
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::apply_formation_to_group

Prototype:

int apply_formation_to_group(diguyCharacter* leader,
    diguyFormation* formation,
    float desired_radius = -1.0f,
    int require_sort = 1);
Description:

Puts the group into the specified formation, applying agent_pursue_character_with_offset() to each character except the leader.

Arguments:

leader leader; can be NULL
formation name of formation
desired_radiusif not given (-1.0), get radius from formation
require_sort if 1, group must be resorted; if 0, it may still be
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::get_current_formation

Prototype:

diguyFormation* get_current_formation();
Description:

Returns the last-set formation

Returns:

The formation or NULL

Callable From:

function diguyCharacterGroup::sort_group_based_on_pos

Prototype:

int sort_group_based_on_pos(float x,
    float y,
    float z,
    diguyFormation* formation = NULL,
    diguyCharacter* leader = NULL);
Description:

Sorts group relative to the point given. The point should be on the left or in the front, depending on what order the formation is in. This updates an internal list of sorted group members.

Arguments:

x x component of point
y y component of point
z z component of point
formationthe formation; pass NULL for no formation
leader the leader; pass NULL for no formation leader
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGroup::get_sorted_member_at_index

Prototype:

diguyCharacter* get_sorted_member_at_index(int index);
Returns:

member of formation-sorted group; NULL if no character at index

Callable From:

function diguyCharacterGroup::get_num_active_members

Prototype:

int get_num_active_members();
Returns:

number of active members

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.