Panda3D

lwoSurfaceBlockProjection.h

00001 // Filename: lwoSurfaceBlockProjection.h
00002 // Created by:  drose (24Apr01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef LWOSURFACEBLOCKPROJECTION_H
00016 #define LWOSURFACEBLOCKPROJECTION_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "lwoChunk.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : LwoSurfaceBlockProjection
00024 // Description : Indicates the projection mode for this particular
00025 //               shader.  This determines how UV coordinates should be
00026 //               computed based on the vertex positions.  This is a
00027 //               subchunk of LwoSurfaceBlock.
00028 ////////////////////////////////////////////////////////////////////
00029 class LwoSurfaceBlockProjection : public LwoChunk {
00030 public:
00031   enum Mode {
00032     M_planar        = 0,
00033     M_cylindrical   = 1,
00034     M_spherical     = 2,
00035     M_cubic         = 3,
00036     M_front         = 4,
00037     M_uv            = 5
00038   };
00039   Mode _mode;
00040 
00041 public:
00042   virtual bool read_iff(IffInputFile *in, size_t stop_at);
00043   virtual void write(ostream &out, int indent_level = 0) const;
00044 
00045 public:
00046   virtual TypeHandle get_type() const {
00047     return get_class_type();
00048   }
00049   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00050   static TypeHandle get_class_type() {
00051     return _type_handle;
00052   }
00053   static void init_type() {
00054     LwoChunk::init_type();
00055     register_type(_type_handle, "LwoSurfaceBlockProjection",
00056                   LwoChunk::get_class_type());
00057   }
00058 
00059 private:
00060   static TypeHandle _type_handle;
00061 };
00062 
00063 #endif
00064 
00065 
 All Classes Functions Variables Enumerations