Jump to content

how add physics in babylon scene that export from unity?


1man
 Share

Recommended Posts

 

I tried to export unity scene from unity and enable the physics. 

But I can't find where babylon create the mesh in index.html that export from unity and what babylon do to recognise all model in unity scene?

As I want to set the mass for each model , is there some where can find the register for all game objects ? 

Anyone also can explain how babylon work with the cannonjs to set the collider for each model ? 

 

Link to comment
Share on other sites

On 3/3/2018 at 7:59 PM, 1man said:

 

I tried to export unity scene from unity and enable the physics. 

But I can't find where babylon create the mesh in index.html that export from unity and what babylon do to recognise all model in unity scene?

As I want to set the mass for each model , is there some where can find the register for all game objects ? 

Anyone also can explain how babylon work with the cannonjs to set the collider for each model ? 

 

NOTE: Some menu options many be different in the version you have. But they basically work the same way.

First make sure you ADD A Default Scene Controller. This gives you more control over the default scene options

1... Create a Empty Game to object to hold you Default Scene Controller component

2... Attach a Scene Controller Component (BabylonJS->System Components->Default Scene Controller)

3... Make sure Physics is enabled for the scene (Should be by default)

5aa1194ac8012_ScreenShot2018-03-08at12_59_52AM.png.bd8b3600ef5a838aa32b5aec083b1cd1.png

 

4... Add Physics State Component to the mesh game objects (BabylonJS->System Components->Physics State)

Example Ground Plane with Mass = 0 

5aa1198f7a75c_ScreenShot2018-03-08at1_00_23AM.png.d10af1d08d16381b73f315013bc7b17c.png

Example Cube with Mass = 1

5aa119aa4b899_ScreenShot2018-03-08at1_00_57AM.png.d8c18afd58365e4164e1a22071634b13.png

 

Thats it... :)

Note: There is no Magic being done in the index.html. That is simply s SCENE LOADER page.

All the magic comes from the Scene Manager Extension that is included in the Toolkit (also available in Extensions section on BabylonJS GitHub)

The Scene Manager has a Scene Loader Plugin... It works just like the STL or OBJ Loader Plugins EXCEPT this plugin actually PARSES all the Unity metadata and this is where I GIVE IT LIFE. Everything the toolkit does that NOT simply a Camera, Light Or Mesh Export is ultimately handle by the Scene Manager API (Gives the whole Managed Scene Component Life Cycle as well as a UNITY -LIKE api to create your games with) :)

I will be coming out with a Babylon Toolkit 3.2 version soon (Still working out some animation stuff that is using a small modification to the babylon.runtimeAnimation.ts and the new animationsovverideproperties.blendValueFunction I depend on for animations)

Anyways once we (Me and @Deltakosh) work that out (and clean up a few other small things)... I will release. 3.2 Version.

Your gonna luv this new Version... OUT-OF THE Box features

1... Unity - Like Mechanim Animation System complete with State Machine, Transitions and Blend Trees.

2... Native Xbox (And Xbox Live) Game development with reatime build iterations and realtime Xbox One Console Development (With Browser Console Debugging). Basically a Javascript UWP Host application with the new BabylonToolkit.XboxLive Plugin now available on Nuget

3... Built-In Local Multiplayer Supports up to four players (Each with there own separate Gamepad Inputs, Xbox Live User Accounts and Options Multiplayer View with view GUI Elelemts). Example 4 Local Multiplay Player View Screen Shot:

5aa11d4b1a65d_ScreenShot2018-03-08at1_23_31AM.thumb.png.655cd8d951de1e26ce68fb74976e6555.png

Really Kool stuff coming up :)

 

Link to comment
Share on other sites

7 hours ago, Deltakosh said:

We need documentation update my dear!

Yeah, it needs a documentation update. There are a few changes in the version so existing docs have to redone as well.

I will get to it when i can. It seems I am the ONLY one working on Toolkit and I CANT get ANYBODY to really work WITH me. Not just a few snippets on this forum which can take any where from DAYS to WEEKS to get any kind of response (And hope and pray its actually useful info). So thats how i am working now (THANKS AGAIN TO EVERYONE WHO HAS HELPED ANSWER MY QUESTIONS ON THE FORUM... Could NOT have gotten this far without the forum).

But i cant seem to get anyone to actually work with me. Talk to me (using real human spoken words)... Someone to bounce ideas off of. Someone to handle some of the C# side that prepares the exported scene content. Some to help on the BabylonJS framework side, things like DOUBLE CHECKING all the PBR Material stuff. Stuff like working on the toolkit "Shuriken Style particle system" that needs UPDATE-OVER-TIME features. Stuff like the Terrain Builder shader needs some attention when view far away... i think thats a mipmap issue in the splatmap shader. I am still trying to work out a Mechanim-Like animation system. 

Basically the same stuff  i needed help with when i release the first toolkit and listed a bunch of outstanding issues. i was able to muttle thru myself and knock out a few of them (Including teaching myself animations and blending techniques). All of this and STILL try write UP-DO-DATE documentation.

Well i fear this all becoming TOO MUCH for me by myself and sometimes i gotta work my self up to keep going with things (sometimes i get discouraged... especially when i get stuck and have KNOW ONE to work with)

Anyways my current focus is ANIMATION ... it may not seems important, but when you get down to trying to make some real games (following different Unreal of Unity tutorials for learning the actual game concept)... Every things is based off some kind of Character Animation... Since Unity 3.5 ... All animations in unity use the mechanim animation system... based of a State Machine, Transitions and Blend Trees... That is what i am trying to get done.

I cant really finish ANY of my game projects (Like Space Shooter, and Survival Shooter) until i get Particle Systems working like the Unity Shuriken Particle System and I get animations going like Unity mechanim. Then i will come back to updating the docs... UNLESS SOMEONE ELSE OUT THERE WANT TO HELP AND BE THE DOCS GUY... He or she can work with me and play around the new toolkit features and write the updated docs for it

But if know one chips in, i will get to as soon as i can :)

 

Link to comment
Share on other sites

Welcome in my life :D

But you are certainly not alone. I keep adding features to help with your tools. But believe me: no one will help you if they don't understand how to use the product.

The first step to ignite the community is to stop all features. All of them. Stop adding stuff. Then write a freaking clear doc, with samples, Put yourself in your users shoe.

Then get feedback, start writing issues (We have a repro that you can freely use), document what is missing not in a deadly long post that no one will read but in synthetic issues in the repo

Fix bug, stabilize, handle corner cases.

Then people will come, It was EXACTLY the case for Babylon.js. Same thing. Believe me. Stop adding features that no one will use because they don't even know they exist.

Link to comment
Share on other sites

See? :) It is already working. 

For Particle system, I would like to add more options for 3.3 so after documentation it will be the right time to discuss what you need

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...