Exemplo n.º 1
0
		public void addRigidBody( btRigidBody body, btBroadphaseProxy.CollisionFilterGroups group, btBroadphaseProxy.CollisionFilterGroups mask )
		{
			if( !body.isStaticOrKinematicObject() && 0 == ( body.getFlags() & btRigidBodyFlags.BT_DISABLE_WORLD_GRAVITY ) )
			{
				body.setGravity( ref m_gravity );
			}

			if( body.getCollisionShape() != null )
			{
				if( !body.isStaticObject() )
				{
					m_nonStaticRigidBodies.Add( body );
				}
				else
				{
					body.setActivationState( ActivationState.ISLAND_SLEEPING );
				}
				addCollisionObject( body, group, mask );
			}
		}
Exemplo n.º 2
0
		public virtual void addRigidBody( btRigidBody body, short group, short mask )
		{
			body.setGravity( ref m_gravity );

			if( body.getCollisionShape() )
			{
				addCollisionObject( body, group, mask );
			}
		}
Exemplo n.º 3
0
		public void addRigidBody( btRigidBody body )
		{
			if( !body.isStaticOrKinematicObject() && ( body.getFlags() & btRigidBodyFlags.BT_DISABLE_WORLD_GRAVITY ) == 0 )
			{
				body.setGravity( ref m_gravity );
			}

			if( body.getCollisionShape() != null )
			{
				if( !body.isStaticObject() )
				{
					m_nonStaticRigidBodies.Add( body );
				}
				else
				{
					body.setActivationState( ActivationState.ISLAND_SLEEPING );
				}

				bool isDynamic = !( body.isStaticObject() || body.isKinematicObject() );
				btBroadphaseProxy.CollisionFilterGroups collisionFilterGroup = ( isDynamic ? btBroadphaseProxy.CollisionFilterGroups.DefaultFilter : btBroadphaseProxy.CollisionFilterGroups.StaticFilter );
				btBroadphaseProxy.CollisionFilterGroups collisionFilterMask = ( isDynamic ? btBroadphaseProxy.CollisionFilterGroups.AllFilter : ( btBroadphaseProxy.CollisionFilterGroups.AllFilter ^ btBroadphaseProxy.CollisionFilterGroups.StaticFilter ) );

				addCollisionObject( body, collisionFilterGroup, collisionFilterMask );
			}
		}
Exemplo n.º 4
0
		public virtual void addRigidBody( btRigidBody body )
		{
			body.setGravity(ref  m_gravity );

			if( body.getCollisionShape() )
			{
				addCollisionObject( body );
			}
		}