当前位置: 首页>>代码示例>>C#>>正文


C# Vector3D类代码示例

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


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

示例1: DebugDraw

        public override void DebugDraw(ref Vector3D translation, ref Color materialColor)
        {
            Shape.DebugDraw(ref translation, materialColor);
            VRageRender.MyRenderProxy.DebugDrawText3D(Shape.Center() + translation, "layered", Color.White, 1f, false);

            m_oreDeposits.DebugDraw(ref translation, ref materialColor);
        }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:7,代码来源:MyCompositeShapeOreDeposit.cs

示例2: Orientation3D

        /// <summary>
        /// Instantiates a new Orientation object.
        /// </summary>
        public Orientation3D()
        {
            forwardVector = new Vector3D(1, 0, 0);
            downVector = new Vector3D(0, 0, 1);

            angleMeasurement = AngleMeasurement.Degrees;
        }
开发者ID:kevincwq,项目名称:UAV,代码行数:10,代码来源:Orientation3D.cs

示例3: ProcessNormalsPerVertex

 protected void ProcessNormalsPerVertex(PointerToVertex[] pointersToVertex, int verticesCount)
 {
     Vector3D[] normalsPerVertex = new Vector3D[verticesCount];
     for (int i = 0; i < this.triangles.Length; i++) {
         normalsPerVertex[pointersToVertex[i].Vertex1 - 1] += this.triangles[i].Normal;
         normalsPerVertex[pointersToVertex[i].Vertex2 - 1] += this.triangles[i].Normal;
         normalsPerVertex[pointersToVertex[i].Vertex3 - 1] += this.triangles[i].Normal;
         int percent = (int) (i * 100 / this.triangles.Length);
         if ((percent % 5) == 0) {
             this.OnElementLoaded((int) ((i * 100 / this.triangles.Length * 0.5)), ElementMesh.VertexNormal);
         }
     }
     for (int i = 0; i < this.triangles.Length; i++) {
         this.triangles[i].NormalOnVertex1 = normalsPerVertex[pointersToVertex[i].Vertex1 - 1];
         this.triangles[i].NormalOnVertex1.Normalize();
         this.triangles[i].NormalOnVertex2 = normalsPerVertex[pointersToVertex[i].Vertex2 - 1];
         this.triangles[i].NormalOnVertex2.Normalize();
         this.triangles[i].NormalOnVertex3 = normalsPerVertex[pointersToVertex[i].Vertex3 - 1];
         this.triangles[i].NormalOnVertex3.Normalize();
         int percent = (int) (i * 100 / this.triangles.Length);
         if ((percent % 5) == 0) {
             this.OnElementLoaded(50 + (int) ((i * 100 / this.triangles.Length * 0.5)), ElementMesh.VertexNormal);
         }
     }
     normalsPerVertex = null;
     //for (int i = 0; i < this.triangles.Length; i++) {
     //    this.triangles[i].NormalOnVertex1 = this.normalsPerVertex[this.pointersToVertex[i].Vertex1];
     //    this.triangles[i].NormalOnVertex2 = this.normalsPerVertex[this.pointersToVertex[i].Vertex2];
     //    this.triangles[i].NormalOnVertex3 = this.normalsPerVertex[this.pointersToVertex[i].Vertex3];
     //}
 }
开发者ID:hksonngan,项目名称:sharptracing,代码行数:31,代码来源:LoaderByuModel.cs

示例4: ComputeArea

        public double ComputeArea(Vector3D a, Vector3D b, Vector3D c)
        {
            double area = 0;
            area = ((b - a).Cross(c - a)).Length() / 2.0;

            return area;
        }
开发者ID:meshdgp,项目名称:MeshDGP,代码行数:7,代码来源:Triangle.cs

示例5: Portal

        public Portal(World world, int actorSNO, Vector3D position, Dictionary<int, TagMapEntry> tags)
            : base(world, world.NewActorID, position, tags)
        {
            this.SNOId = actorSNO;
            this.Destination = new ResolvedPortalDestination
            {
                WorldSNO = tags[(int)MarkerTagTypes.DestinationWorld].Int2,
            };

            if (tags.ContainsKey((int)MarkerTagTypes.DestinationLevelArea))
                this.Destination.DestLevelAreaSNO = tags[(int)MarkerTagTypes.DestinationLevelArea].Int2;

            if (tags.ContainsKey((int)MarkerTagTypes.DestinationActorTag))
                this.Destination.StartingPointActorTag = tags[(int)MarkerTagTypes.DestinationActorTag].Int2;
            else
                Logger.Warn("Found portal {0}without target location actor", this.SNOId);

            this.Field8 = this.SNOId;
            this.Field2 = 16;
            this.Field3 = 0;
            this.CollFlags = 0x00000001;

            // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
            this.Attributes[GameAttribute.MinimapActive] = true;
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
            this.Attributes[GameAttribute.TeamID] = 1;
            this.Attributes[GameAttribute.Level] = 1;
        }
