Is it possible to change the type of CollissionShape from the SDK?

Hello everyone,

When using physics,
Is it possible to change the type of CollissionShape from the SDK?
I would like to be able to apply different shape (eg CapsuleShape, BoxShape, …) to my Spatials.

It seems that when adding a shape collision from the SDK (PhysicsControl), only the mesh is used to generate the shape.

I would like to be able to choose another shape from the SDK

thank you in advance

Thoced

PS : sorry for my English

1 Like

I implemented this functionality in my editor:

1 Like

Hello,

Yes I had seen another publication where you indicated that this feature existed in Shapship Editor.

I tried your editor and it works well but I hesitate to use it more regularly because it is not possible to program directly in the editor as via NetBean.

1 Like

hm, I think it isn’t a problem because the main idea of using my editor, it’s using with IDE together, I mean you have a java project and an asset folder in the project and the editor works with only the asset folder. You can edit files in the asset folder from IDE and the editor will see these changes itself.

1 Like

Indeed it is a solution,

I will try what you say, I take this opportunity to congratulate you and encourage you to continue its development

Great job

Thoced

1 Like

thanks :slight_smile:

1 Like

A small question,

Textures are not applied to materials when they are placed from the SDK and vice versa when they are placed from Spaceshift Editor, they are not visible.

It’s as if the path to the textures were not good.

Have you ever observed this problem?

The SDK throws an exeption “AssetNotFoundException”

Thoced

1 Like

Can you make a screenshot with location of your project folder, asset folder, and screenshot from the editor?

1 Like

When I place the texture from JmonkeyEngine SDK

The SpaceShift material editor tells me the following AssetNotFoundException exeption:

com.jme3.asset.AssetNotFoundException:
Models/LEVEL02/boxdyn/TexturesCom_Cargo0095_S.jpg (Mipmapped)"

When I create the materials from SpaceShift Editor,

JmonkeyEngine SDK gives the following exeption:

“com.jme3.asset.AssetNotFoundException:
SimuPol/assets/Models/LEVEL02/boxdyn/TexturesCom_Cargo0095_S.jpg”

One application uses the path from the root of the project the other application uses the path from the Models directories

Ps: I have a problem to send ScreenShots

1 Like

I think I have found my problem, I did not select the AssetFolder
Thanks

It now works

1 Like

:wink:

1 Like

How to convert j3s to j3o?.

I create a scene with SpaceShift but I can not then convert it to j3o

Thanks

1 Like

If you want to use j3o, you need to create a model. j3s it’s my extension, you can use it in your project if you add
https://bitbucket.org/JavaSabr/jme3-spaceshift-extension
to your project and install a loader:
SceneLoader.install(application);

1 Like

This is not supported yet unfortunately[quote=“thoced, post:9, topic:38961”]
JmonkeyEngine SDK gives the following exeption:

“com.jme3.asset.AssetNotFoundException:
SimuPol/assets/Models/LEVEL02/boxdyn/TexturesCom_Cargo0095_S.jpg”
[/quote]
This is definitely wrong, the asset loader always starts of the assets folder. Also note that asset-related things can also depend on the loader you used (like when you convert things from .blend, the BlenderImporter creates the Materials and sets the Path to the Texture).

BTW: When using the SDK you have Code Completion for Asset Names (like when you type loadModel("Models/...)

1 Like

Thanks for the answer, do you know if this option will be implemented in the SDK later or is it not on the agenda?

1 Like

Hey, “not on the agenda” is probably a good description for this, yes. We actually didn’t really have demand for that before, but we can consider adding it.

The “Problem” is I think the CollissionShapes aren’t “common” meshes, so I think you can’t easily rotate, scale or move them, you could only always generate a new primitive shape with different parameters (I think).

1 Like

Thats true, however theres a workaround for this (and for general mesh primitives). Just make your own AssetPack with geometry primitives as well as nodes with collision shapes.

But as Darkchaos says, its not that easy to change the collision shape so a GUI for that could be nice. Somebody actually did that but effectively… Whats the point? You probably won’t use boxes in a production game and you can make hull collision shapes that perform almost as well.

You could also make a Control that creates the appropriate collision shape based on the object size etc. Also, the SDK is designed to make it easy to add your own actions as it was basically designed as a BASE for editors, not as an editor per se. Thats also why the functionality of the “editor” is relatively limited - but people rather roll their own editors instead of contributing.

2 Likes

Lol, good one. :smiley: We even have to merge box colliders toghether for Lightspeed Frontier and preformance is still not very good.

1 Like

I offer you to use IDE like IntelliJ IDEA with SS editor[quote=“normen, post:17, topic:38961”]
Thats also why the functionality of the “editor” is relatively limited - but people rather roll their own editors instead of contributing.
[/quote]
I don’t like NetBeans like IDE, I don’t like its API, I don’t like to work with SWING, so it were reasons to create my own editor :slight_smile: I hope it will be my help to jME community :slight_smile:

1 Like

Lol, merged box colliders - good one ^^

2 Likes