コード例 #1
0
ファイル: OptimizedBvh.cs プロジェクト: Belxjander/Asuna
		public void Build(StridingMeshInterface triangles)
		{
			NodeTriangleCallback callback = new NodeTriangleCallback(_leafNodes);

			Vector3 aabbMin = new Vector3(-1e30f, -1e30f, -1e30f);
			Vector3 aabbMax = new Vector3(1e30f, 1e30f, 1e30f);

			triangles.InternalProcessAllTriangles(callback, aabbMin, aabbMax);

			//now we have an array of leafnodes in m_leafNodes
			_contiguousNodes = new OptimizedBvhNode[2 * _leafNodes.Count];
            for (int i = 0; i < _contiguousNodes.Length; i++)
                _contiguousNodes[i] = new OptimizedBvhNode();
			_curNodeIndex = 0;

			_rootNode = BuildTree(_leafNodes, 0, _leafNodes.Count);
		}
コード例 #2
0
ファイル: OptimizedBvh.cs プロジェクト: palestar/medusa
        public void Build(StridingMeshInterface triangles)
        {
            NodeTriangleCallback callback = new NodeTriangleCallback(_leafNodes);

            Vector3 aabbMin = new Vector3(-1e30f, -1e30f, -1e30f);
            Vector3 aabbMax = new Vector3(1e30f, 1e30f, 1e30f);

            triangles.InternalProcessAllTriangles(callback, aabbMin, aabbMax);

            //now we have an array of leafnodes in m_leafNodes
            _contiguousNodes = new OptimizedBvhNode[2 * _leafNodes.Count];
            for (int i = 0; i < _contiguousNodes.Length; i++)
            {
                _contiguousNodes[i] = new OptimizedBvhNode();
            }
            _curNodeIndex = 0;

            _rootNode = BuildTree(_leafNodes, 0, _leafNodes.Count);
        }
コード例 #3
0
ファイル: TriangleMeshShape.cs プロジェクト: palestar/medusa
 public TriangleMeshShape(StridingMeshInterface meshInterface)
 {
     this._meshInterface = meshInterface;
     RecalcLocalAabb();
 }
コード例 #4
0
 public ConvexTriangleMeshShape(StridingMeshInterface meshInterface)
 {
     _stridingMesh = meshInterface;
 }
コード例 #5
0
 public TriangleMeshShape(StridingMeshInterface meshInterface)
 {
     this._meshInterface = meshInterface;
     RecalcLocalAabb();
 }
コード例 #6
0
 public BvhTriangleMeshShape(StridingMeshInterface meshInterface) : base(meshInterface)
 {
     _bvh.Build(meshInterface);
 }
コード例 #7
0
 public MyNodeOverlapCallback(ITriangleCallback callback, StridingMeshInterface meshInterface)
 {
     _meshInterface = meshInterface;
     _callback = callback;
 }
コード例 #8
0
		public ConvexTriangleMeshShape(StridingMeshInterface meshInterface)
		{
			_stridingMesh = meshInterface;
		}
コード例 #9
0
 public BvhTriangleMeshShape(StridingMeshInterface meshInterface) : base(meshInterface)
 {
     _bvh.Build(meshInterface);
 }
コード例 #10
0
 public MyNodeOverlapCallback(ITriangleCallback callback, StridingMeshInterface meshInterface)
 {
     _meshInterface = meshInterface;
     _callback      = callback;
 }