Original Post
I have this class called cEntity3D which has a WorldPosition class in it.
I made an inherited class called cActor3D
I also have an WorldManager that has a hash map of DWORD/cEntity3D (ID and entity) which can have entities added to it.
The next few lines of code work just fine:
But:
Does not work at all if the retrieved Entity (in this case it is the same actor we created above) is an cActor3D. Also updates inside the WorldManager and collision tests don't seem to work properly when the entity retrieved is inherited and not the original cEntity3D class.
Any suggestions?
I made an inherited class called cActor3D
I also have an WorldManager that has a hash map of DWORD/cEntity3D (ID and entity) which can have entities added to it.
The next few lines of code work just fine:
cActor3D* actor = new cActor3D();actor->SetModel("Content/char.X");actor->GetWorldPosition()->MoveY(100);WorldManager->AddEntity(actor, false);But:
WorldManager->GetEntity(0)->GetWorldPosition()->MoveX(-speed * GlobalTimer->GetTimeFromLastFrameMicroF());Does not work at all if the retrieved Entity (in this case it is the same actor we created above) is an cActor3D. Also updates inside the WorldManager and collision tests don't seem to work properly when the entity retrieved is inherited and not the original cEntity3D class.
Any suggestions?