Kinematic body examples


#1

Is there some Kinematic physics examples , for example moving some physics cube , all collision handled by physics , but movement handled by code ?


#2

The first and third person templates work that way .


#3

Wasn’t them RigiBody instead ? Because the scripts use Velocity that is RigidBody physics only.
While a Kinematic does not have velocity, forces or torque it’s a physics volume with collision that can only be moved by changing it’s position and rotate applying a rotation.
I’m not sure there is Kinematic support in Blender.


#4

when you move the player around you are not using velocity you are simply translating the object by a certain amount set in the character controller. However you can still interact with physics objects in the scene. Am I missing what you want to accomplish?


#5

Those templates use RigidBodies for the player, not Kinematic.
MagicLord is probably looking for the KinematicCharacterController. I’m guessing you’ll have to make a Trait that inherits from KinematicCharacterController and add it to your player. Haven’t used it yet, so I’m not sure how it works (and I can’t find an example that uses it).


#6

I was refering to physics.
3D engines allow you to define as physics object as RigidBody or Kinematic.
Kinematic means it has collision and interacts with otehr physics objects , but the object movement is driven by code like object translation or rotation, and it’s not driven by physics forces or torque.

You are right, perhaps i should look to the KinematicCharacterController that can be used for any non character object that is Kinematic.


#7

Let me know if you get this working, I managed to get a kinematic object that can move around, but it has trouble climbing ramps, and it’s always buried like 10% into the ground.


#8

Are you using a Collider over the top of the moving object to control the physics interactions? if so move the collider up and that should even out the moing object. I hope that makes sense?


#9

I was able to create a kinematic character just by extending the KinematicCharacterController:

package player;

import haxe.Log;

class PlayerController extends armory.trait.physics.bullet.KinematicCharacterController {
#if arm_bullet
	public function new() {
		super();
	 }
#end
}

After that I used nodes to call setWalkDirection() ( requires function nodes from the git version of Armory ).

Overall I think it works pretty well, but it might need some tweaks. The KinematicCharacterController is actually just a binding to a controller in Bullet so it would probably be useful to rewrite it in Haxe so it could be tweaked for different games.


#10

Use dynamic with constraints is the way to go according to this post.
https://stackoverflow.com/questions/42782748/collision-between-kinematic-bodies-in-bullet-physics

This is what i use to make kinematic

Reading Maya doc, it seems there is Kinematic Body
https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/files/GUID-F8C301AE-B746-4522-806F-27F2BC91C8B3-htm.html

There are three types of Bullet rigid bodies:

  • Dynamic rigid bodies (Body Type > Dynamic Rigid Body) are fully simulated physics objects. This type is the most performance intensive rigid body. By default, all rigid bodies are created as Dynamic rigid bodies.
  • Kinematic rigid bodies (Body Type > Kinematic Rigid Body) can be animated during the physics simulation, but they are not affected by the simulation itself. Because kinematic bodies can be moved, the Bullet physics simulation spends more time updating kinematic rigid bodies than static rigid bodies.
  • Static rigid bodies (Body Type > Static Body) do not move during the physics simulation. The Bullet physics simulation can optimize how it updates static rigid bodies in the scene since it knows their positions remain fixed between frames.

We should not need to use a work around.


#11

Yeah, I was doing a little bit of looking around on the Bullet forums. I’m not too sure about using true kinematic bodies where you have to write all of the interaction code yourself. It seems like a lot of work and like you would have to know a lot about the system. I wouldn’t call it a work-around; it is a valid way to accomplish the problem if that is what you need and you know how to do it, but it may be more work than is necessary.

I’m going to try using dynamic objects with constraints instead and see how well that works out.


#12

This is not the purpose of physic engine to write all yourself.
Good luck with your kinematic physics :sweat_smile:


#13

Set object physics to dynamic, use translate and rotate to make it kinematic.
Cancel velocity and torque when needed setting their values.