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 » Fri Feb 15, 2019 2:07 pm

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: 4603
Joined: Tue Jul 04, 2006 4:45 am

Re: v1. Lock movement in Y axis.

Post by Norbo » Fri Feb 15, 2019 10:07 pm

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 » Mon Feb 18, 2019 11:49 am

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: 4603
Joined: Tue Jul 04, 2006 4:45 am

Re: v1. Lock movement in Y axis.

Post by Norbo » Tue Feb 19, 2019 12:47 am

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 » Wed Feb 20, 2019 8:19 am

Thank you again.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests