collision bounding boxes and animation

I will attempt to explain my problem as best i can. I have an aircraft with retractable gears as bones. With the wheels parented to the gear bones…As running everything is fine. The craft acts like its supposed to. Sitting on its “wheels.”


When I manually move the gear in pose mode and play the game it still works fine and the plane rest on the wheels and will fall to their position and act right.


However when I set up an animation to retract the gear the plane still rest upright as if the wheels have not moved. Any help is appreciated.


Blend file below in next post

If anyone understands what im trying to accomplish and knows any tips. please help me out.

Heres the blend file. 2.66…hold W to retract gear. Edit: The plane should fall down but doesnt…if i turn on physics eval…the wheels collision boxes stay in the down position…i dont know why or how to fix.

gearsetupnogood.blend (480 KB)

I tried a couple of other methods also with no success…

edit:

  1. Ive tried not using an armature and just having an animation of a gear object (strut) retracting . It has the same result.
  2. Ive also just tried using a motion to retract the gear. and also the same result

Im not sure, but here is my guess. The armeture will affect the render mesh but not the phisics mesh.

Try not using an armeture. build a cube with its center point off set. use a f-curve actuator to rotate the wheel.

i actually tried that…the physics evaluation still showss the collision bounds at the starting position :frowning:

As you can see here…moving the landinggear object itself doesnt effect the physics nesh in real time.


And here even if i remove the parent and end the object…its still in the physics mesh…i dont know what im doing wrong


sorry for the double…any help is appreciated.

It has something to do with compounding collision bounds. You have compound set on the wheels , and when I untick it, the bounding boxes for the wheels move, but since they are the child of a rigid body, it’s parent’s physics reactivity takes precedence. It does not seem like local movement and compound bounding boxes work together.

The only way I could get this to work is to use rigid body joint constraints to connect the landing gear to the plane. However, I have absolutely no idea how to actuate rigid body joints gracefully… so the end result is a bounding box that moves, but not in a good way.

Another option would be to work with shapekeys on the physics mesh and update the transformation. With this ‘No Sleeping’ has to be activated, else it won’t update properly. Here’s an example.

But I think, normally, if you would update the mesh of the wheels during the animation, it would also work.
Edit: I doesn’t work with an armature, so better use separate objects for the wheels.

Attachments

reinstancePhysicsMesh00.blend (77.7 KB)

But I think, normally, if you would update the mesh of the wheels during the animation on the bones, it would also work.

Thats what I thought at first, but the documentation clearly states that it does not work for compounded physics meshes (child or parent). Maybe if the plane is a single mesh, and instead of using shape keys you just armature deform the landing gear… then you could probably use reinstancePhysicsMesh().

Not that there is anything wrong with shape keys :stuck_out_tongue:

*EDIT

Well nevermind… I don’t think armatures will work because of the parenting required in BGE. I keep forgetting that.

I forgot about that too.

I’ve actually tried swapping the mesh for a total gearless mesh. And still shows the original mesh in the physics evaluation. :D. I have not tried that reinstance mesh. I will

This works. It isn’t completely perfect, and it required a little nudging to get the the plane above ground when the gear deploys, but the alternative is horribly inefficient.

I was bored and didn’t have the patience to wait for a response :stuck_out_tongue:

Attachments

gearsetupyesgood.blend (515 KB)

@Hobomatic
your example works perfectly…I am ashamed to say I know nothing about shapekeys =( ive only done armature/bone stuff…but I must say it works exactly the way I would want it :D…and i see the little hiccup but its hardly noticable…i gotta learn shape keys now :smiley: …thanks for the help…and let me know if you have any other ideas or any other angles

Nice idea to put the Property Sensor to ‘Changed’. This way no range has to be specified. However, I think you don’t need the nudge part. And updating the physics mesh every logic tic for such a small time won’t effect the performance as much. It’s much smoother by just enabling pulse mode on the GearMove Sensor. So I would recommend that.

@ superflip: I’ve appended your scene in a ‘clean’ blend, so the file is smaller.

Attachments

reinstancePhysicsMesh01.blend (99 KB)

@ raco & hobo. sorry for the late reply and the bump but i got around to messing with this again yesterday and your example was flawless…Using the shapekey collision mesh method and a landing gear with no collision i can get the result i want :D. In the video you can see the shapekey collision meshes updating.they only update every few seconds. here is my test.

I do have a followup question. my physics spikes horribly when i change my airplane mesh to triangle mesh. it like bounces all the time and snags on flat ground.

sorry for the bump…thanks guys