Brian M. Ames
and 1 contributors

NAME

Rinchi::CIGIPP::CollisionDetectionSegmentNotification - Perl extension for the Common Image Generator Interface - Collision Detection Segment Notification data packet. data packet. =head1 SYNOPSIS

  use Rinchi::CIGIPP::CollisionDetectionSegmentNotification;
  my $cds_ntc = Rinchi::CIGIPP::CollisionDetectionSegmentNotification->new();

  $packet_type = $cds_ntc->packet_type();
  $packet_size = $cds_ntc->packet_size();
  $entity_ident = $cds_ntc->entity_ident(22708);
  $segment_ident = $cds_ntc->segment_ident(165);
  $collision_type = $cds_ntc->collision_type(Rinchi::CIGIPP->CollisionEntity);
  $contacted_entity_ident = $cds_ntc->contacted_entity_ident(26345);
  $material_code = $cds_ntc->material_code(56614);
  $intersection_distance = $cds_ntc->intersection_distance(10.493);

DESCRIPTION

The Collision Detection Segment Notification packet is used to notify the Host when a collision occurs between a collision detection segment and a polygon. When a segment intersects a polygon whose material code matches the collision mask defined for the segment, the IG sends a Collision Detection Segment Notification packet indicating where and with what the collision occurred. If a segment intersects multiple polygons with material codes matching the mask, only the closest intersection is returned. Segments are not tested against polygons belonging to same the entity as the segment.

Note that collision detection testing is performed every frame by the IG. If a collision detection segment has been disabled, it will be excluded from all collision testing.

EXPORT

None by default.

#==============================================================================

new $cds_ntc = Rinchi::CIGIPP::CollisionDetectionSegmentNotification->new()

Constructor for Rinchi::CollisionDetectionSegmentNotification.

sub packet_type()
 $value = $cds_ntc->packet_type();

Data Packet Identifier.

This attribute identifies this data packet as the Collision Detection Segment Notification packet. The value of this attribute must be 113.

sub packet_size()
 $value = $cds_ntc->packet_size();

Data Packet Size.

This attribute indicates the number of bytes in this data packet. The value of this attribute must be 16.

sub entity_ident([$newValue])
 $value = $cds_ntc->entity_ident($newValue);

Entity ID.

This attribute indicates the entity to which the collision detection segment belongs.

sub segment_ident([$newValue])
 $value = $cds_ntc->segment_ident($newValue);

Segment ID.

This attribute indicates the ID of the collision detection segment along which the collision occurred.

This attribute, along with Entity ID, allows the Host to match this response with the corresponding request.

sub collision_type([$newValue])
 $value = $cds_ntc->collision_type($newValue);

Collision Type.

This attribute indicates whether the collision occurred with another entity or with a non-entity object such as the terrain.

    CollisionNonEntity   0
    CollisionEntity      1
sub contacted_entity_ident([$newValue])
 $value = $cds_ntc->contacted_entity_ident($newValue);

Contacted Entity ID.

This attribute indicates the entity with which the collision occurred.

If Collision Type is set to Non-entity (0), this attribute is ignored.

sub material_code([$newValue])
 $value = $cds_ntc->material_code($newValue);

Material Code.

This attribute indicates the material code of the surface at the point of collision.

sub intersection_distance([$newValue])
 $value = $cds_ntc->intersection_distance($newValue);

Intersection Distance.

This attribute indicates the distance along the collision test vector from the source endpoint (defined by the X1, Y1, and Z1 attributes in the Collision intersection. Detection Segment Definition packet) to the point of intersection.

sub pack()
 $value = $cds_ntc->pack();

Returns the packed data packet.

sub unpack()
 $value = $cds_ntc->unpack();

Unpacks the packed data packet.

sub byte_swap()
 $obj_name->byte_swap();

Byte swaps the packed data packet.

SEE ALSO

Refer the the Common Image Generator Interface ICD which may be had at this URL: http://cigi.sourceforge.net/specification.php

AUTHOR

Brian M. Ames, <bmames@apk.net>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Brian M. Ames

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 80:

'=item' outside of any '=over'

Around line 381:

You forgot a '=back' before '=head1'