Page 1 of 1
How to know if a cylinder is lying or if it is right
Posted: Wed Jun 02, 2010 9:46 pm
by jbosch
Hi,
I need to know if some cyilnders are lying or they are right, any idea how to get this information from BEPU?
Thanks
Re: How to know if a cylinder is lying or if it is right
Posted: Wed Jun 02, 2010 9:54 pm
by Norbo
One way would be to check the entity's orientation matrix's up vector. If the dot product between its vector and Vector3.Up vector (which is equivalent to just the Y component of the matrix's up vector) is close to 1, then it's upright. If it's close to zero, then it's laying down. If it's close to -1, then it's upside down

Re: How to know if a cylinder is lying or if it is right
Posted: Thu Jun 03, 2010 8:22 am
by jbosch
obvious

thanks!