Kinematic Character Controllers

#1

First experiments. Any help is welcome

https://github.com/1vanK/Urho3DKinematicCharacterController

4 Likes
A more advanced character controller
Kinematic character control with Bullet
#2

Looks good.

Try testing things like:

  • pushing against corners
  • pushing against stacked vertically segmented wall, so you collide with several segments at once
  • pushing against downward slopes
#3

can you provide scene to reproduce?

#4

each segment is a rigid body:
segments
slope

#5

i have a few question about your code ( i have not tested it yet)

why you use z-axis as up vector?

bulletController_ = new btKinematicCharacterController(ghostObject_, capsule, 0.3f, btVector3(0, 0, 1));

and later you use DOWN vector here

btTransform t;
t = bulletController_->getGhostObject()->getWorldTransform();
Vector3 newPos = ToVector3(t.getOrigin()) + Vector3::DOWN * height_ * 0.5f;

i would like to understand the mathematic behind it or kinematic …

from the youtube video it looks promising

#6

It does not matter which vector I’m setting. Vertical direction is rewritted when bulletController_->setGravity(world->getGravity());

#7

ok thanks,

when i try to run the code “I use clion with cmake” I got SIGSEGV during initialising the Application in

Game(Context* context) : Application(context)

exactly in the code in Urho3d Timer.cpp

String Time::GetTimeStamp()
{
     time_t sysTime;
     time(&sysTime); // here we got SIGSEGV
     const char* dateTime = ctime(&sysTime);
     return String(dateTime).Replaced("\n", "");
}

which get called when initialisng input and try to Log something

it seems theres some memory damage some where which i don’t know

#8

Have you copied GameData folder to *.exe dir?

EDIT: and Data+CoreData

#9

yes i done …
but as i said, it does reach the code which setup the game … it crash on constructor of Game object

#10

I’m sorry, I do not have experience with “clion” (and do not even know what it is xD ) I tested this code with VS 2015 and recheck now with VS 2017

#11

no problem … i will try to reconstruct the programm in another code example

#12

it seems the issue with global variables and global.cpp
i habe removed global.h and global.cpp and used private variables in Game class and CharacterControl class then the example works.

again thanks for this great simple example