Exemplo n.º 1
0
        public BroadphaseProxy createProxy(ref btVector3 aabbMin,ref btVector3 aabbMax,
            BroadphaseNativeTypes shapeType, object userPtr,
            short collisionFilterGroup, short collisionFilterMask, IDispatcher dispatcher,
            object multiSapProxy)
        {

            DbvtProxy proxy = new DbvtProxy(aabbMin, aabbMax, userPtr,
                collisionFilterGroup,
                collisionFilterMask);

            DbvtAabbMm aabb;// = DbvtAabbMm.FromMM(aabbMin, aabbMax);
            DbvtAabbMm.FromMM(ref aabbMin, ref aabbMax, out aabb);

            //bproxy->aabb			=	btDbvtVolume::FromMM(aabbMin,aabbMax);
            proxy.stage = m_stageCurrent;
            proxy.m_uniqueId = ++m_gid;
            proxy.leaf = m_sets[0].insert(ref aabb, proxy);
            listappend(ref proxy, ref m_stageRoots[m_stageCurrent]);
            if (!m_deferedcollide)
            {
                DbvtTreeCollider collider = new DbvtTreeCollider(this);
                collider.proxy = proxy;
                m_sets[0].collideTV(m_sets[0].m_root, ref aabb, collider);
                m_sets[1].collideTV(m_sets[1].m_root,ref aabb, collider);
            }
            return (proxy);
        }
Exemplo n.º 2
0
        private void SetDbvtNodeInfo(DbvtNode dbvtNode, TreeNode parentNode)
        {
            if (dbvtNode == null)
            {
                return;
            }

            string   text         = dbvtNode.GetType().Name;
            TreeNode dbvtNodeNode = GetOrCreateChildNode(dbvtNode, text, parentNode);

            RemoveObjectsOfType <DbvtProxy>(dbvtNodeNode);

            if (dbvtNode.IsLeaf)
            {
                DbvtProxy proxy       = dbvtNode.Data;
                string    description = GetProxyDescription(proxy);
                GetOrCreateChildNode(proxy, description, dbvtNodeNode);
            }
            else
            {
                foreach (DbvtNode child in dbvtNode.Childs)
                {
                    SetDbvtNodeInfo(child, dbvtNodeNode);
                }
            }

            RemoveMissingObjects(dbvtNode.Childs, dbvtNodeNode);
        }
Exemplo n.º 3
0
        public override void Process(Dbvt.Node na, Dbvt.Node nb)
        {
            DbvtProxy pa = na.data;
            DbvtProxy pb = nb.data;

            if (pa.getUid() > pb.getUid())
            {
                DbvtProxy tmp = pa;
                pa = pb;
                pb = tmp;
            }
            pbp.paircache.addOverlappingPair(pa, pb);
        }
Exemplo n.º 4
0
        private void SetDbvtNodeInfo(DbvtNode dbvtNode, TreeNode parentNode)
        {
            if (dbvtNode == null)
            {
                return;
            }

            string   text         = dbvtNode.GetType().Name;
            TreeNode dbvtNodeNode = GetOrCreateChildNode(dbvtNode, text, parentNode);

            RemoveObjectsOfType <DbvtProxy>(dbvtNodeNode);
            DbvtProxy proxy = dbvtNode.Data;

            GetOrCreateChildNode(proxy, "DbvtProxy" + " " + proxy.ClientObject, dbvtNodeNode);

            foreach (DbvtNode child in dbvtNode.Childs)
            {
                SetDbvtNodeInfo(child, dbvtNodeNode);
            }
            RemoveMissingObjects(dbvtNode.Childs, dbvtNodeNode);
        }
Exemplo n.º 5
0
 static void listappend(ref DbvtProxy item, ref DbvtProxy list)
 {
     item.links[0] = null;
     item.links[1] = list;
     if (list != null) list.links[0] = item;
     list = item;
 }
Exemplo n.º 6
0
 static void listremove(DbvtProxy item, DbvtProxy list)
 {
     if (item.links[0] != null) item.links[0].links[1] = item.links[1]; else list = item.links[1];
     if (item.links[1] != null) item.links[1].links[0] = item.links[0];
 }
Exemplo n.º 7
0
 private static string GetProxyDescription(DbvtProxy proxy)
 {
     return("DbvtProxy" + " " + GetClientObjectDescription(proxy.ClientObject));
 }