IEntity::SetScale does not work


I created an IEntity object. Its name is var

Code: Select all

var = gEnv->pEntitySystem->SpawnEntity(blablabla); var->LoadGeometry(0, "objects/bla.cgf"); var->SetMaterial(gEnv->p3DEngine->GetMaterialManager()->LoadMaterial("objects/bla")); // In another function, this is called var->SetScale(Vec3(2.f, 2.f, 2.f));
But nothing happened. I mean, I can see the UI object but when I trigger the function that runs SetScale, object does not expand. Can somebody tell why?


Re: IEntity::SetScale does not work

I took a look at the code in Entity.cpp, and the following occurs when the engine saves the value in m_vScale, and then updates a world matrix, check that after the SetScale command the matrix is being modified and if so, if some line forward Is restoring the world matrix somehow.

Like this:

Code: Select all

Matrix34 mat1 = GetEntity()->GetWorldTM(); GetEntity()->SetScale(Vec3(0.2, 0.2, 0.2)); Matrix34 mat2 = GetEntity()->GetWorldTM();

Who is online

Users browsing this forum: No registered users and 1 guest