15 #include "collisionLine.h"
16 #include "collisionHandler.h"
17 #include "collisionEntry.h"
18 #include "config_collide.h"
21 #include "boundingLine.h"
25 #include "datagramIterator.h"
26 #include "bamReader.h"
27 #include "bamWriter.h"
29 #include "geomLinestrips.h"
30 #include "geomVertexWriter.h"
52 return entry.get_into()->test_intersection_from_line(entry);
61 output(ostream &out)
const {
62 out <<
"line, o (" << get_origin() <<
"), d (" << get_direction() <<
")";
73 if (collide_cat.is_debug()) {
75 <<
"Recomputing viz for " << *
this <<
"\n";
78 static const int num_points = 100;
79 static const double scale = 100.0;
82 ("collision", GeomVertexFormat::get_v3cp(),
87 for (
int i = 0; i < num_points; i++) {
88 double t = ((double)i / (
double)num_points - 0.5) * 2.0;
89 vertex.add_data3(get_origin() + t * scale * get_direction());
92 fabs(t) *
LColor(0.0f, 0.0f, 0.0f, -1.0f));
96 line->add_next_vertices(num_points);
97 line->close_primitive();
100 geom->add_primitive(line);
102 _viz_geom->add_geom(geom, get_other_viz_state());
103 _bounds_viz_geom->add_geom(geom, get_other_bounds_viz_state());
142 parse_params(params, scan, manager);
143 node->fillin(scan, manager);
157 CollisionRay::fillin(scan, manager);
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
The abstract base class for all things that can collide with other things in the world, and all the things they can collide with (except geometry).
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
CollisionLine()
Creates an invalid line.
Defines a single collision event.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
This is the base class for all three-component vectors and points.
An infinite line, similar to a CollisionRay, except that it extends in both directions.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
Defines a series of line strips.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
static void register_with_read_factory()
Tells the BamReader how to create objects of type CollisionLine.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.