Search found 96 matches

by tomweiland
Fri Feb 14, 2020 12:16 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Sounds like I have a lot to look into over the next few weeks! 1) Add an AngularAxisMotor with a zero target velocity to resist attempts to rotate it. It'll behave like friction, so only sufficiently large torques will rotate it. A good option if you want to maintain physical consistency, where play...
by tomweiland
Thu Feb 13, 2020 1:45 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Just a bit of a follow-up question: is there anything wrong with storing an instance of a SubgroupCollisionFilter and reusing that for multiple physics bodies? Would you recommend that or not? If I don't reuse filters, couldn't I theoretically have two bodies that belong to the same group and subgro...
by tomweiland
Fri Jan 24, 2020 12:01 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

The collision is being filtered out. SubgroupCollisionFilters are being used in AllowContactGeneration, but the filters are never assigned to anything. The value they happen to have causes the callback to return false. So how can I fix this? Is there a demo I can look at to see what I should be ass...
by tomweiland
Wed Jan 22, 2020 6:37 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

So after some more investigating, I've finally decided to give up and just try and reproduce it. Here's the reproduction in a relatively bare bones console app. I did however notice that if I increase the capstan's mass from 1 to something like 10, the tornadoship makes a reappearance. I'm guessing ...
by tomweiland
Fri Jan 17, 2020 12:09 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Some demos callbacks have collision filtering, some don't. If the callbacks all return only true, you can be sure that it's unrelated. I just checked and I'm using the NarrowPhaseCallbacks from the character demo—the only method that doesn't return true is this one: [MethodImpl(MethodImplOptions.Ag...
by tomweiland
Thu Jan 16, 2020 2:24 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

You would have had to implement some form of collision filtering in the INarrowphaseCallbacks by returning false from the relevant callbacks. There's nothing built in. I guess I should clarify: I haven't done anything custom—I simply copied the NarrowphaseCallbacks from one of the demos (can't reme...
by tomweiland
Thu Jan 16, 2020 12:33 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

First guess would be some kind of collision filter going haywire. I haven't set anything up with collision filtering (besides removing cannonballs from the simulation when they hit another body)—how can I find out if this is the culprit? If it's the demos dynamic character controller, it may be wor...
by tomweiland
Wed Jan 15, 2020 1:42 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

So I've adjusted the weights—each child shape now has a weight of 1, with the inertia still being scaled as before. The spinning has stopped, and the ship still seems to behave as if it had a mass of 500. The capstan is now held in place in the desired position, however , I can simply walk through i...
by tomweiland
Wed Jan 15, 2020 12:49 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Are the child shape weights fairly uniform, so that the inertia tensor is reasonable for the actual size of the boat? I haven't changed the weights, so that could be the issue. Just to clarify, do the weights actually affect the final mass of the compound (if I'm scaling the inertia), or do they on...
by tomweiland
Tue Jan 14, 2020 11:25 pm
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

I just implemented the inertia scaling like you said, with my target mass being 500. Unfortunately, the ship is still spinning... compoundBuilder.BuildDynamicCompound(out Buffer<CompoundChild> _colliderChildren, out BodyInertia _shipInertia); float _inverseInertiaScale = 1f / (500f * _shipInertia.In...
by tomweiland
Tue Jan 14, 2020 9:56 pm
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Norbo wrote:
Tue Jan 14, 2020 9:38 pm
It could also be that the goal position of the capstan is partially embedded in the ship.
I've double checked, and based on the capstan's position and dimensions, it shouldn't be embedded in the ship...it should actually be hovering about 0.1 units above the deck :?
by tomweiland
Tue Jan 14, 2020 9:35 pm
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Provided you want the anchor of the constraint to be at the capstan's center of mass, and assuming the ship is body A, then LocalOffsetA would be <0, 1, 1> and LocalOffsetB would be <0, 0, 0>. Hmm...so that would mean that initially I had it set it up correctly, but that resulted in the ship spinni...
by tomweiland
Tue Jan 14, 2020 4:22 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

The overload that does not output a center performs no recentering and leaves the children in exactly the same relative position as they were added in. That original state generally won't be the 'true' center of mass in terms of the input shapes/weights, but sometimes that's desirable. This is what...
by tomweiland
Tue Jan 14, 2020 12:00 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

If the design origin and center of mass are not exactly the same, this might result in the connected body floating away from the surface it's supposed to be on, or being shunted forward or back, or in the worst case, shoved into the ship's body. Is there a way I can check where the design origin an...
by tomweiland
Mon Jan 13, 2020 2:26 am
Forum: Questions and Help
Topic: Rotating parts of compound body
Replies: 32
Views: 6311

Re: Rotating parts of compound body

Is Vector3.UnitY the correct direction for both connected bodies in their respective local spaces? UnitY is <0,1,0>, but to be honest I'm not sure what the "correct" direction would/should be... Is transform.localPosition correct in context? transform.localPosition is where I want the spinning body...