Phate666s Fate



Edit: And no, this doesn’t make it impossible, you can scale the collision shape.

Wait, he answers yes →

Is there a reason there is no RigidBodyControl.setPhysicsScale() ? → Yes,

makes sense for me. I dont know why you get the idea that you should scale a uncloned collision shape ^^, he just mentiond that its possible.

Yh how is his answer wrong?

He told u how to change the scale of a rigidbody by changing the scale of the collisionshape, which is correct. Of course it does not work for mesh shapes anyways.

He didn’t say anything about cloning. If you want to clone, and they aren’t implicitly cloned, then just explicitly clone the collision shape then change the scale (as I said, doesn’t work for mesh shapes)

Yh if u try and use the scale method on a mesh shape it won’t work. I can’t look at createMeshShape (on my phone).

Ah right, hmmz

Scaling for mesh accurate collision shapes doesn’t work. Just try it if u don’t believe me. CreateMesh shape as I assume will use the current transform for the geometry and creates a collision shape from that. It doesn’t scale anything.

That a cyclinder, a simple collision shape. Try a mesh accurate tree or something

@phate666 said:
Your answer is completly wrong.

I don't think so, look here:

@phate666 said:
Is there a reason there is no RigidBodyControl.setPhysicsScale() ?

Yes, you scale the collision shape.

@phate666 said:
This makes it impossible to re-use Collisionshapes when the cloned models need a different scaling.

No, this doesn’t make it impossible, you can scale the collision shape.

@phate666 said:
The collsiionshapes dont get cloned when you clone an RigidBodyControl => cant set individual scale.

Correct, so you have to create new ones. This sharing is also a part of the "Yes" in the answer you deemed "completely wrong".
1 Like
@phate666 said:
The important part is re-using collisionshapes (to save memory and contruction time).
And that is not possible when they need to be scaled.

Exactly, thats why the scaling is left where it is in bullet by default, in the collision shape. So, yes.
@phate666 said:
No its not, geom.getControl(RigidBodyControl.class).getCollisionShape().getClass().getName() == "com.jme3.bullet.collision.shapes.MeshCollisionShape".
Maybe you should try the code before talking about things you clearly have no idea about.

Oh rly?

Check number 2, I already investigated it

And I told u already I'm on my phone, so how can I possibly test it. You tried your tree yet?
@phate666 said:
So, you left scaling like in bullet to make programs inefficient? Or what else is the reason?

Inefficient would be to always copy the collision shape just to be able to set its scale conveniently with the geometry scale.
@phate666 said:
But that is the only solution, or what do you suggest?
The only thing that works is addControl(new RigidBodyControl(0)) on every cloned Node.
That is not only slow, because the same collisionshape has to be calculated many times, but also memory consuming.

Yeah, thats why that doesn't happen by default.
@phate666 said:
Then we are back to my original question.
If there was a method setPhysicsScale which would work like setPhysicsLocation or setPhysicsRotation by manipulating some matrix in bullet I could reuse the same CollisionShape for every cloned tree.

If there was then it would logically also have to be used to scale the shape in conjunction with the geometry which would have the mentioned effects. In jME the scale isn't assigned to the mesh, in bullet it is. You can decide what you want to do and just set the world scale of your object to the collision shape every frame if you need that in your use case but theres no good way to handle this by default. You know how to solve your problem, whats the issue now?
@phate666 said:
The issue is that I have to create a new RigidBodyControl (and with that a new CollisionShape) for every cloned tree.
For a great number of trees this takes a very long time and consumes much memory.

With this hypothetical setPhysicsScale I would only have 1 CollisionShape for all cloned trees, just like i only have 1 mesh for all cloned trees.

a) Thats just because you're too lazy to read how to create a new collision shape for each object instead of using the RigidBody constructor.
b) As I explained multiple times, the scale property is on the collision shape in bullet. Go complain on their forums please and let them educate you about why thats necessary.
@phate666 said:
Yeah, I should have known that talking to you would be a waste of time. Thanks for nothing....

Ditto. You don't seem to understand that just adding that method to the rigidbody wouldn't alleviate your problem.
@phate666 said:
And you obviously dont know that bullet supports scaled mesh collision shapes.

Thats why the collision shape object has a setScale method as I try to tell you all the time but you only want to hear "I hate you phate666, you are so important for my life that I will just put obstacles in your way until you break down and cry".

you dont get it. Bullet and JME have different Concepts in how they do scaling. (scenetree scaling vs object scaling)

, you are just an asshole to everybody trying to help and go like bahbah not my singly clicke maaammmiiii …

You know what, do it alone, i wont even try to help you anymore, waste of time.

1 Like

Ok, chill out a bit guys :stuck_out_tongue: It’s a small thing to be throwing so much hate around for. No-one is coming out of it looking particularly good. :wink:

As I understand it the actual request being made is “can I use the same collision object with different scales for multiple scene objects?” It’s a reasonable request and actually makes sense in terms of saving resources, etc.

The answer seems to be “no, that’s not possible”.

The follow on question then becomes “is there any way to achieve this or something similar”.

It does seem a bit unfortunate that for what is essentially the same shape its impossible to share it just because the scale is different…when presumably rotation and location are not restricted in that way.

@phate666 said:
Are you unable to understand that problem, or are you just not trying to?

I asked you what your problem was, you don't seem to be able to put it in words. You can scale the collision shape but you have to copy it for that as also in bullet setScale is a method of the collision shape/mesh. If you want a different scale I suppose you can use the mesh shape in a compound shape and then scale that. It doesn't make sense to add setScale to the RigidBodyControl, its well placed in the CollisionShape.
@phate666 said:
@zarch has understand the problem, you obviously not.

Sure, I wrote the whole bullet wrapper without having the faintest idea of bullet or the code I wrote. Thats how I do everything. Your conclusion is wrong, if a scaled mesh can yield a collision shape that just means I derive the correct scale at creation.