⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wmlportal.h

📁 3D Game Engine Design Source Code非常棒
💻 H
字号:
// Magic Software, Inc.
// http://www.magic-software.com
// http://www.wild-magic.com
// Copyright (c) 2003.  All Rights Reserved
//
// The Wild Magic Library (WML) source code is supplied under the terms of
// the license agreement http://www.magic-software.com/License/WildMagic.pdf
// and may not be copied or disclosed except in accordance with the terms of
// that agreement.

#ifndef WMLPORTAL_H
#define WMLPORTAL_H

#include "WmlSpatial.h"

namespace Wml
{

class Camera;
class ConvexRegion;
class Renderer;

class WML_ITEM Portal : public Object
{
    WmlDeclareRTTI;
    WmlDeclareStream;

public:
    // The portal is a unidirectional connector between two regions.  The
    // vertices of the portal must satisfy the following constraints:
    // 1. They must form a planar convex polygon (quantity >= 3 is implied).
    // 2. They must be counterclockwise ordered when looking through the
    //    portal to the adjacent region.
    // 3. They must be in the model space coordinates for the region that
    //    contains the portal.

    // Construction and destruction.  Portal accepts responsibility for
    // deleting the input array.
    Portal (int iVertexQuantity, Vector3f* akModelVertex,
        ConvexRegion* pkAdjacentRegion, bool bOpen);

    virtual ~Portal ();

    // member access
    ConvexRegion*& AdjacentRegion ();
    bool& Open ();

protected:
    // streaming
    Portal ();

    // updates
    friend class ConvexRegion;
    void UpdateWorldData (const Matrix3f& rkRot, const Vector3f& rkTrn,
        float fScale);

    // drawing
    void Draw (Renderer& rkRenderer);

    // portal vertices
    int m_iVertexQuantity;
    Vector3f* m_akModelVertex;
    Vector3f* m_akWorldVertex;

    // region to which portal leads
    ConvexRegion* m_pkAdjacentRegion;

    // portals can be open or closed
    bool m_bOpen;
};

WmlSmartPointer(Portal);
WmlRegisterStream(Portal);
#include "WmlPortal.inl"

}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -