Added debug view to PhysicsNodes


I just added a simple debug view to physics nodes. A method attachDebugShape() in PhysicsNode allows attaching a wireframe mesh that makes the current collision shape visible.

I also disallowed scaling of PhysicsNodes and PhysicsNodes do not propagate scaling info from their parent anymore as this mostly messed up the visual vs physics representation.



Who's nehon?

Attach the debug shape after you have created the collision shape, before you add the PhysicsNode to the physics space, seems like the debug shape for the ramp has been generated after you created a PhysicsNode w/o a collision shape (which you shouldn't do) and before it got assigned its CollisionShape. Lets see where the ramp really is :stuck_out_tongue:

Im not sure why that would be the case because i was doing things in the correct order - however I have now put the  attachDebugShape straight after the physicsNode declaration  - passing both player + terrain constructors their appropriate collision shapes.

I add the same code to attempt to look at the collision shape of the terrain however it doesnt show the colour i,e


And my terrain looks as it does in that foto?

Is it also possible to set it as a wireframe as opposed to a solid material? Im unsure if there is a wireframe material!?

Who is nehon?

Norman? Who is that?? terrain.attachDebugShape(assetManager) yields a wireframe shape.

Sweet, fixed now :

Uploaded with

Cheers Normen - brilliant response to the community requests.

So, explain. The ramp was also shifted and thats why the board seemingly dangled around?

Note that due to the fact that the snowboards collision shape is shifted down its center of mass is above it. You should probably re-edit the board and center it in your modelling software.

I had a call to setLocalTranslation(0,0,0) on the terrain which was called before i added the debug shape - doubt it was that though.

I had also called setLocalTranslation(0,10,0) on the snowboard before I had attached the debug shape so this was probably the reason.

Did you remember about the snowboard from before? Good memory - it was my very bad modelling and plan to get a proper one soon so no doubt that will be centered!


normen said:

Who's nehon?

heu...that would be me...but i really don't understand what i'm doing in this conversation....

Anyway great job Normen :p
nehon said:

heu...that would be me...but i really don't understand what i'm doing in this conversation....
Anyway great job Normen :p

Lol, right xD.. renegadelady was first thanking you, then edited it to "norman" and now its "normen" (2.nd post ;))

haha, i had nehon on the brain for some reason, think id just read one of his posts - i know this magic was all down to you norman!


Dude you should read twice what you're posting  XD

I think he’s talking about me, The Nor Man!

I humbly accept.

Well, if we put together beard, hair and our ages this might depict us both xD