Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# dePortal.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file dePortal.hpp
    00003 ///
    00004 /// @brief Portal culling routines
    00005 ///
    00006 /// @author Assassin
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Jan 2002
    00023 /// @author Assassin
    00024 /// @remarks Creation
    00025 ///
    00026 ///////////////////////////////////////////////////////////////////////////////
    00027
    00028 #ifndef DEPORTAL_HPP
    00029 #define DEPORTAL_HPP
    00030
    00031 #include "deGlobalTypes.hpp"
    00032 #include "deWorld.hpp"
    00033 #include "deScene.hpp"
    00034
    00035 #define DEPORTAL_API DESCENE_API
    00036
    00037 class IdePortal;
    00038 class IdeSceneRoom;
    00039 class IdeVertexBuffer;
    00040 class IdeFileSystem;
    00041 class IdePlaneFrustum;
    00042 struct deTransformInfo;
    00043
    00044 // factory functions
    00045 /// Create an instance of IdePortal.
    00046 DEPORTAL_API IdePortal * IdePortal_CreatePortal();
    00047 /// Create an instance of IdePortal, given certain geometry.
    00048 DEPORTAL_API IdePortal * IdePortal_CreatePortalWithVerts(deVec3d Vertices[], int Num);
    00049
    00050 /// portals are used to connect IdeSceneRoom instances that would otherwise be unconnected.
    00051 /// Related functions: IdePortal_CreatePortal, IdePortal_CreatePortalWithVerts.
    00052 //class IdePortal
    00053 DE3D_INTERFACE_(IdePortal)
    00054 {
    00055 protected:
    00056     ~IdePortal() {}
    00057 public:
    00058     /// deletes the object
    00059     virtual int Release() = 0;
    00060
    00061     /// Retrieve a pointer to the portal's vertex buffer
    00062     virtual IdeVertexBuffer * GetVBuffer() = 0;
    00063     /// Tell whether or not the portal is a T-portal (has normal and transformation)
    00064     virtual deBoolean IsTPortal() const = 0;
    00065     /// Disable any T-portal behavior this portal might have.
    00066     virtual void SetTPortal(deBoolean TPortal) = 0;
    00067
    00068     /// Clip the view frustum of a camera to the screen projection of the portal
    00069 //  virtual void ClipFrustum(deTransformInfo * CamPos, const deFrustum &in, deFrustum &out) = 0;
    00070     virtual deBoolean ClipFrustum(const deTransformInfo & CamPos, const IdePlaneFrustum* in, IdePlaneFrustum* out) = 0;
    00071     /// Test whether the input view frustum potentially contains any part of the portal
    00072     virtual deBoolean IntersectsFrustum(const deTransformInfo & CamPos, const IdePlaneFrustum* f) const = 0;
    00073
    00074     /// Set the vertices of the portal. For a T-portal, these vertices must be planar
    00075     /// @param Vertices an array of vertices to set the internal vertices to
    00076     /// @param Num the number of vertices in the array
    00077     virtual void SetVertices(deVec3d Vertices[], long Num) = 0;
    00078     /// Retrieve the internally held vertices
    00079     /// @return pointer to the internal vertex array
    00080     /// @param Num a reference to a long int to be filled with the number of vertices
    00081     virtual deVec3d* GetVertices(long &Num) const = 0;
    00082
    00083     /// Retrieve the world ID of the Scene Room on the "other side" of the portal
    00084     virtual deWorldID   GetLinkWorldID() const = 0;
    00085     /// Retrieve the object ID of the Scene Room on the "other side" of the portal
    00086     virtual deObjectID  GetLinkObjectID() const = 0;
    00087     /// Set the world ID of the Scene Room on the "other side" of the portal
    00088     virtual void        SetLinkWorldID(deWorldID WorldID) = 0;
    00089     /// Set the object ID of the Scene Room on the "other side" of the portal
    00090     virtual void        SetLinkObjectID(deObjectID ObjectID) = 0;
    00091     /// Feed in a Scene Room to have the world and object ID's matched up for you
    00092     virtual deBoolean   LinkTo(IdeSceneRoom* SceneRoom) = 0;
    00093
    00094     /// Set the "face" normal of the portal
    00095     virtual void SetNormal(const deVec3d & v) = 0;
    00096     /// Retrieve the "face" normal of the portal
    00097     virtual void GetNormal(deVec3d & v) const = 0;
    00098
    00099     virtual deBoolean IsPlanar() = 0;
    00100
    00101     /// Set the world transformation of the portal's position
    00102     virtual void SetPosition(const deTransformInfo & Matrix) = 0;
    00103     /// Retrieve the world transformation of the portal's position
    00104     virtual void GetPosition(deTransformInfo & Matrix) const = 0;
    00105     /// Set the portal's transformation matrix. This matrix is used to get a concatenated
    00106     /// world matrix for objects on the "other side" of the portal
    00107     virtual void SetTransform(const deTransformInfo & Matrix) = 0;
    00108     /// Retrieve the portal's transformation matrix.
    00109     virtual void GetTransform(deTransformInfo & Matrix) const = 0;
    00110     /// Concatenate the portal's world transformation with another transform
    00111     /// @param Matrix a matrix containing a current world transform, to be concatenated with
    00112     ///               the portal's world transformation
    00113     virtual void ConcatTransform(deTransformInfo & Matrix) = 0; // const
    00114 };
    00115
    00116 #endif