home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************
- // DIVE Laboratories, Inc.
- // Copyright(c) 1995
- // All rights reserved.
- // FILE: UNIV.HPP
- //
- // DESCRIPTION
- // This file provides the function prototypes for the universeClass
- //
- // Author: M. Doucet
- //
- // Modification History:
- // 4/27/95 Created
- //
- //**********************************************************************
- #ifndef _UNIV_HPP
- #define _UNIV_HPP
-
- #include "slink.hpp"
- #include "geometry.hpp"
- #include "shapes.hpp"
- #include "intxmsg.hpp"
-
- #ifndef AMBERRT
- #include "light.hpp"
- #ifdef INDIGO2
- #include <X11/Intrinsic.h>
- #endif
- #endif
-
- #define RENDER_NORMAL 0x01
- #define RENDER_BOUNDINGBOX 0x02
- #define RENDER_BOTHSIDES 0x08
- #define RENDER_FOG 0x10
- #define RENDER_MATERIAL 0x20
-
- class channelClass;
- class geoStateClass;
- class universePrivateClass;
- class simClass;
-
- class universeClass {
-
- friend class amberClass;
- friend class amberPrivateClass;
- friend class channelClass;
- friend class materialClass;
- friend class textureClass;
- friend class geometryClass;
- friend class geometryPrivateClass;
- friend class simClass;
-
- private:
-
- universePrivateClass *data;
-
- public:
-
- #ifndef AMBERRT
-
- // Light
- lightClass *light0,
- *light1,
- *light2,
- *light3,
- *light4,
- *light5,
- *light6,
- *light7;
-
- // Light functions
- void resetLights();
- void clearLights();
- void setAmbientLight(F4 col);
- void getAmbientLight(F4 col);
-
-
- // Universe rendering
- void render(channelClass *ch);
-
- #endif
-
- // Geometry functions
- int addGeo(geometryClass *g);
- geometryClass *getGeo(int index);
- geometryClass *getGeo(char *name);
- void removeGeo(geometryClass *g);
- void removeAllGeo();
-
- // Picking Functions
- #ifdef ADVANCED_COLLISION
- Vres heightAboveNearest(V3 fromPos);
- #endif
-
- // Picking Functions
- geometryClass* pickGeometry( V3 fromPos, V3 toPos );
- polygonClass* pickPolygon( V3 fromPos, V3 toPos );
- intxMsgClass* pick( V3 fromPos, V3 toPos, flagType polyIntx=TRUE );
-
- #ifdef BRYON_HUH
- //Pick Exclusion Functions:
- void setExcludedGeo( geometryClass *eGeo, flagType childFlag=FALSE);
- void addExcludedGeo( geometryClass *eGeo, flagType childFlag=FALSE);
- void removeExcludedGeo( geometryClass *iGeo, flagTyoe childFlag=FALSE);
- void clearExcludedList( void );
- void getExcludedList( sLinkClass *eList );
- #endif
-
- // Utility functions
- void recomputeExtents();
- int getNumPolygons();
- void getExtents(V3 ext);
- Vres getRadius();
- void getMidpoint(V3 mid);
- int getId();
- float frameRate();
- float deltaTime();
- void resetFrameCnt();
-
- // Name functions
- char *getFilename();
- void setName(char *nm);
- char *getName();
-
- // File functions
- void save(char *filename);
- void saveAllGeos(fileEnumType fileType=_VRML_FILE);
- void read(char *filename);
-
- // Universe Law Controls
- //
- #ifdef AMBERRT
- void addLaw(LAWFUNCPTR func);
- void removeLaw(LAWFUNCPTR func);
- #endif
- void addLaw(GEOLAWFUNCPTR func);
- void removeLaw(GEOLAWFUNCPTR func);
-
- // Constructor & Destructor
- universeClass(int makeCurrent=1);
- ~universeClass();
- };
-
- #endif
-
-