rotate a KinematicController

Post Reply
qualgeist
Posts: 1
Joined: Thu Aug 14, 2014 8:37 am

rotate a KinematicController

Post by qualgeist »

Hello

I am developing a Pinball-Game. I use KinematicCharacterControllers to manage the movement of the flippers but there is no way to rotate them.

I create a ghost object:

Code: Select all

ghost = new PairCachingGhostObject();
transform it to the world:
ghost.setWorldTransform(new Transform(new Matrix4f(new Quat4f(1, angle, 0, 0), new Vector3f(xLocation, highness, 2), 1.0f)));
and add thee kinematicCharacterKontroller

Code: Select all

kinematicController = new KinematicCharacterController(ghost, shape, 1.F);
I can move the Flippers using something like:

Code: Select all

flipper.getKinematicController().setWalkDirection(upDir);
But what I want is a rotation not a movement.

Sadly, there is noting like "rotation" "torque" or something like this. How to perform a former "rotation" to KinematicCharacterController ?
rebirth
Posts: 24
Joined: Thu Jul 24, 2014 2:48 am

Re: rotate a KinematicController

Post by rebirth »

The character controller doesn't handle rotations. It appears to be designed to be used with cylinders or capsules in an upright position and only takes directions to reposition itself. I think you may have to implement your own kinematic controller for your needs, and by the sounds of it it shouldn't have to be anywhere near as complex as the character controller if you only want it to hit balls. Maybe you could find another way by toggling a physics object in and out and using a high restitution setting, or detect a collision and apply a force to the ball.
Post Reply