
|
|
This file was automatically generated from diguyImpact.h. Do not edit this file directly; the changes will be lost.Includes: declspec_diguy.h | diguy_constants.h | diguy_vector_classes.h
Contents:
Link against: libdiguy
class diguyImpact
|
class BDI_DECLSPEC_diguy diguyImpact { public: diguyImpactType get_impact_type(); const char* get_impact_type_string(); int get_num_hits(); const char* get_attacker_name(); diguyCharacter* get_attacker(); const char* get_target_name(); diguyCharacter* get_target(); const char* get_hit_link_name(); int get_hit_link_index(); const char* get_hit_shape_name(); int get_impact_number(); void set_impact_number(int val); void set_impact_been_processed(); int get_impact_been_processed(); float get_x(); float get_y(); float get_z(); void get_location(float* x, float* y, float* z); float get_impact_radius(); float get_impact_speed(); int get_location_in_link_coordinates(float* link_x, float* link_y, float* link_z); void reset(); const char* get_munition_type(); diguySceneObject* get_hit_scene_object(); float get_normal_x(); float get_normal_y(); float get_normal_z(); void get_impact_normal(float* x, float* y, float* z); void get_impact_velocity(float* x, float* y, float* z); int get_is_from_net_detonation(); int get_DIS_munition_septet_value(int septet_index); int get_DIS_site(); int get_DIS_host(); int get_DIS_event_number(); int get_DIS_munition_number(); int get_DIS_detonation_result(); int get_DIS_burst_warhead_type(); int get_DIS_burst_fuze(); int get_DIS_burst_quantity(); int get_DIS_burst_rate(); #ifdef CPLUSPLUS_ONLY void set_valid_impact(); void set_target(diguyCharacter* target); void set_location(float x, float y, float z); void set_normal(float nx, float ny, float nz); void set_hit_scene_object(diguySceneObject* scene_object); void set_hit_link_index(int index); void set_hit_shape_index(int index);
| Accessor functions |
Unless otherwise noted all functions in this class section are callable from:
- C++
- Script
function diguyImpact::get_impact_type |
Prototype:
Description:diguyImpactType get_impact_type();
Returns the type of impact; this is based on how the collision was generated. Possible values are:
Note: NO_IMPACT is generated when a character fires but fails the hit ratio test. The location of the impact is then set to the attacker's position, or if that is unavailable to: (DIGUY_DEFAULT_FLOAT, DIGUY_DEFAULT_FLOAT, DIGUY_DEFAULT_FLOAT).Returns:
the type of impact
function diguyImpact::get_impact_type_string |
Prototype:
Returns:const char* get_impact_type_string();
the string version of the type of impact. This is based on how the collision was generated. Possible values are:
- "direct_hit"
- "nearby_detonation"
- "vehicle_collision"
- "no_impact"
- "user_generated"
function diguyImpact::get_num_hits |
Prototype:
Returns:int get_num_hits();
the number of hits made by this impact. This includes hits against characters and scene objects.
function diguyImpact::get_attacker_name |
Prototype:
Returns:const char* get_attacker_name();
the name of the attacker. This pointer may be NULL if there is no attacker character.
function diguyImpact::get_attacker |
Prototype:
Returns:diguyCharacter* get_attacker();
Returns a pointer to the attacker. This pointer may be NULL.
function diguyImpact::get_target_name |
Prototype:
Returns:const char* get_target_name();
the name of the target. This pointer may be NULL if there is no impact target character (e.g., impact is against a scene object).
function diguyImpact::get_target |
Prototype:
Returns:diguyCharacter* get_target();
the diguyCharacter impact target. This pointer may be NULL if there is no impact target character (e.g., impact is against a scene object).
function diguyImpact::get_hit_link_name |
Prototype:
Returns:const char* get_hit_link_name();
name of the target character link that was hit; may be NULL if there is no hit target character
function diguyImpact::get_hit_link_index |
Prototype:
Returns:int get_hit_link_index();
index of the target character link that was hit
function diguyImpact::get_hit_shape_name |
Prototype:
Returns:const char* get_hit_shape_name();
name of the target character shape that was hit; may be NULL if there is no hit target character
function diguyImpact::get_impact_number |
Prototype:
Returns:int get_impact_number();
the number of impacts the target character has taken
function diguyImpact::set_impact_number |
Prototype:
Description:void set_impact_number(int val);
Sets the impact number.
function diguyImpact::set_impact_been_processed |
Prototype:
Description:void set_impact_been_processed();
Sets that the impact has been processed.
function diguyImpact::get_impact_been_processed |
Prototype:
Returns:int get_impact_been_processed();
1 if the impact has been processed, 0 if not
function diguyImpact::get_x |
Prototype:
Returns:float get_x();
the approximate world x coordinate of the impact
function diguyImpact::get_y |
Prototype:
Returns:float get_y();
the approximate world y coordinate of the impact
function diguyImpact::get_z |
Prototype:
Returns:float get_z();
the approximate world z coordinate of the impact
function diguyImpact::get_location |
Prototype:
Description:void get_location(float* x, float* y, float* z);
Alternative method for getting the location of the impact.
function diguyImpact::get_impact_radius |
Prototype:
Returns:float get_impact_radius();
the radius of the impact
function diguyImpact::get_impact_speed |
Prototype:
Returns:float get_impact_speed();
the speed of the impact
function diguyImpact::get_location_in_link_coordinates |
Prototype:
Description:int get_location_in_link_coordinates(float* link_x, float* link_y, float* link_z);
This function returns the location of the impact in link-relative coordinates. The function may fail and return -1 if a link was not hit by the impact.Arguments:
link_x, link_y, link_z link-relative coordinates are returned in these variablesReturns:
0 on success, -1 on failure
function diguyImpact::reset |
Prototype:
Description:void reset();
This function resets all of the impact data to default values.
function diguyImpact::get_munition_type |
Prototype:
Description:const char* get_munition_type();
This function returns the name of the munition that was fired. This is useful for creating impact callbacks that respond differently to different weapons.Returns:
the munition type of the impact; may be NULL
function diguyImpact::get_hit_scene_object |
Prototype:
Description:diguySceneObject* get_hit_scene_object();
Returns the hit diguySceneObject.
This pointer may be NULL if there is no impact scene object (e.g., impact is against a character).
If the octtree was used to generate the impact, this pointer will be NULL.Returns:
pointer of type diguySceneObject
function diguyImpact::get_normal_x |
Prototype:
Returns:float get_normal_x();
approximate normal x coordinate of the impact; may not be valid
function diguyImpact::get_normal_y |
Prototype:
Returns:float get_normal_y();
approximate normal y coordinate of the impact; may not be valid
function diguyImpact::get_normal_z |
Prototype:
Returns:float get_normal_z();
approximate normal z coordinate of the impact; may not be valid
function diguyImpact::get_impact_normal |
Prototype:
Description:void get_impact_normal(float* x, float* y, float* z);
Alternative method for getting the normal of the impact.
| Experimental DIS Detonation Functions |
The following functions are experimental. They are for accessing data from DIS detonations that result in DI-Guy impacts being generated.
function diguyImpact::get_impact_velocity |
Prototype:
Description:void get_impact_velocity(float* x, float* y, float* z);
Velocity of projectile at impact. May be 0 if no velocity information is available.
function diguyImpact::get_is_from_net_detonation |
Prototype:
Returns:int get_is_from_net_detonation();
1 if impact was generated as a result of a network detonation (e.g. a DIS detonation PDU), else 0
function diguyImpact::get_DIS_munition_septet_value |
Prototype:
Description:int get_DIS_munition_septet_value(int septet_index);
This function returns the specified part of the DIS septet of the detonation's munition septet.Arguments:
septet_index which part of the septet to return; must be between 0 (for 'kind') and 6 (for 'extra') Returns -1 if septet isn't specified, or on error.
function diguyImpact::get_DIS_site |
Prototype:
Returns:int get_DIS_site();
the site id part of the detonation PDU event id; -1 if not set
function diguyImpact::get_DIS_host |
Prototype:
Returns:int get_DIS_host();
the host id part of the detonation PDU event id; -1 if not set
function diguyImpact::get_DIS_event_number |
Prototype:
Returns:int get_DIS_event_number();
the event number part of the detonation PDU event id; -1 if not set
function diguyImpact::get_DIS_munition_number |
Prototype:
Returns:int get_DIS_munition_number();
the event number part of the detonation PDU munition event id; -1 if not set
function diguyImpact::get_DIS_detonation_result |
Prototype:
Returns:int get_DIS_detonation_result();
the detonation result of the detonation PDU; -1 if not set
function diguyImpact::get_DIS_burst_warhead_type |
Prototype:
Returns:int get_DIS_burst_warhead_type();
the warhead type enumeration of the detonation PDU's burst descriptor; -1 if not set
function diguyImpact::get_DIS_burst_fuze |
Prototype:
Returns:int get_DIS_burst_fuze();
the fuze enumeration of the detonation PDU's burst descriptor; -1 if not set
function diguyImpact::get_DIS_burst_quantity |
Prototype:
Returns:int get_DIS_burst_quantity();
the burst quantity of the detonation PDU's burst descriptor; -1 if not set
function diguyImpact::get_DIS_burst_rate |
Prototype:
Returns:int get_DIS_burst_rate();
the burst rate of the detonation PDU's burst descriptor; -1 if not set
| Utility Functions for Intersection Functions |
The following functions are meant for users who are using diguyScenario::set_fire_weapon_intersection_function() to handle weapon firing in the SDK.
In simple OpenGL environments diguy_default_fire_weapon_intersection_function() in diguy_graphics_ogl.h may give you reasonable results by rendering characters into the back buffer.
Additionally there are a number of intersection programming examples that demonstrate putting the default rendering pipeline into picking mode. Handing the resulting color under the (x, y) impact location in the graphics buffer into diguyScenario::map_color_to_impact() allows you to retrieve an impact structure with much of this information.
These functions are not callable from script.
Example impact function:
int impact_function(diguyImpact* impact, float from_x, float from_y, float from_z, float to_x, float to_y, float to_z, diguyScenario* s) { // note the impact already has both the attacker and the munition type // set when this function is called glShadeModel(GL_FLAT); // create narrow frustum // turn on scissor test // feed data into diguy camera if you want frustum culling to work diguyApp::get_app()->set_render_pass_flags(DIGUY_RENDER_PASS_INTERSECTION); s->set_current_render_mode("intersection"); s->draw(); GLubyte pixel[3]; glReadPixels(x_center, y_center, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, (void *) pixel); diguyImpact* new_impact = scenario->map_color_to_impact(pixel[0], pixel[1], pixel[2]); // unpack data in new_impact into the callback object impact->set_valid_impact(); impact->set_target(new_impact->get_target()); impact->set_hit_link_index(new_impact->get_hit_link_index()); impact->set_hit_shape_index(new_impact->get_hit_shape_index()); return 1; }
function diguyImpact::set_valid_impact |
Prototype:
Description:void set_valid_impact();
This function sets the impact to be valid. It must be called if the impact hits a character.
function diguyImpact::set_target |
Prototype:
Description:void set_target(diguyCharacter* target);
This function allows for explicitly setting the target character of this impact object.Arguments:
Callable From:
x, y, z override target of impact
- C++
function diguyImpact::set_location |
Prototype:
Description:void set_location(float x, float y, float z);
This function allows for explicitly setting the position of this impact object.Arguments:
Callable From:
x, y, z override position of impact
- C++
function diguyImpact::set_normal |
Prototype:
Description:void set_normal(float nx, float ny, float nz);
This function allows for explicitly setting the normal of this impact object.Arguments:
Callable From:
nx, ny, nz override normal of impact
- C++
function diguyImpact::set_hit_scene_object |
Prototype:
Description:void set_hit_scene_object(diguySceneObject* scene_object);
Returns the hit scene object.
This function allows for explicitly setting the scene_object that the impact object hit.
If the octtree was used to generate the impact, this pointer will be NULL.Arguments:
Callable From:
scene_object pointer to scene object hit
- C++
function diguyImpact::set_hit_link_index |
Prototype:
Description:void set_hit_link_index(int index);
This function allows for explicitly setting the link index of this impact object.Callable From:
- C++
function diguyImpact::set_hit_shape_index |
Prototype:
Description:void set_hit_shape_index(int index);
This function allows for explicitly setting the shape index of this impact object.Callable From:
- C++
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.