Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / 'Create3DPhysicsKinematicBody' and 'Create3DPhysicsDynamicBody' question in relation to .obj models

Author
Message
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 2nd Feb 2018 22:27
Hi everyone,

I keep getting inconsistent results when it comes to collisions in my 3D test game using the AppGameKit 2 engine. How come some 3D models end up 'floating', whereas others are not floating and seem to have an accurate collision hull / shape.

I've modelled a simple chair in MagicaVoxel ( this is basically a Minecraft-like tool for somewhat quick modelling ) and exported as an .obj file. The models are all at a 0 , 0 , 0 position exported, as I could confirm using Wings3D.

But... the collision box for physics that is created with Create3DPhysicsKinematicBody and it's DynamicBody version result in a floating chair. How can I fix this??

Can we somehow check what collision box was generated by AppGameKit ?? Apparently Debug3DPhysicsWorld() doesn't work yet.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 2nd Feb 2018 23:12
An image that shows the issue... the code itself is really nothing more but loading the '.obj' files, adding a texture and setting up the physics using Create3DPhysicsDynamicBody.
Honestly, the physics and such all work fairly fine, however the model floats as if the collision hull does not matches the 3D model.

Attachments

Login to view attachments
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 2nd Feb 2018 23:42


The chair object is loaded exactly the same way, with only change being it is not a StaticBody, but a DynamicBody...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Feb 2018 00:09
If the "center" of an object is outside the shape then AppGameKit will include the "center" point in the collision shape
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 3rd Feb 2018 00:21 Edited at: 3rd Feb 2018 00:27
Quote: "If the "center" of an object is outside the shape then AppGameKit will include the "center" point in the collision shape"


edit: Nevermind, I've found out what you meant. It's a bit weird it works like this though, but alas... Thank you!!

Login to post a reply

Server time is: 2024-11-23 00:46:17
Your offset time is: 2024-11-23 00:46:17