v1. Lock movement in Y axis.

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
AlexCereus
Posts: 7
Joined: Fri Feb 15, 2019 2:03 pm

v1. Lock movement in Y axis.

Post by AlexCereus »

Hello.

I need to lock movement in Y axis for all objects in space, so they can move only in XZ plane. How can I do it?

Excuse me for my English.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: v1. Lock movement in Y axis.

Post by Norbo »

Something like this would work:
viewtopic.php?t=2539
AlexCereus
Posts: 7
Joined: Fri Feb 15, 2019 2:03 pm

Re: v1. Lock movement in Y axis.

Post by AlexCereus »

Thank you.
The easiest approach is setting two of the rows of the local inverse inertia tensor in every dynamic body to all zeroes.
How can I do it in V2? Which method? I can't find.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: v1. Lock movement in Y axis.

Post by Norbo »

The BodyDescription contains a LocalInertia field. You can set that prior to adding it to the Bodies set.

If you want to access an existing body's local inertia, you could use something like:

Code: Select all

ref var localInertia = ref new BodyReference(bodyHandle, Simulation.Bodies).LocalInertia;
AlexCereus
Posts: 7
Joined: Fri Feb 15, 2019 2:03 pm

Re: v1. Lock movement in Y axis.

Post by AlexCereus »

Thank you again.
Post Reply