开发者ID:elitepilot,项目名称:mooege,代码行数:31,代码来源:Portal.cs

示例6: WorldPositionToRenderCellCoord

 public static void WorldPositionToRenderCellCoord(int lod, Vector3D referenceVoxelMapPosition, ref Vector3D worldPosition, out Vector3I renderCellCoord)
 {
     Vector3D tmp;
     WorldPositionToLocalPosition(referenceVoxelMapPosition, ref worldPosition, out tmp);
     tmp /= RenderCellSizeInMeters(lod);
     Vector3I.Floor(ref tmp, out renderCellCoord);
 }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:7,代码来源:MyVoxelCoordSystems.cs

示例7: MyLodMeshMerge

            internal MyLodMeshMerge(MyClipmap parentClipmap, int lod, int lodDivisions, ref MatrixD worldMatrix, ref Vector3D massiveCenter, float massiveRadius, RenderFlags renderFlags)
            {
                Debug.Assert(parentClipmap != null, "Parent clipmap cannot be null");
                Debug.Assert(lod >= 0, "Lod level must be non-negative");
                Debug.Assert(lodDivisions >= 0, "Invalid number of lod divisions");
                m_parentClipmap = parentClipmap;
                m_lod = lod;
                m_lodDivisions = lodDivisions;

                if (m_lodDivisions <= 0)
                    return;

                m_dirtyProxyIndices = new HashSet<int>();
                m_cellProxyToAabbProxy = new Dictionary<MyClipmapCellProxy, int>();
                m_boundingBoxes = new MyDynamicAABBTreeD(Vector3D.Zero);

                int cellCount = lodDivisions*lodDivisions*lodDivisions;
                m_mergeJobs = new MergeJobInfo[cellCount];
                m_mergedLodMeshProxies = new MyClipmapCellProxy[cellCount];
                m_trackedActors = new HashSet<MyActor>[cellCount];

                for (int divideIndex = 0; divideIndex < cellCount; ++divideIndex)
                {
                    m_mergedLodMeshProxies[divideIndex] = new MyClipmapCellProxy(new MyCellCoord(Lod, GetCellFromDivideIndex(divideIndex)), ref worldMatrix, massiveCenter, massiveRadius, renderFlags, true);
                    m_mergeJobs[divideIndex] = new MergeJobInfo { CurrentWorkId = 0, LodMeshesBeingMerged = new List<LodMeshId>(), NextPossibleMergeStartTime = MyCommon.FrameCounter };
                    m_trackedActors[divideIndex] = new HashSet<MyActor>();
                    m_dirtyProxyIndices.Add(divideIndex);
                }
            }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:29,代码来源:MyLodMeshMergeHandler.cs

