• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ObjectArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ObjectArray的典型用法代码示例。如果您正苦于以下问题:C# ObjectArray类的具体用法?C# ObjectArray怎么用?C# ObjectArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectArray类属于命名空间,在下文中一共展示了ObjectArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DiscreteDynamicsWorld

		///this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those
		public DiscreteDynamicsWorld(IDispatcher dispatcher, IBroadphaseInterface pairCache, IConstraintSolver constraintSolver, ICollisionConfiguration collisionConfiguration)
			: base(dispatcher, pairCache, collisionConfiguration)
		{
			m_ownsIslandManager = true;
			m_constraints = new ObjectArray<TypedConstraint>();
			m_actions = new List<IActionInterface>();
			m_nonStaticRigidBodies = new ObjectArray<RigidBody>();
			m_islandManager = new SimulationIslandManager();
			m_constraintSolver = constraintSolver;

			Gravity = new Vector3(0, -10, 0);
			m_localTime = 1f / 60f;
			m_profileTimings = 0;
			m_synchronizeAllMotionStates = false;

			if (m_constraintSolver == null)
			{
				m_constraintSolver = new SequentialImpulseConstraintSolver();
				m_ownsConstraintSolver = true;
			}
			else
			{
				m_ownsConstraintSolver = false;
			}
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:26,代码来源:DiscreteDynamicsWorld.cs


示例2: LengthTest

        public void LengthTest()
        {
            const int length = 3;
            var stringArray = new ObjectArray<String>(length);

            Assert.AreEqual(length, stringArray.Length);
        }
开发者ID:bcrusu,项目名称:jvm4csharp,代码行数:7,代码来源:ObjectArrayTests.cs


示例3: MergePoints

        //! classify points that are closer
        public void MergePoints(ref Vector4 plane, float margin, ObjectArray<IndexedVector3> points, int point_count)
        {
            m_point_count = 0;
            m_penetration_depth = -1000.0f;

            int[] point_indices = new int[MAX_TRI_CLIPPING];

            int _k;

            for (_k = 0; _k < point_count; _k++)
            {
                float _dist = -ClipPolygon.DistancePointPlane(ref plane, ref points.GetRawArray()[_k]) + margin;

                if (_dist >= 0.0f)
                {
                    if (_dist > m_penetration_depth)
                    {
                        m_penetration_depth = _dist;
                        point_indices[0] = _k;
                        m_point_count = 1;
                    }
                    else if ((_dist + MathUtil.SIMD_EPSILON) >= m_penetration_depth)
                    {
                        point_indices[m_point_count] = _k;
                        m_point_count++;
                    }
                }
            }

            for (_k = 0; _k < m_point_count; _k++)
            {
                m_points[_k] = points[point_indices[_k]];
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:35,代码来源:TriangleShapeEx.cs


示例4: InternalProcessTriangleIndex

		public virtual void InternalProcessTriangleIndex(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			Vector3 t1 = triangle[0];
			Vector3 t2 = triangle[1];
			Vector3 t3 = triangle[2];

			OptimizedBvhNode node = new OptimizedBvhNode();
			Vector3	aabbMin = MathUtil.MAX_VECTOR;
			Vector3 aabbMax = MathUtil.MIN_VECTOR;
			MathUtil.VectorMax(ref t1,ref aabbMax);
			MathUtil.VectorMin(ref t1,ref aabbMin);
			MathUtil.VectorMax(ref t2,ref aabbMax);
			MathUtil.VectorMin(ref t2,ref aabbMin);
			MathUtil.VectorMax(ref t3,ref aabbMax);
			MathUtil.VectorMin(ref t3,ref aabbMin);

			//with quantization?
			node.m_aabbMinOrg = aabbMin;
			node.m_aabbMaxOrg = aabbMax;

			node.m_escapeIndex = -1;
	
			//for child nodes
			node.m_subPart = partId;
			node.m_triangleIndex = triangleIndex;
			m_triangleNodes.Add(node);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:27,代码来源:NodeTriangleCallback.cs


示例5: TriangleIndexVertexArray

        //just to be backwards compatible
	    public TriangleIndexVertexArray(int numTriangles,ObjectArray<int> triangleIndexBase,int triangleIndexStride,int numVertices,Object vertexBase,int vertexStride)
        {
            // ignore the provided stride values as we infer them from the version of the ctor called...
            IndexedMesh indexedMesh = new IndexedMesh();
            indexedMesh.m_numTriangles = numTriangles;
            indexedMesh.m_triangleIndexBase = triangleIndexBase;
	        indexedMesh.m_triangleIndexStride = 3;
	        indexedMesh.m_numVertices = numVertices;
	        indexedMesh.m_vertexBase = vertexBase;

            if (vertexBase is ObjectArray<IndexedVector3>)
            {
                indexedMesh.m_vertexStride = 1;
            }
#if XNA
            else if (vertexBase is ObjectArray<Microsoft.Xna.Framework.Vector3>)
            {
                indexedMesh.m_vertexStride = 1;
            }
#endif
            else if (vertexBase is ObjectArray<float>)
            {
                indexedMesh.m_vertexStride = 3;
            }
            else
            {
                Debug.Assert(false,"Unsupported vertex object base.");
            }

	        AddIndexedMesh(indexedMesh,PHY_ScalarType.PHY_INTEGER);
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:32,代码来源:TriangleIndexVertexArray.cs


示例6: SimulationIslandManager

 	public SimulationIslandManager()
     {
         m_splitIslands = true;
         m_unionFind = new UnionFind();
         m_islandmanifold = new ObjectArray<PersistentManifold>();
         m_islandBodies = new ObjectArray<CollisionObject>();
     }
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:7,代码来源:SimulationIslandManager.cs


示例7: InternalProcessTriangleIndex

		public virtual void InternalProcessTriangleIndex(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			Matrix i = new Matrix();
			Vector3 a = triangle[0] - m_center;
			Vector3 b = triangle[1] - m_center;
			Vector3 c = triangle[2] - m_center;
			float volNeg = -System.Math.Abs(MathUtil.Vector3Triple(ref a,ref b,ref c) * (1f / 6f));
			for (int j = 0; j < 3; j++)
			{
				for (int k = 0; k <= j; k++)
				{
					float aj = MathUtil.VectorComponent(ref a,j);
					float ak = MathUtil.VectorComponent(ref a,k);
					float bj = MathUtil.VectorComponent(ref b,j);
					float bk = MathUtil.VectorComponent(ref b,k);
					float cj = MathUtil.VectorComponent(ref c,j);
					float ck = MathUtil.VectorComponent(ref c,k);

					float temp = volNeg * (.1f * (aj * ak + bj * bk + cj * ck)
					                       + .05f * (aj * bk + ak * bj + aj * ck + ak * cj + bj * ck + bk * cj));

					MathUtil.MatrixComponent(ref i,j,k,temp);
					MathUtil.MatrixComponent(ref i,k,j,temp);
				}
			}
			float i00 = -i.M11;
			float i11 = -i.M22;
			float i22 = -i.M33;
			i.M11 = i11 + i22; 
			i.M22 = i22 + i00; 
			i.M33 = i00 + i11;
			m_sum.Right += i.Right;
			m_sum.Up += i.Up;
			m_sum.Backward += i.Backward;
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:35,代码来源:InertiaCallback.cs


示例8: ProcessAllTriangles

        public override void ProcessAllTriangles(ITriangleCallback callback, ref Vector3 aabbMin, ref Vector3 aabbMax)
        {
	        Vector3 halfExtents = (aabbMax - aabbMin) * .5f;
	        float radius = halfExtents.Length();
	        Vector3 center = (aabbMax + aabbMin) * 0.5f;
        	
	        //this is where the triangles are generated, given AABB and plane equation (normal/constant)

	        Vector3 tangentDir0 = Vector3.Zero;
            Vector3 tangentDir1 = Vector3.Zero;

	        //tangentDir0/tangentDir1 can be precalculated
	        TransformUtil.PlaneSpace1(ref m_planeNormal,ref tangentDir0,ref tangentDir1);

            Vector3 supVertex0 = Vector3.Zero;
            Vector3 supVertex1 = Vector3.Zero;

	        Vector3 projectedCenter = center - (Vector3.Dot(m_planeNormal,center) - m_planeConstant)*m_planeNormal;

            ObjectArray<Vector3> triangle = new ObjectArray<Vector3>(3);
	        triangle.Add(projectedCenter + tangentDir0*radius + tangentDir1*radius);
            triangle.Add(projectedCenter + tangentDir0 * radius - tangentDir1 * radius);
            triangle.Add(projectedCenter - tangentDir0 * radius - tangentDir1 * radius);

	        callback.ProcessTriangle(triangle,0,0);

	        triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius;
	        triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius;
	        triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius;

	        callback.ProcessTriangle(triangle,0,1);

        }
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:33,代码来源:StaticPlaneShape.cs


示例9: CollisionWorld

 //this constructor doesn't own the dispatcher and paircache/broadphase
 public CollisionWorld(IDispatcher dispatcher, IBroadphaseInterface broadphasePairCache, ICollisionConfiguration collisionConfiguration)
 {
     m_dispatcher1 = dispatcher;
     m_broadphasePairCache = broadphasePairCache;
     m_collisionObjects = new ObjectArray<CollisionObject>();
     m_dispatchInfo = new DispatcherInfo();
     m_forceUpdateAllAabbs = true;
 }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:9,代码来源:CollisionWorld.cs


示例10: SortedOverlappingPairCache

		public SortedOverlappingPairCache()
		{
			m_blockedForChanges = false;
			m_hasDeferredRemoval = true;
			m_overlapFilterCallback = null;
			m_ghostPairCallback = null;
			m_overlappingPairArray = new ObjectArray<BroadphasePair>(2);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:8,代码来源:SortedOverlappingPairCache.cs


示例11: InternalProcessTriangleIndex

		public virtual void InternalProcessTriangleIndex(ObjectArray<Vector3> triangle,int partId,int triangleIndex)
		{
			if (AabbUtil2.TestTriangleAgainstAabb2(triangle,ref m_aabbMin,ref m_aabbMax))
			{
				//check aabb in triangle-space, before doing this
				m_callback.ProcessTriangle(triangle,partId,triangleIndex);
			}
			
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:9,代码来源:FilteredCallback.cs


示例12: HashedOverlappingPairCache

 public HashedOverlappingPairCache()
 {
     m_overlapFilterCallback = null;
     m_blockedForChanges = false;
     m_ghostPairCallback = null;
     int initialAllocatedSize = 2;
     m_overlappingPairArray = new ObjectArray<BroadphasePair>(initialAllocatedSize);
     GrowTables();
 }
开发者ID:Belxjander,项目名称:Asuna,代码行数:9,代码来源:OverlappingPairCache.cs


示例13: Method_asList

        public void Method_asList()
        {
            var stringArray = new ObjectArray<String>(3);
            stringArray[0] = "string 1";
            stringArray[1] = "string 2";
            stringArray[2] = "string 3";

            List<String> list = jvm4csharp.java.util.Arrays.asList(stringArray);
            AssertEx.IsValidJavaObject(list);
        }
开发者ID:bcrusu,项目名称:jvm4csharp,代码行数:10,代码来源:ArraysTests.cs


示例14: ProcessTriangle

		public virtual void ProcessTriangle(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			//aabb filter is already applied!	
			CollisionAlgorithmConstructionInfo ci = new CollisionAlgorithmConstructionInfo();
			ci.SetDispatcher(m_dispatcher);

			CollisionObject ob = (CollisionObject)m_triBody;
        	
			///debug drawing of the overlapping triangles
			///

			if (m_dispatchInfoPtr != null && m_dispatchInfoPtr.getDebugDraw() != null&& ((m_dispatchInfoPtr.getDebugDraw().GetDebugMode() & DebugDrawModes.DBG_DrawWireframe) > 0))
			{
				Vector3 color = new Vector3(1,1,0);
				Matrix tr = ob.GetWorldTransform();
				Vector3[] transformedTriangles = new Vector3[3];
				for(int i=0;i<transformedTriangles.Length;++i)
				{
					transformedTriangles[i] = Vector3.Transform(triangle[i],tr);
				}
				m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[0], ref transformedTriangles[1], ref color);
				m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[1], ref transformedTriangles[2], ref color);
				m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[2], ref transformedTriangles[0], ref color);

			}

			if (m_convexBody.GetCollisionShape().IsConvex())
			{
				TriangleShape tm = new TriangleShape(triangle[0],triangle[1],triangle[2]);	
				tm.Margin = m_collisionMarginTriangle;
        		
				CollisionShape tmpShape = ob.GetCollisionShape();
				ob.InternalSetTemporaryCollisionShape(tm);
        		
				CollisionAlgorithm colAlgo = ci.GetDispatcher().FindAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
				///this should use the btDispatcher, so the actual registered algorithm is used
				//		btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody);

				if (m_resultOut.GetBody0Internal() == m_triBody)
				{
					m_resultOut.SetShapeIdentifiersA(partId, triangleIndex);
				}
				else
				{
					m_resultOut.SetShapeIdentifiersB(partId, triangleIndex);
				}

				colAlgo.ProcessCollision(m_convexBody,m_triBody,m_dispatchInfoPtr, m_resultOut);
				colAlgo.Cleanup();
				ci.GetDispatcher().FreeCollisionAlgorithm(colAlgo);
				colAlgo = null;

				ob.InternalSetTemporaryCollisionShape( tmpShape);
			}
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:55,代码来源:ConvexTriangleCallback.cs


示例15: TriangleIndexVertexArray

        //just to be backwards compatible
	    public TriangleIndexVertexArray(int numTriangles,ObjectArray<int> triangleIndexBase,int triangleIndexStride,int numVertices,ObjectArray<Vector3> vertexBase,int vertexStride)
        {
            IndexedMesh indexedMesh = new IndexedMesh();
            indexedMesh.m_numTriangles = numTriangles;
            indexedMesh.m_triangleIndexBase = triangleIndexBase;
	        indexedMesh.m_triangleIndexStride = triangleIndexStride;
	        indexedMesh.m_numVertices = numVertices;
	        indexedMesh.m_vertexBase = vertexBase;
	        indexedMesh.m_vertexStride = vertexStride;

	        AddIndexedMesh(indexedMesh,PHY_ScalarType.PHY_INTEGER);
        }
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:13,代码来源:TriangleIndexVertexArray.cs


示例16: SequentialImpulseConstraintSolver

		public SequentialImpulseConstraintSolver()
		{

			//FIXME RHS SEEMS TO BE OUT

			m_tmpSolverContactConstraintPool = new ObjectArray<SolverConstraint>();
			m_tmpSolverNonContactConstraintPool = new ObjectArray<SolverConstraint>();
			m_tmpSolverContactFrictionConstraintPool = new ObjectArray<SolverConstraint>();
			m_tmpConstraintSizesPool = new ObjectArray<ConstraintInfo1>();
			m_orderTmpConstraintPool = new ObjectArray<int>();
			m_orderFrictionConstraintPool = new ObjectArray<int>();
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:12,代码来源:SequentialImpulseConstraintSolver.cs


示例17: InternalProcessTriangleIndex

		public virtual void InternalProcessTriangleIndex(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			Vector3 t1 = triangle[0];
			Vector3 t2 = triangle[1];
			Vector3 t3 = triangle[2];

			MathUtil.VectorMin(ref t1,ref m_aabbMin);
			MathUtil.VectorMax(ref t1,ref m_aabbMax);
			MathUtil.VectorMin(ref t2,ref m_aabbMin);
			MathUtil.VectorMax(ref t2,ref m_aabbMax);
			MathUtil.VectorMin(ref t3,ref m_aabbMin);
			MathUtil.VectorMax(ref t3,ref m_aabbMax);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:13,代码来源:AabbCalculationCallback.cs


示例18: ProcessTriangle

		public virtual void ProcessTriangle(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			//(void)partId;
			//(void)triangleIndex;

			Vector3 wv0, wv1, wv2;
			wv0 = Vector3.Transform(triangle[0], m_worldTrans);
			wv1 = Vector3.Transform(triangle[1], m_worldTrans);
			wv2 = Vector3.Transform(triangle[2], m_worldTrans);

			m_debugDrawer.DrawLine(ref wv0, ref wv1, ref m_color);
			m_debugDrawer.DrawLine(ref wv1, ref wv2, ref m_color);
			m_debugDrawer.DrawLine(ref wv2, ref wv0, ref m_color);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:14,代码来源:DebugDrawcallback.cs


示例19: ProcessTriangle

		public virtual void ProcessTriangle(ObjectArray<Vector3> triangle,int partId, int triangleIndex)
		{
			Vector3[] rawData = triangle.GetRawArray();
			for (int i=0;i<3;i++)
			{
				float dot;
				Vector3.Dot(ref m_supportVecLocal,ref rawData[i],out dot);
				if (dot > m_maxDot)
				{
					m_maxDot = dot;
					m_supportVertexLocal = triangle[i];
				}
			}
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:14,代码来源:SupportVertexCallback.cs


示例20: InternalProcessTriangleIndex

		public virtual void InternalProcessTriangleIndex(ObjectArray<Vector3> triangle, int partId, int triangleIndex)
		{
			// The partId and triangle index must fit in the same (positive) integer
			Debug.Assert(partId < (1<<MAX_NUM_PARTS_IN_BITS));
			Debug.Assert(triangleIndex < (1 << (31 - MAX_NUM_PARTS_IN_BITS)));
			//negative indices are reserved for escapeIndex
			Debug.Assert(triangleIndex >= 0);

			QuantizedBvhNode node = new QuantizedBvhNode();
			Vector3	aabbMin,aabbMax;
			aabbMin = MathUtil.MAX_VECTOR;
			aabbMax = MathUtil.MIN_VECTOR;

			Vector3 t1 = triangle[0];
			Vector3 t2 = triangle[1];
			Vector3 t3 = triangle[2];

			MathUtil.VectorMin(ref t1, ref aabbMin);
			MathUtil.VectorMax(ref t1, ref aabbMax);
			MathUtil.VectorMin(ref t2, ref aabbMin);
			MathUtil.VectorMax(ref t2, ref aabbMax);
			MathUtil.VectorMin(ref t3, ref aabbMin);
			MathUtil.VectorMax(ref t3, ref aabbMax);
		
			//PCK: add these checks for zero dimensions of aabb
			float MIN_AABB_DIMENSION = 0.002f;
			float MIN_AABB_HALF_DIMENSION = 0.001f;
			if (aabbMax.X - aabbMin.X < MIN_AABB_DIMENSION)
			{
				aabbMax.X = (aabbMax.X + MIN_AABB_HALF_DIMENSION);
				aabbMin.X = (aabbMin.X - MIN_AABB_HALF_DIMENSION);
			}
			if (aabbMax.Y - aabbMin.Y < MIN_AABB_DIMENSION)
			{
				aabbMax.Y = (aabbMax.Y + MIN_AABB_HALF_DIMENSION);
				aabbMin.Y = (aabbMin.Y - MIN_AABB_HALF_DIMENSION);
			}
			if (aabbMax.Z - aabbMin.Z < MIN_AABB_DIMENSION)
			{
				aabbMax.Z = (aabbMax.Z + MIN_AABB_HALF_DIMENSION);
				aabbMin.Z = (aabbMin.Z - MIN_AABB_HALF_DIMENSION);
			}

			m_optimizedTree.Quantize(ref node.m_quantizedAabbMin,ref aabbMin,false);
			m_optimizedTree.Quantize(ref node.m_quantizedAabbMax,ref aabbMax,true);

			node.m_escapeIndexOrTriangleIndex = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | triangleIndex;

			m_triangleNodes.Add(node);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:50,代码来源:QuantizedNodeTriangleCallback.cs



注:本文中的ObjectArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ObjectCache类代码示例发布时间:2022-05-24
下一篇:
C# ObjectAceFlags类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap