Subentity default material

Problems building or running the engine, queries about how to use features etc.
Post Reply
Twiggler
Gnoblar
Posts: 1
Joined: Sun Aug 23, 2015 9:50 am

Subentity default material

Post by Twiggler »

As of commit 4e65c4f, OgreSubEntity no longer seems to set a default material in branch v1.9.
Because the lines which originally took care of that are commented out, I am unsure if this behavior is correct.
In my own branch I decided the behavior is incorrect and wrote:

Code: Select all

SubEntity::SubEntity (Entity* parent, SubMesh* subMeshBasis)
        : Renderable(), mParentEntity(parent), //mMaterialName("BaseWhite"),
		mSubMesh(subMeshBasis), mCachedCamera(0)
    {
        //mMaterialPtr = MaterialManager::getSingleton().getByName(mMaterialName, subMeshBasis->parent->getGroup());
        mMaterialLodIndex = 0;
        mVisible = true;
        mRenderQueueID = 0;
        mRenderQueueIDSet = false;
        mRenderQueuePrioritySet = false;
        mSkelAnimVertexData = 0;
        mVertexAnimationAppliedThisFrame = false;
	mSoftwareVertexAnimVertexData = 0;
	mHardwareVertexAnimVertexData = 0;
	mHardwarePoseCount = 0;
	mIndexStart = 0;
        mIndexEnd = 0;
        setMaterialName("BaseWhite");  // <--- Added line
    }
Best,
Twiggler
Post Reply