-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to change the centre of mass location? #66
Comments
Unfortunatly if i understand it correctly it is not possible to change the center of mass in OIMO. Unfortunatly it seems @saharan does not look frequently into issues anymore, since the engine basically works fine. I use a workaround to achieve those kinda things with multiple rigidbodies and connecting them with welding joints. |
I think you are understanding correctly, I'm not very good with GitHub, you say there's an enhancement, are you able to drop it here or contact me outside of GitHub, it's quite an important thing I want. I read about offsetting the shapes, but if I do that, I also change the location the rotation starts from? I want that to be separate from the centre of mass location. Please help if you can. |
@Snky I think it means the issue label - it was labelled an "enhancement", meaning this is a nice-to-have-in-the-future thing that is not available right now. |
Yeah as @makc said, there is a feature that is in planning but was never done so far. OIMO can do pretty much everything but you have to combine certain techniques to achieve them. I mentioned a workaround, which i found, because i'm using oimo in some projects, that are somewhat realisitic. This workaround resembles reality in some way, since a car is "one" entity in the broader sence, but consists of several others like a front, middle and rear, which by themselves would consist of parts. In general the idea is: |
I will try weld joints, sad that there isn't an easier solution available without creating more bodies, splitting the shapes up.. my shapes are generated based on .obj vertices / faces. Off topic (not sure how else to contact you atm): Using my old way (works): |
Oops, accidentally closed. |
It's unfortunate, but i think OIMO get's no significant updates, java/-typescript 3D physics engines seem to be rare and seldomly updated in general. There is a version of the old cannon-js physics that is updated relatively frequently cannon-es. Cannon in general is a very robust engine, but i personally found OIMO first and had an easier time doing the things i needed, so i stayed with OIMO and actively try to answer questions about it, but i'm not associated with it and do not have contact with the developer. Yeah trigger was the only thing that was relatively simple to implement, OIMO is well not documented enough for someone to take over easily. Unless i have a bug in it, there is nothing to be done than for usage, just setting "_isTrigger" on the body, and it works in the Game Engine where i implemented OIMO My _isTrigger setup is handling collision the normal way until the moment where the manifold is given to the solver, For that i have changes in World.hx, ContactManager.hx, ContactCallback.hx, Contact.hx, RigidBody.hx and ContactConstraint.hx, if you want to take a look at it. |
Actually maybe there isn't a bug with your isTrigger and I'll continue to try it, I just got back into BitFlag for mask/group and I'll see over time the behaviour and which way I prefer. I had one more question, you said to weld two objects together for the mass issue, how would you recommend welding two RigidBody's together, what type of joint/jointconfig? What settings? |
Welding means a joint that has no degrees of freedom, so a generic joint with it's base config should do the trick. |
I'll give that a go, I probably asked because I didn't actually have a GenericJoint class, so I'm not sure where I got the copy of Oim0 from but I've downloaded the class now and will try. |
As the title suggests. It's a 2 in 1 question, I want to separate rotation location from mass location.
If I make a model in blender, let's say a car:
The very front of the car is at 0, 0, 0
The very back of the car is at 0, 0, 100
In terms of rotation, I am happy with this, if I did Rotate(0, 1, 0), the car will spin from 0, 0, 0
In terms of mass, this is horrible, because now the back end of the car is up in the air, and the focus point of the mass is 0, 0, 0 - not the centre of the car, how can I adjust either the mass location, OR:
If I were to make the pivot point of the car in Blender to be the middle of the car, then how do I rotate the car from the very front, and not the centre?
The text was updated successfully, but these errors were encountered: