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

📄 mgcbeziercylinder3g.h

📁 《3D游戏引擎设计》的源码
💻 H
字号:
// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000, All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement.  The various license agreements may be found at
// the Magic Software web site.  This file is subject to the license
//
// FREE SOURCE CODE
// http://www.magic-software.com/License/free.pdf

#ifndef MGCBEZIERCYLINDER3G_H
#define MGCBEZIERCYLINDER3G_H

#include "MgcBezierCylinderG.h"
#include "MgcVector3.h"


class MgcBezierCylinder3G : public MgcBezierCylinderG
{
public:
    // Construction.  MgcBezierCylinder3G accepts responsibility for deleting
    // the input array.
    MgcBezierCylinder3G (MgcVector3* akCtrlPoint);

    // position and derivatives up to second order
    virtual MgcVector3 GetPosition (MgcReal fU, MgcReal fV) const;
    virtual MgcVector3 GetDerivativeU (MgcReal fU, MgcReal fV) const;
    virtual MgcVector3 GetDerivativeV (MgcReal fU, MgcReal fV) const;
    virtual MgcVector3 GetDerivativeUU (MgcReal fU, MgcReal fV) const;
    virtual MgcVector3 GetDerivativeUV (MgcReal fU, MgcReal fV) const;
    virtual MgcVector3 GetDerivativeVV (MgcReal fU, MgcReal fV) const;

    // tessellation by recursive subdivision
    virtual void Tessellate (unsigned int uiLevel, bool bWantNormals);

protected:
    // precomputation
    class IntervalParameters
    {
    public:
        // u = curve direction, v = cylinder direction
        unsigned int m_uiI00, m_uiI01, m_uiI10, m_uiI11;
        MgcVector3 m_aakXuu[2][2], m_akXuuu[2];
    };

    // tessellate cylinder curves by recursive subdivision
    void SubdivideCylinder (unsigned int uiCLevel, MgcVector3* akX,
        MgcVector3* akXu, MgcVector3* akXv, unsigned int uiI0,
        unsigned int uiI1, unsigned int uiTwoPowL);

    // tessellate boundary curves by recursive subdivision
    void SubdivideBoundary (unsigned int uiLevel, MgcReal fDSqr,
        MgcVector3* akX, MgcVector3* akXu, MgcVector3* akXv,
        MgcVector3 akXuuu[2], IntervalParameters& rkIP);
};

#endif

⌨️ 快捷键说明

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