# Overturned rigidbody mel/expression

**URL:** https://forum.highend3d.com/t/overturned-rigidbody-mel-expression/3862
**Category:** Maya
**Tags:** mel
**Created:** [March 21, 2005, 7:59pm UTC](https://forum.highend3d.com/t/overturned-rigidbody-mel-expression/3862 "2005-03-21T19:59:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mayabitch](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/b5ac83/32.png) [@mayabitch](https://forum.highend3d.com/u/mayabitch)
#### Post date: [March 21, 2005, 7:59pm UTC](https://forum.highend3d.com/t/overturned-rigidbody-mel-expression/3862/1 "2005-03-21T19:59:31Z")

</div>

Good Day

I'm working on a rigidbody rig where I need to know whether or not the body has over turned in the world. Think of a vehicle where I need to know when to turn the driving impulse off. I first thought of an expression that followed the rotations within a range, e.g. between 70 degrees positive and negative in the x and z axis (y up world).

Obviously with maya's Euler rotations and generating the shortest solution I get unusable values where the vehicle is still upright with rotation values outside the range I'm looking for. I understand why this is so, but can't come up with a solution around it.

Beyond getting into matrix math (I suck) are there any other possible solutions?

Thank you

RR

---

<div class="post-metadata">

### Author: ![nr-puckett](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@nr-puckett](https://forum.highend3d.com/u/nr-puckett)
#### Post date: [March 21, 2005, 8:50pm UTC](https://forum.highend3d.com/t/overturned-rigidbody-mel-expression/3862/2 "2005-03-21T20:50:21Z")

</div>

you could use the contact data on the top of the vehicle,, ie  
if(vehicle.contactCount\>0){  
//i turned over

}

---

<div class="post-metadata">

### Author: ![mayabitch](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/b5ac83/32.png) [@mayabitch](https://forum.highend3d.com/u/mayabitch)
#### Post date: [March 21, 2005, 9:23pm UTC](https://forum.highend3d.com/t/overturned-rigidbody-mel-expression/3862/3 "2005-03-21T21:23:06Z")

</div>

I need to kill the impulse before any such collisions would occur.

Thanks  
RR
