47 return entry.
get_into()->test_intersection_from_line(entry);
54 output(std::ostream &out)
const {
55 out <<
"line, o (" << get_origin() <<
"), d (" << get_direction() <<
")";
64 if (collide_cat.is_debug()) {
66 <<
"Recomputing viz for " << *
this <<
"\n";
69 static const int num_points = 100;
70 static const double scale = 100.0;
78 for (
int i = 0; i < num_points; i++) {
79 double t = ((double)i / (
double)num_points - 0.5) * 2.0;
80 vertex.add_data3(get_origin() + t * scale * get_direction());
82 color.add_data4(LColor(1.0f, 1.0f, 1.0f, 1.0f) +
83 fabs(t) * LColor(0.0f, 0.0f, 0.0f, -1.0f));
87 line->add_next_vertices(num_points);
88 line->close_primitive();
91 geom->add_primitive(line);
93 _viz_geom->add_geom(geom, get_other_viz_state());
94 _bounds_viz_geom->add_geom(geom, get_other_bounds_viz_state());
126 node->fillin(scan, manager);
137 CollisionRay::fillin(scan, manager);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Defines a single collision event.
get_into
Returns the CollisionSolid pointer for the particular solid was collided into.
An infinite line, similar to a CollisionRay, except that it extends in both directions.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
CollisionLine()
Creates an invalid line.
static void register_with_read_factory()
Tells the BamReader how to create objects of type CollisionLine.
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,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
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, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Defines a series of line strips.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
A container for geometry primitives.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PT(CollisionEntry) CollisionLine
Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.