mirror of https://github.com/axmolengine/axmol.git
* Update Physics3DTest.cpp Improve #879 thanks @solan-solan * Update CCMeshRenderer.cpp #hope this is fixing #879
This commit is contained in:
parent
7a3314160c
commit
f22148e80f
|
@ -520,6 +520,7 @@ void MeshRenderer::genMaterial(bool useLight)
|
||||||
if (oldmaterial)
|
if (oldmaterial)
|
||||||
{
|
{
|
||||||
material->setStateBlock(oldmaterial->getStateBlock());
|
material->setStateBlock(oldmaterial->getStateBlock());
|
||||||
|
material->setTransparent(oldmaterial->isTransparent());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (material->getReferenceCount() == 1)
|
if (material->getReferenceCount() == 1)
|
||||||
|
|
|
@ -327,9 +327,11 @@ bool Physics3DKinematicDemo::init()
|
||||||
auto component = Physics3DComponent::create(rigidBody);
|
auto component = Physics3DComponent::create(rigidBody);
|
||||||
auto sprite = Sprite3D::create(tree1);
|
auto sprite = Sprite3D::create(tree1);
|
||||||
sprite->addComponent(component);
|
sprite->addComponent(component);
|
||||||
|
static_cast<Sprite3D*>(sprite->getChildren().at(1))->getMaterial(0)->setTransparent(true);
|
||||||
|
static_cast<Sprite3D*>(sprite->getChildren().at(1))->getMaterial(0)->getStateBlock().setCullFaceSide(CullFaceSide::NONE);
|
||||||
|
sprite->setCameraMask((unsigned short)CameraFlag::USER1 | (unsigned short)CameraFlag::USER2 | (unsigned short)CameraFlag::USER3);
|
||||||
sprite->setPosition3D(Vec3(20.0f, 0.0f, 0.0f));
|
sprite->setPosition3D(Vec3(20.0f, 0.0f, 0.0f));
|
||||||
sprite->setScale(scale);
|
sprite->setScale(scale);
|
||||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
|
||||||
this->addChild(sprite);
|
this->addChild(sprite);
|
||||||
}
|
}
|
||||||
// Issue #879 ENDS HERE
|
// Issue #879 ENDS HERE
|
||||||
|
|
Loading…
Reference in New Issue