In Physics VSyncVisibleScene function(Physics.cpp:469), in seems to me that sending the last event is unnecessary? please correct me if I'm wrong.
So we have an actor, we get it's transformation component and we set it to the matrix of the physics actor, cool. Next we send out an event with the same matrix of the physics object to move the actor.
The event is picked up by the Scene, which updates the scene node that is linked to the same actor and the same transformation component.
Did it need to do it?
Even if the event was sent in case of awareness of change to the component, there is the PreRender function in the scene node that gets it's actor's transformation component and applies it to the current matrix.
What's the point of sending this event? Shouldn't the transformation component be responsible for all transformations done to an actor, and scene nodes simply refer to it and obey it. Am I missing something here?
And many thanks for a fantastic book, almost done reading it
Source Code
- pGameActor = g_pApp->m_pGame->VGetActor(id);
- pTransformComponent = pGameActor->GetComponent<TransformComponent>(TransformComponent::g_Name);
- pTransformComponent->SetTransform(actorMotionState->m_worldToPositionTransform);
- shared_ptr<EvtData_Move_Actor> pEvent(GCC_NEW EvtData_Move_Actor(id, actorMotionState->m_worldToPositionTransform));
- IEventManager::Get()->VQueueEvent(pEvent);
So we have an actor, we get it's transformation component and we set it to the matrix of the physics actor, cool. Next we send out an event with the same matrix of the physics object to move the actor.
The event is picked up by the Scene, which updates the scene node that is linked to the same actor and the same transformation component.
Did it need to do it?
Even if the event was sent in case of awareness of change to the component, there is the PreRender function in the scene node that gets it's actor's transformation component and applies it to the current matrix.
What's the point of sending this event? Shouldn't the transformation component be responsible for all transformations done to an actor, and scene nodes simply refer to it and obey it. Am I missing something here?
And many thanks for a fantastic book, almost done reading it