Panda3D
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
CollisionFloorMesh Class Reference

This object represents a solid made entirely of triangles, which will only be tested again z axis aligned rays. More...

#include "collisionFloorMesh.h"

Inheritance diagram for CollisionFloorMesh:
CollisionSolid CopyOnWriteObject CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Classes

struct  TriangleIndices

Public Member Functions

 CollisionFloorMesh ()
 This is only for the convenience of CollisionPolygon.
 CollisionFloorMesh (const CollisionFloorMesh &copy)
void add_triangle (unsigned int pointA, unsigned int pointB, unsigned int pointC)
 store a triangle for processing
void add_vertex (const LPoint3 &vert)
 store away a vertex to index against
virtual TypeHandle force_init_type ()
virtual LPoint3 get_collision_origin () const
 Returns the point in space deemed to be the "origin" of the solid for collision purposes.
const unsigned int get_num_triangles () const
const unsigned int get_num_vertices () const
virtual PStatCollectorget_test_pcollector ()
 Returns a PStatCollector that is used to count the number of intersection tests made against a solid of this type in a given frame.
const LPoint3d get_triangle (unsigned int index) const
virtual TypeHandle get_type () const
const LPoint3 get_vertex (unsigned int index) const
virtual PStatCollectorget_volume_pcollector ()
 Returns a PStatCollector that is used to count the number of bounding volume tests made against a solid of this type in a given frame.
virtual CollisionSolidmake_copy ()
 MAKE_SEQ (get_vertices, get_num_vertices, get_vertex)
 MAKE_SEQ (get_triangles, get_num_triangles, get_triangle)
virtual void output (ostream &out) const
virtual void write (ostream &out, int indent_level=0) const
virtual void write_datagram (BamWriter *manager, Datagram &me)
 Function to write the important information in the particular object to a Datagram.
virtual void xform (const LMatrix4 &mat)
 Transforms the solid by the indicated matrix.

Static Public Member Functions

static void flush_level ()
 Flushes the PStatCollectors used during traversal.
static TypeHandle get_class_type ()
static void init_type ()
static TypedWritablemake_CollisionFloorMesh (const FactoryParams &params)
 Factory method to generate a CollisionPolygon object.
static void register_with_read_factory ()
 Factory method to generate a CollisionPolygon object.

Protected Member Functions

virtual void fill_viz_geom ()
 Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.
void fillin (DatagramIterator &scan, BamReader *manager)
 Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
virtual PT (BoundingVolume) compute_internal_bounds() const
virtual PT (CollisionEntry) test_intersection_from_ray(const CollisionEntry &entry) const
virtual PT (CollisionEntry) test_intersection_from_sphere(const CollisionEntry &entry) const

Detailed Description

This object represents a solid made entirely of triangles, which will only be tested again z axis aligned rays.

Definition at line 32 of file collisionFloorMesh.h.


Constructor & Destructor Documentation

This is only for the convenience of CollisionPolygon.

Normally, you should not attempt to create an uninitialized CollisionPlane.

Definition at line 24 of file collisionFloorMesh.I.

Referenced by make_CollisionFloorMesh().


Member Function Documentation

void CollisionFloorMesh::add_triangle ( unsigned int  pointA,
unsigned int  pointB,
unsigned int  pointC 
)

store a triangle for processing

Definition at line 455 of file collisionFloorMesh.cxx.

void CollisionFloorMesh::add_vertex ( const LPoint3 vert) [inline]

store away a vertex to index against

Definition at line 55 of file collisionFloorMesh.I.

void CollisionFloorMesh::fill_viz_geom ( ) [protected, virtual]

Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.

Reimplemented from CollisionSolid.

Definition at line 282 of file collisionFloorMesh.cxx.

References GeomVertexWriter::add_data3(), and GeomVertexFormat::get_v3().

void CollisionFloorMesh::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.

Reimplemented from CollisionSolid.

Definition at line 386 of file collisionFloorMesh.cxx.

References DatagramIterator::get_stdfloat(), DatagramIterator::get_uint16(), DatagramIterator::get_uint32(), and LVecBase3f::read_datagram().

Referenced by make_CollisionFloorMesh().

void CollisionFloorMesh::flush_level ( ) [inline, static]

Flushes the PStatCollectors used during traversal.

Definition at line 44 of file collisionFloorMesh.I.

Returns the point in space deemed to be the "origin" of the solid for collision purposes.

The closest intersection point to this origin point is considered to be the most significant.

Implements CollisionSolid.

Definition at line 87 of file collisionFloorMesh.cxx.

References LPoint3f::origin().

Returns a PStatCollector that is used to count the number of intersection tests made against a solid of this type in a given frame.

Reimplemented from CollisionSolid.

Definition at line 346 of file collisionFloorMesh.cxx.

Returns a PStatCollector that is used to count the number of bounding volume tests made against a solid of this type in a given frame.

Reimplemented from CollisionSolid.

Definition at line 334 of file collisionFloorMesh.cxx.

Factory method to generate a CollisionPolygon object.

Definition at line 418 of file collisionFloorMesh.cxx.

References CollisionFloorMesh(), and fillin().

Referenced by register_with_read_factory().

void CollisionFloorMesh::write_datagram ( BamWriter manager,
Datagram me 
) [virtual]

Function to write the important information in the particular object to a Datagram.

Reimplemented from CollisionSolid.

Definition at line 357 of file collisionFloorMesh.cxx.

References Datagram::add_stdfloat(), Datagram::add_uint16(), and Datagram::add_uint32().

void CollisionFloorMesh::xform ( const LMatrix4 mat) [virtual]

Transforms the solid by the indicated matrix.

Reimplemented from CollisionSolid.

Definition at line 57 of file collisionFloorMesh.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations