I will just get straight to the question, 
how can I stop a object from rotating on the X and Z axis but continue to rotate on the Y?
			
			
									
						
										
						Freeze Rotation
Re: Freeze Rotation
You can set the inverse inertia tensor matrix so that certain axes have essentially infinite inertia, preventing rotation around them.  To do what you want specifically:
where each row 1 is X, row 2 is Y, and row 3 is Z.
			
			
									
						
										
						Code: Select all
                    Matrix inertiaTensorInverse = box.localSpaceInertiaTensorInverse;
                    inertiaTensorInverse.M31 = 0;
                    inertiaTensorInverse.M32 = 0;
                    inertiaTensorInverse.M33 = 0;
                    inertiaTensorInverse.M11 = 0;
                    inertiaTensorInverse.M12 = 0;
                    inertiaTensorInverse.M13 = 0;
                    box.localSpaceInertiaTensorInverse = inertiaTensorInverse;- 
				Gam3r GEEk
- Posts: 3
- Joined: Mon Aug 10, 2009 11:03 pm
Re: Freeze Rotation
Thanks that should do it.