PlayerControllerComponent.cpp 762 B

123456789101112131415161718192021222324
  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. ANKI_SCENE_COMPONENT_STATICS(PlayerControllerComponent)
  11. PlayerControllerComponent::PlayerControllerComponent(SceneNode* node)
  12. : SceneComponent(node, getStaticClassId())
  13. {
  14. PhysicsPlayerControllerInitInfo init;
  15. init.m_position = Vec3(0.0f);
  16. m_player = node->getSceneGraph().getPhysicsWorld().newInstance<PhysicsPlayerController>(init);
  17. m_player->setUserData(this);
  18. }
  19. } // end namespace anki