27#include "PhysicsEngine/ICollisionObject.h"
29#ifdef USE_BULLET_PHYSIC_ENGINE
30#include <btBulletDynamicsCommon.h>
31#include <BulletDynamics/Character/btKinematicCharacterController.h>
32#include <BulletCollision/CollisionDispatch/btGhostObject.h>
68 class CCharacterController :
public ICollisionObject
70 friend class CPhysicsEngine;
72#ifdef USE_BULLET_PHYSIC_ENGINE
73 btPairCachingGhostObject* m_ghostObject;
74 btKinematicCharacterController* m_controller;
75 btConvexShape* m_shape;
78 CCharacterController();
80 virtual ~CCharacterController();
82 virtual void initComponent();
84 virtual void startComponent();
86 virtual void updateComponent();
236 void jump(
const core::vector3df& v);
311 void setUp(
const core::vector3df& up);
321#ifdef USE_BULLET_PHYSIC_ENGINE
322 btKinematicCharacterController* getCharacterController()
327 btPairCachingGhostObject* getGhostObject()
329 return m_ghostObject;
void setAngularDamping(float d)
Sets the angular damping coefficient.
void jump(const core::vector3df &v)
Triggers a jump with an optional initial velocity.
float getFallSpeed() const
Gets the maximum falling speed.
core::quaternion getRotation()
Gets the world rotation as a quaternion.
bool onGround()
Checks if the character is currently on the ground.
void setMaxPenetrationDepth(float d)
Sets the maximum depth the character can penetrate other objects before collision response.
bool canJump()
Checks if the character is in a state where it can jump.
core::vector3df getPosition()
Gets the current world position of the character.
float getStepHeight() const
Gets the current step height.
float getLinearDamping() const
Gets the linear damping coefficient.
void setStepHeight(float h)
Sets the step height for the character.
core::vector3df getUp()
Gets the 'up' direction.
core::vector3df getAngularVelocity() const
Gets the angular velocity.
void setPosition(const core::vector3df &pos)
Sets the world position of the character.
void applyImpulse(const core::vector3df &v)
Applies an instantaneous impulse (wraps jump).
Definition CCharacterController.h:254
void setLinearVelocity(const core::vector3df &velocity)
Sets the linear velocity of the character.
float getMaxPenetrationDepth() const
Gets the maximum penetration depth.
void setGravity(const core::vector3df &gravity)
Sets the custom gravity for this character.
bool initCharacter(float stepHeight)
Initializes the character controller in the physics world.
core::vector3df getGravity() const
Gets the custom gravity of the character.
void setMaxSlope(float slopeRadians)
Sets the maximum slope the character can walk up.
core::vector3df getRotationEuler()
Gets the world rotation as Euler angles.
virtual void setCollisionGroupAndFilter(int group, int filter)
Sets the collision group and filter mask.
void setMaxJumpHeight(float maxJumpHeight)
Sets the maximum height the character can jump.
void releaseCharacter()
Releases the character controller from the physics world.
void setWalkDirection(const core::vector3df &walk)
Sets the direction and speed the character should walk.
void syncTransform()
Synchronizes the GameObject's transform with the character's physics transform.
void setJumpSpeed(float jumpSpeed)
Sets the initial speed when jumping.
float getJumpSpeed() const
Gets the initial jump speed.
void setAngularVelocity(const core::vector3df &velocity)
Sets the angular velocity of the character.
void setRotation(const core::quaternion &q)
Sets the world rotation using a quaternion.
float getAngularDamping() const
Gets the angular damping coefficient.
void setFallSpeed(float fallSpeed)
Sets the maximum falling speed.
core::vector3df getLinearVelocity() const
Gets the linear velocity.
void setUp(const core::vector3df &up)
Sets the 'up' direction for the character.
float getMaxSlope() const
Gets the maximum slope angle.
void reset()
Resets the character controller's state and position in the dynamics world.
void setRotation(const core::vector3df &eulerDeg)
Sets the world rotation using Euler angles.
void setLinearDamping(float d)
Sets the linear damping coefficient.
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29