PlayerControllerComponent.cpp 762 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <AnKi/Scene/Components/PlayerControllerComponent.h>
  6. #include <AnKi/Scene/SceneNode.h>
  7. #include <AnKi/Scene/SceneGraph.h>
  8. #include <AnKi/Physics/PhysicsWorld.h>
  9. namespace anki
  10. {
  11. ANKI_SCENE_COMPONENT_STATICS(PlayerControllerComponent)
  12. PlayerControllerComponent::PlayerControllerComponent(SceneNode* node)
  13. : SceneComponent(node, getStaticClassId())
  14. {
  15. PhysicsPlayerControllerInitInfo init;
  16. init.m_position = Vec3(0.0f);
  17. m_player = node->getSceneGraph().getPhysicsWorld().newInstance<PhysicsPlayerController>(init);
  18. m_player->setUserData(this);
  19. }
  20. } // end namespace anki