Beispiel #1
0
void WBCompEldMesh::UpdateMesh(const float DeltaTime) {
  XTRACE_FUNCTION;

  ASSERT(m_Mesh);

  const bool TransformUpdated = UpdateMeshTransform();

  UpdateIrradiance(DeltaTime);

  if (m_Mesh->IsAnimated()) {
    m_Mesh->Tick(DeltaTime);
  }

  // HACK: Optimization: only send event if transform was updated.
  if (TransformUpdated && m_SendUpdatedEvent) {
    WB_MAKE_EVENT(OnMeshUpdated, NULL);  // HACK: Optimization: don't provide
                                         // entity for context, clients of
                                         // OnMeshUpdated don't need it

    // HACK: Optimization: bypass event manager and send event directly to
    // dependent components
    if (m_DependentDropShadow) {
      m_DependentDropShadow->HandleEvent(WB_AUTO_EVENT(OnMeshUpdated));
    }

    if (m_DependentFrobbable) {
      m_DependentFrobbable->HandleEvent(WB_AUTO_EVENT(OnMeshUpdated));
    }
  }
}
void TCompCharacterController::update(float dt)
{
	PROFILE_FUNCTION("update");
	if (m_active) {
		RecalcOnGround();
		UpdateFriction(dt);
		RecalcSpeed(dt);
		RecalcMovement(dt);
		ApplyPendingMoves(dt);
		UpdateMeshTransform();
	}
}