本文整理汇总了C++中GeometryGenerator::CreateBox2Tex方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryGenerator::CreateBox2Tex方法的具体用法?C++ GeometryGenerator::CreateBox2Tex怎么用?C++ GeometryGenerator::CreateBox2Tex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryGenerator
的用法示例。
在下文中一共展示了GeometryGenerator::CreateBox2Tex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XMMatrixIdentity
//Makes a Square by default
Entity::Entity(int type, std::string label, float width, float height, float depth) :
mPosition(0.0f, 0.0f, 0.0f),
mShadowScale(0.0f, 0.0f, 0.0f),
mRight(1.0f, 0.0f, 0.0f),
mUp(0.0f, 1.0f, 0.0f),
mLook(0.0f, 0.0f, 1.0f),
prevPitch(0.0f),
rotationY(0.0f),
prevRoll(0.0f),
origTexScale(1.0f, 1.0f, 1.0f),
texTrans(0.0f, 0.0f, 0.0f),
texTransMult(0.0f, 0.0f, 0.0f),
mGoToPos(0.0f, 0.0f, 0.0f),
currProgress(0.0f),
rotationZ(0.0f),
mDistanceLeft(0.0f),
mTexWidth(0.0f),
mTexHeight(0.0f),
mUpDown(false),
mGrowing(false),
mSquishX(false),
mSquishY(false),
mSquishZ(false),
mOrigY(0.0f),
mOrigX(0.0f),
mOrigZ(0.0f),
mGrowOut(false),
mHeightToGo(0.0f),
mScale(1.0f),
mWidth(width),
mHeight(height),
mDepth(depth),
hovering(false),
useTexTrans(false),
progressBar(false),
goToPos(false),
billboard(false),
flipUpright(false),
reverseLook(false),
mDead(false),
mSpinning(false),
mExplode(false),
mBasicTexTrans(false),
mUseAnimation(false),
mUseAAB(false),
mUseAABOnce(false),
mGoUp(true),
mBackFaceCull(true),
mGoDown(false),
mSideToSide(false),
mPulse(false),
mOrbit(false),
turnAngle(0.0f),
explosionDist(0.0f),
mAnim(0),
movementMult(0.0f),
mFlipping(false),
mRolling(false),
mBackAndForth(false),
mGrow(true),
mShrink(false),
mGrowIn(false),
mFlipTexture(false),
mTexRotate(false),
mLabel(label)
{
//SET MATERIAL
mMat.Ambient = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f);
mMat.Diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f);
mMat.Specular = XMFLOAT4(1.0f, 1.0f, 1.0f, 48.0f);
GeometryGenerator geoGen;
//FLOOR PLANE
XMMATRIX I = XMMatrixIdentity();
XMStoreFloat4x4(&mWorld, I); XMStoreFloat4x4(&mShadowTrans, I);
switch (type)
{
case 0: geoGen.CreateGrid(width, height, 2, 2, mGrid); break;
case 1: geoGen.CreateSphere(width, height, height, mGrid);/*height is slice count .. width for radius*/ break;
case 2: geoGen.CreateUprightSquare(width, height, mGrid); break;
case 3: geoGen.CreateBox(width, height, depth, mGrid); break;
case 4: geoGen.CreateFrontandBackFace(width, height, depth, mGrid); break;
case 5: geoGen.CreateCylinder(width, depth, height, 15, 2, mGrid); break;
case 6: geoGen.CreateBox2Tex(width, height, depth, mGrid); break;
}
mIndexCount = mGrid.Indices.size();
mMeshVertices.resize(mGrid.Vertices.size());
}