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);
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
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,...
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
CollisionLine()
Creates an invalid line.
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,...
PT(CollisionEntry) CollisionLine
Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Defines a single collision event.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A container for geometry primitives.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An infinite line, similar to a CollisionRay, except that it extends in both directions.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
get_into
Returns the CollisionSolid pointer for the particular solid was collided into.
Defines a series of line strips.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.