private void AddVerticesFromEllipse(DrawableEntity entity)
		{
			var color = entity.Get<Color>();
			var center = entity.Get<Vector3D>();
			var radius = entity.Get<float>();
			var point = Vector3D.UnitX * radius;
			for (int i = 0; i < 360; i += 5)
			{
				var rotatedPoint = point.RotateAround(Vector3D.UnitZ, i);
				vertices.Add(new VertexPosition3DColor(rotatedPoint + center, color));
			}
		}
Beispiel #2
0
        private void AddVerticesFromEllipse(DrawableEntity entity)
        {
            var color  = entity.Get <Color>();
            var center = entity.Get <Vector3D>();
            var radius = entity.Get <float>();
            var point  = Vector3D.UnitX * radius;

            for (int i = 0; i < 360; i += 5)
            {
                var rotatedPoint = point.RotateAround(Vector3D.UnitZ, i);
                vertices.Add(new VertexPosition3DColor(rotatedPoint + center, color));
            }
        }
Beispiel #3
0
		private void AddVerticesFromLine(DrawableEntity entity)
		{
			var color = entity.Get<Color>();
			var points = entity.GetInterpolatedList<Vector3D>();
			foreach (Vector3D point in points)
				vertices.Add(new VertexPosition3DColor(point, color));
		}
Beispiel #4
0
		private void AddVerticesFromLine(DrawableEntity entity)
		{
			var color = entity.Get<Color>();
			var points = entity.GetInterpolatedList<Vector2D>();
			foreach (Vector2D point in points)
				vertices.Add(new VertexPosition2DColor(ScreenSpace.Current.ToPixelSpaceRounded(point),
					color));
		}
        private void AddVerticesFromLine(DrawableEntity entity)
        {
            var color  = entity.Get <Color>();
            var points = entity.GetInterpolatedList <Vector3D>();

            foreach (Vector3D point in points)
            {
                vertices.Add(new VertexPosition3DColor(point, color));
            }
        }
Beispiel #6
0
        public void CreateFromComponents()
        {
            var drawable = new DrawableEntity();

            drawable.SetComponents(new List <object> {
                5, false
            });
            Assert.AreEqual(5, drawable.Get <int>());
            Assert.IsFalse(drawable.IsVisible);
        }
Beispiel #7
0
 private void FormEllipsePoints(DrawableEntity entity)
 {
     ellipsePoints = entity.Get <List <Vector2D> >();
     ellipsePoints.Clear();
     ellipsePoints.Add(center);
     for (int i = pointsCount - 1; i >= 0; i--)
     {
         FormRotatedEllipsePoint(i);
     }
     entity.SetWithoutInterpolation(ellipsePoints);
 }
        private void AddVerticesFromLine(DrawableEntity entity)
        {
            var color  = entity.Get <Color>();
            var points = entity.GetInterpolatedList <Vector2D>();

            foreach (Vector2D point in points)
            {
                vertices.Add(new VertexPosition2DColor(ScreenSpace.Current.ToPixelSpaceRounded(point),
                                                       color));
            }
        }
Beispiel #9
0
		public void CreateFromComponents()
		{
			var drawable = new DrawableEntity();
			drawable.SetComponents(new List<object> { 5, false });
			Assert.AreEqual(5, drawable.Get<int>());
			Assert.IsFalse(drawable.IsVisible);
		}
Beispiel #10
0
			private void FormEllipsePoints(DrawableEntity entity)
			{
				ellipsePoints = entity.Get<List<Vector2D>>();
				ellipsePoints.Clear();
				ellipsePoints.Add(center);
				for (int i = pointsCount - 1; i >= 0; i--)
					FormRotatedEllipsePoint(i);
				entity.SetWithoutInterpolation(ellipsePoints);
			}