mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
Added rotation field to player and pass them to jolt
This commit is contained in:
@@ -13,8 +13,9 @@ namespace Nuake
|
||||
class CharacterController
|
||||
{
|
||||
public:
|
||||
|
||||
Vector3 Position = Vector3(0, 0, 0);
|
||||
Quat Rotation = Quat(1, 0, 0, 0);
|
||||
|
||||
Entity Owner;
|
||||
|
||||
bool IsOnGround = false;
|
||||
@@ -25,8 +26,6 @@ namespace Nuake
|
||||
float Friction = 0.5f;
|
||||
Ref<PhysicShape> Shape;
|
||||
|
||||
//bool m_onJumpableGround; // A bit lower contact than just onGround
|
||||
|
||||
float m_bottomYOffset;
|
||||
float m_bottomRoundedRegionYOffset;
|
||||
|
||||
|
||||
@@ -286,10 +286,12 @@ namespace Nuake
|
||||
const auto& capsuleColliderComponent = entity.GetComponent<CapsuleColliderComponent>();
|
||||
auto& capsule = capsuleColliderComponent.Capsule;
|
||||
|
||||
float friction = characterControllerComponent.Friction;
|
||||
float maxSlopeAngle = characterControllerComponent.MaxSlopeAngle;
|
||||
const float friction = characterControllerComponent.Friction;
|
||||
const float maxSlopeAngle = characterControllerComponent.MaxSlopeAngle;
|
||||
auto characterController = CreateRef<Physics::CharacterController>(capsule, friction, maxSlopeAngle);
|
||||
characterController->SetEntity(entity); // Used to link back to the entity
|
||||
characterController->Position = transformComponent.GetGlobalPosition();
|
||||
characterController->Rotation = transformComponent.GetGlobalRotation();
|
||||
|
||||
characterControllerComponent.CharacterController = characterController;
|
||||
PhysicsManager::Get().RegisterCharacterController(characterControllerComponent.CharacterController);
|
||||
|
||||
Reference in New Issue
Block a user