Пример #1
0
		public bool Equals( btCompoundShapeChild c2 )
		{
			return ( m_transform.Equals( ref c2.m_transform ) &&
				m_childShape == c2.m_childShape &&
				m_childShapeType == c2.m_childShapeType &&
				m_childMargin == c2.m_childMargin );
		}
Пример #2
0
		public void addChildShape( ref btTransform localTransform, btCollisionShape shape )
		{
			m_updateRevision++;
			//m_childTransforms.Add(localTransform);
			//m_childShapes.Add(shape);
			btCompoundShapeChild child = new btCompoundShapeChild();
			child.m_node = null;
			child.m_transform = localTransform;
			child.m_childShape = shape;
			child.m_childShapeType = shape.getShapeType();
			child.m_childMargin = shape.getMargin();


			//extend the local aabbMin/aabbMax
			btVector3 localAabbMin, localAabbMax;
			shape.getAabb( ref localTransform, out localAabbMin, out localAabbMax );
			for( int i = 0; i < 3; i++ )
			{
				if( m_localAabbMin[i] > localAabbMin[i] )
				{
					m_localAabbMin[i] = localAabbMin[i];
				}
				if( m_localAabbMax[i] < localAabbMax[i] )
				{
					m_localAabbMax[i] = localAabbMax[i];
				}

			}
			if( m_dynamicAabbTree != null )
			{
				btDbvt.btDbvtVolume bounds = btDbvt.btDbvtVolume.FromMM( ref localAabbMin, ref localAabbMax );
				int index = m_children.Count;
				child.m_node = m_dynamicAabbTree.insert( ref bounds, index );
			}

			m_children.Add( child );

		}