Panda3D
 All Classes Functions Variables Enumerations
collisionLine.h
1 // Filename: collisionLine.h
2 // Created by: drose (05Jan05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef COLLISIONLINE_H
16 #define COLLISIONLINE_H
17 
18 #include "pandabase.h"
19 
20 #include "collisionRay.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : CollisionLine
24 // Description : An infinite line, similar to a CollisionRay, except
25 // that it extends in both directions. It is, however,
26 // directional.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDA_COLLIDE CollisionLine : public CollisionRay {
29 PUBLISHED:
30  INLINE CollisionLine();
31  INLINE CollisionLine(const LPoint3 &origin, const LVector3 &direction);
32  INLINE CollisionLine(PN_stdfloat ox, PN_stdfloat oy, PN_stdfloat oz,
33  PN_stdfloat dx, PN_stdfloat dy, PN_stdfloat dz);
34 
35 public:
36  INLINE CollisionLine(const CollisionLine &copy);
37  virtual CollisionSolid *make_copy();
38 
39  virtual PT(CollisionEntry)
40  test_intersection(const CollisionEntry &entry) const;
41 
42  virtual void output(ostream &out) const;
43 
44 protected:
45  virtual void fill_viz_geom();
46 
47 public:
48  static void register_with_read_factory();
49  virtual void write_datagram(BamWriter *manager, Datagram &dg);
50 
51 protected:
52  static TypedWritable *make_from_bam(const FactoryParams &params);
53  void fillin(DatagramIterator &scan, BamReader *manager);
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  CollisionRay::init_type();
61  register_type(_type_handle, "CollisionLine",
62  CollisionRay::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "collisionLine.I"
74 
75 #endif
76 
77 
An infinite ray, with a specific origin and direction.
Definition: collisionRay.h:31
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
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.
Definition: typedWritable.h:37
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
Defines a single collision event.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
An infinite line, similar to a CollisionRay, except that it extends in both directions.
Definition: collisionLine.h:28
static void register_with_read_factory()
Tells the BamReader how to create objects of type CollisionRay.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.