void PhysicsComponent::receive(const ComponentMessage& message){
	if (message.getMessageCategory() == ComponentMessage::CATEGORY_MISC){
		if (message.getMessageType() == ComponentMessage::MISC_CLEAN){
			doneCollisions_.clear();
		}
	}
}
Example #2
0
void PhysicsComponent::handleMessage(ComponentMessage& message)
{
   using namespace ComponentInterface;

   switch ( message.getMessageType() )
   {
      case ePositionChangedMsg:
      case eRotationChangedMsg:
         {
            mpBody->setTransform(getEntity().getTransform());
         }
         break;
      case eQueryBodyMsg:
         {
            QueryBodyComponentMessage& query = static_cast<QueryBodyComponentMessage&>(message);
            query.setBody(*mpBody);
         }
         break;
      default:
         break;
   }
}