示例8: GnomonicToStereo

 public static Vector3D GnomonicToStereo( Vector3D g )
 {
     g /= m_gScale;
     double dot = g.Dot( g ); // X^2 + Y^2
     double z = -1 / Math.Sqrt( dot + 1 );
     return g*z / (z - 1);
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:7,代码来源:SphericalModels.cs

示例9: TriangleTest

        public TriangleTest(Vector3D a, Vector3D b, Vector3D c)
        {
            this.A = a;
            this.B = b;
            this.C = c;

            Vector2D sa;
            Vector2D sb;
            Vector2D sc;

            sa = new Vector2D(1, 5);
            sb = new Vector2D(2, 3);
            sc = new Vector2D(4, 2);

            this.sA = sa;
            this.sB = sb;
            this.sC = sc;

            triVertices.Add(A);
            triVertices.Add(B);
            triVertices.Add(C);

            AB = (A - B).Length();
            BC = (B - C).Length();
            AC = (C - A).Length();

            lengthOfTheEdge.Add(AB);
            lengthOfTheEdge.Add(BC);
            lengthOfTheEdge.Add(AC);
            lengthOfTheEdge.Sort();

        }
开发者ID:meshdgp,项目名称:MeshDGP,代码行数:32,代码来源:Triangle2.cs

示例10: CalculateMoments

 private Vector3D CalculateMoments(State state)
 {
     Vector3D vector = new Vector3D(0);
     vector.Z += 0.2f * (_commands.LeftAileron - _commands.RightAileron);
     vector.Y += 0.1f * (_commands.Elevator);
     return vector;
 }
开发者ID:ndech,项目名称:PlaneSimulator,代码行数:7,代码来源:AirplanePhysicalModel.cs

示例11: RotationAnimator

        public RotationAnimator(Vector3D p_RotationStart, Vector3D p_rotationEnd, uint p_durationMs)
        {
            m_rotationStart = p_RotationStart;
            m_rotationEnd = p_rotationEnd;
            m_durationMs = p_durationMs;

        }
开发者ID:zaki,项目名称:irrlicht.net,代码行数:7,代码来源:RotateAnimator.cs

示例12: TrySpawnParticle

		public bool TrySpawnParticle(Vector3D worldPosition)
		{
			if (!MyFakes.ENABLE_DRIVING_PARTICLES)
				return false;

			MyWheel wheel = Entity as MyWheel;
			if(wheel == null)
				return false;

			var speedMultiplier = wheel.GetTopMostParent().Physics.LinearVelocity.Length() / MyGridPhysics.ShipMaxLinearVelocity();
			var currentTime = MySandboxGame.TotalGamePlayTimeInMilliseconds;
			if (currentTime - m_lastGlobalEffectCreationTime < 5
				|| currentTime - m_lastEffectCreationTime < m_effectCreationInterval * MyUtils.GetRandomFloat(0.9f * (1.5f - speedMultiplier), 1.1f / (0.25f + speedMultiplier)))
				return false;

			MyParticleEffect drivingEffect = null;
			if (!MyParticlesManager.TryCreateParticleEffect(51, out drivingEffect))
				return false;

			m_lastEffectCreationTime = currentTime;
			m_lastGlobalEffectCreationTime = m_lastEffectCreationTime;

			drivingEffect.WorldMatrix = MatrixD.CreateTranslation(worldPosition);
			drivingEffect.Preload = 1.0f;
			var speedScaleMultiplier = 1.0f + speedMultiplier*6.0f;
			drivingEffect.UserScale = 0.25f * speedScaleMultiplier;

			return true;
		}
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:29,代码来源:MyRenderComponentWheel.cs

示例13: ReadFromXMLNode

            public virtual void ReadFromXMLNode(XmlNode node)
            {
                try
                {
                    // Deal with model path, must be only one
                    LoadModelPathNode(node);

                    // Deal with the start position
                    XmlNode startPositionNode = node.SelectSingleNode(ModelXMLDefinition.StartPosition);
                    if (startPositionNode != null)
                    {
                        m_ptStartPoint = CPoint3DSerializer.ReadPoint(startPositionNode);
                    }

                    // Read the scaleDirection
                    XmlNode scaleDirectionNode = node.SelectSingleNode(ModelXMLDefinition.SacleDirection);
                    CPoint3D scaleDirection = CPoint3DSerializer.ReadPoint(scaleDirectionNode);

                    Vector3D vec = new Vector3D(scaleDirection.X, scaleDirection.Y, scaleDirection.Z);
                    if (vec.LengthSquared != 0)
                    {
                        vec.Normalize();
                        m_scaleDirection = vec;
                    }
                }
                catch (SystemException ex)
                {
                    string errMsg = ex.Message + "\n" + ex.StackTrace;
                    vtk.vtkOutputWindow.GetInstance().DisplayErrorText(errMsg);
                    throw;
                }
            }
开发者ID:unidevop,项目名称:sjtu-project-pipe,代码行数:32,代码来源:zhujiangModels.cs

示例14: Initialize

        /// <summary>
        /// Prepares the simplex with two initial points.
        /// </summary>
        /// <param name="point1">The first point to initialize the simplex with.</param>
        /// <param name="point2">The second point to initialize the simplex with.</param>
        public void Initialize(Vector3D point1, Vector3D point2)
        {
            simplex[0] = point1;
            simplex[1] = point2;

            count = 2;
        }
开发者ID:meshdgp,项目名称:MeshDGP,代码行数:12,代码来源:Gjk.cs

示例15: CreateFromVector2D

		public void CreateFromVector2D()
		{
			var v = new Vector3D(new Vector2D(1, 2));
			Assert.AreEqual(1, v.X);
			Assert.AreEqual(2, v.Y);
			Assert.AreEqual(0, v.Z);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:Vector3DTests.cs


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