Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
KinematicCharacterController.h
Go to the documentation of this file.
1#pragma once
2
3#include "physics/CollisionObject.h"
4
5#include <glm/glm.hpp>
6#include <glm/gtc/quaternion.hpp>
7#include <memory>
8
9class btPairCachingGhostObject;
10class btKinematicCharacterController;
11
12namespace eng
13{
15 {
16 public:
17 KinematicCharacterController(float raduis, float height, const glm::vec3& position);
19
20 glm::vec3 GetPosition() const;
21 glm::quat GetRotation() const;
22
23 void Walk(const glm::vec3& direction);
24 void Jump(const glm::vec3& direction);
25 bool OnGround() const;
26
27 private:
28 float m_height = 1.2f;
29 float m_radius = 0.4f;
30
31 std::unique_ptr<btPairCachingGhostObject> m_ghost;
32 std::unique_ptr<btKinematicCharacterController> m_controller;
33 };
34}