public override void _Ready()
    {
        maze = new Maze(ShapeGeometry.MakePolygon(6, 21, (float)Math.PI / 2),
                        new Vector2(-21, -21), new Vector2(21, 21));
        //maze = new Maze(ShapeGeometry.MakeStar(12, 21, (float)Math.PI / 2), new Vector2(-21, -21), new Vector2(21, 21));

        //Draw cells to single mesh and apply to screen
        var surfTool = MeshCreation.CreateSurfaceTool();

        var walls = maze.GetWalls();

        foreach (var wall in walls)
        {
            if (!wall.KnockedDown)
            {
                MeshCreation.AddWall(surfTool, new Vector3(wall.GetPoint1X(), 0.0f, wall.GetPoint1Y()),
                                     new Vector3(wall.GetPoint2X(), 0.0f, wall.GetPoint2Y()), 0.1f, 2.0f);
            }
        }

        this.AddChild(MeshCreation.CreateMeshInstanceFromMesh(MeshCreation.CreateMeshFromSurfaceTool(surfTool)));

        //Put players at start
        KinematicBody player       = (KinematicBody)this.GetParent().GetNode("player");
        var           startingCell = maze.GetStartingCell();

        player.SetTranslation(new Vector3(startingCell.X, 0.0f, startingCell.Y));

        //Put flag at end
        Spatial flag       = (Spatial)this.GetParent().GetNode("Flag");
        var     endingCell = maze.GetEndingCell();

        flag.SetTranslation(new Vector3(endingCell.X, 0.0f, endingCell.Y));
    }
        private List <ICollisionShape> BuildJenga()
        {
            List <ICollisionShape> objects = new List <ICollisionShape>();

            Vector3d position = new Vector3d(-8.0, 0.0, 0.0);

            string objName = "jenga.obj";

            GeometryProperties geom1 = GetObjectGeometry(objName, 1.0f);

            ShapeGeometry shapeGeometry = new ShapeGeometry(geom1.VertexPoint, geom1.TriagleIdx);

            ShapeFilename.Add(objName);
            ShapeScale.Add(1.0f);
            TextureFilename.Add("texture/woodbox.bmp");

            //var objects1 = new ConcaveShape(shapeGeometry, position, 1.0, false);
            //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
            //var objects1 = new ConvexShape(geom1.VertexPoint, position, 1.0);
            var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);

            objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 1.0));
            objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
            objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
            objects1.SetRestitutionCoeff(0.1);
            objects1.SetDynamicFrictionCoeff(0.3);
            objects1.SetStaticFrictionCoeff(0.9);
            objects1.ExcludeFromCollisionDetection(false);
            objects1.SetErrorReductionParam(0.3);
            //position = position + shift;

            objects.Add(objects1);

            return(objects);
        }
Exemplo n.º 3
0
 private static Point[] FindIntersections(IList <Shape> shapes)
 {
     Point[] intersections = null;
     for (int i = 0; i < shapes.Count - 1; i++)
     {
         ShapeGeometry a = shapes[i].Geometry;
         for (int j = i + 1; j < shapes.Count; j++)
         {
             ShapeGeometry b = shapes[j].Geometry;
             intersections = intersections == null
                 ? a.Intersect(b)
                 : intersections.Union(a.Intersect(b)).ToArray();
         }
     }
     return(intersections == null
         ? new Point[0]
         : intersections.Distinct(new PointComparer()).ToArray());
 }
Exemplo n.º 4
0
        static void Main()
        {
            Console.WriteLine("Maze Benchmark!");

            Stopwatch benchmark = new Stopwatch();

            benchmark.Start();
            Maze maze;

            for (var i = 0; i < 100; i++)
            {
                maze = new Maze(ShapeGeometry.MakePolygon(6, 21, (float)Math.PI / 2), new Vector2(-21, -21), new Vector2(21, 21));
            }
            benchmark.Stop();
            Console.WriteLine("Elapsed time {0} ms", benchmark.ElapsedMilliseconds);

            //var maze = new Maze(new List<Vector2>() { new Vector2(-10, -10), new Vector2(10, -10), new Vector2(10, 10), new Vector2(-10, 10) }, new Vector2(-21, -21), new Vector2(21, 21));
        }
Exemplo n.º 5
0
            public override bool DoHitTest(IGeometryHost geometryHost, PointD hitPoint, DiagramHitTestInfo hitTestInfo,
                                           bool includeTolerance)
            {
                RectangleD perimeterBoundingBox = this.GetPerimeterBoundingBox(geometryHost);

                if (includeTolerance)
                {
                    perimeterBoundingBox.Inflate(ShapeGeometry.GetHitTestTolerance(hitTestInfo));
                }
                if (hitTestInfo != null)
                {
                    hitTestInfo.HitDiagramItem = null;
                    hitTestInfo.HitGrabHandle  = null;
                }

                // point is in the bounding rectangle
                bool flag = false;

                if (perimeterBoundingBox.Contains(hitPoint))
                {
                    // point is in the diamond shape
                    flag = isPointInTriangle(
                        new PointD(perimeterBoundingBox.X, perimeterBoundingBox.Y + perimeterBoundingBox.Height / 2),
                        new PointD(perimeterBoundingBox.X + perimeterBoundingBox.Width / 2, perimeterBoundingBox.Y),
                        new PointD(perimeterBoundingBox.X + perimeterBoundingBox.Width, perimeterBoundingBox.Y + perimeterBoundingBox.Height / 2),
                        hitPoint
                        );
                    if (!flag)
                    {
                        flag = isPointInTriangle(
                            new PointD(perimeterBoundingBox.X, perimeterBoundingBox.Y + perimeterBoundingBox.Height / 2),
                            new PointD(perimeterBoundingBox.X + perimeterBoundingBox.Width / 2, perimeterBoundingBox.Y + perimeterBoundingBox.Height),
                            new PointD(perimeterBoundingBox.X + perimeterBoundingBox.Width, perimeterBoundingBox.Y + perimeterBoundingBox.Height / 2),
                            hitPoint
                            );
                    }
                }

                if (flag && (hitTestInfo != null))
                {
                    hitTestInfo.HitDiagramItem = ShapeGeometry.CreateDiagramItem(geometryHost);
                }
                return(flag);
            }
        public override void OnPaintShape(DiagramPaintEventArgs e)
        {
            // Have we adjusted the other colors in the shape for this fill color?
            if (!_isAdjustedForFillColor)
            {
                AdjustForFillColor();
            }

            base.OnPaintShape(e);

            if (e.View != null)
            {
                // If the shape is in the EmphasizedShapes list, draw the emphasis shape around the shape.
                if (Diagram.EmphasizedShapes.Contains(new DiagramItem(this)))
                {
                    ShapeGeometry.DoPaintEmphasis(e, this);
                }
            }
        }
        public override void OnPaintShape(DiagramPaintEventArgs e)
        {
            // Have we adjusted the other colors in the shape for this fill color?
            if (!_isAdjustedForFillColor)
            {
                AdjustForFillColor();
            }

            base.OnPaintShape(e);
            // DoPaintEmphasis requires some information from canvas (for example: zoom factor),
            // so we need to skip drawing shapes' emphasis if they are drawn outside of diagram canvas (for example: in thumbnail view).
            if (e.View != null)
            {
                // If the shape is in the EmphasizedShapes list, draw the emphasis shape around the shape.
                if (Diagram.EmphasizedShapes.Contains(new DiagramItem(this)))
                {
                    ShapeGeometry.DoPaintEmphasis(e, this);
                }
            }
        }
Exemplo n.º 8
0
        public override void OnPaintShape(DiagramPaintEventArgs e)
        {
            // Check if we have to override colors.
            if (!IsColorThemeSet)
            {
                SetColorTheme();
            }

            base.OnPaintShape(e);

            if (e.View != null)
            {
                // If the shape is in the EmphasizedShapes list, draw the emphasis shape around the shape.
                var diagram = Diagram as ConfigurationSectionDesignerDiagram;
                if (diagram.EmphasizedShapes.Contains(new DiagramItem(this)))
                {
                    ShapeGeometry.DoPaintEmphasis(e, this);
                }
            }
        }
Exemplo n.º 9
0
        public override void OnPaintShape(DiagramPaintEventArgs e)
        {
            // Check if we have to override colors.
            if (!IsColorThemeSet)
            {
                SetColorTheme();
            }

            base.OnPaintShape(e);

            // DoPaintEmphasis requires some information from canvas (for example: canvas's zoom factor),
            // so we need to skip drawing shapes' emphasis if they are drawn outside of diagram canvas (for example: in thumbnail view).
            if (e.View != null)
            {
                // If the shape is in the EmphasizedShapes list, draw the emphasis shape around the shape.
                var entityDesignerDiagram = Diagram as EntityDesignerDiagram;
                if (entityDesignerDiagram.EmphasizedShapes.Contains(new DiagramItem(this)))
                {
                    ShapeGeometry.DoPaintEmphasis(e, this);
                }
            }
        }
Exemplo n.º 10
0
        private List <ICollisionShape> BuildStack()
        {
            List <ICollisionShape> objects = new List <ICollisionShape>();

            Vector3d shift = new Vector3d(0.0, 2.3, 0.0);

            Vector3d position = new Vector3d(8.0, 4.0, 0.0);
            string   objName  = "cube.obj";

            double[] mass = new double[] { 50, 20, 8, 3, 1 };

            GeometryProperties geom1 = GetObjectGeometry(objName, 1.0f);

            ShapeGeometry shapeGeometry = new ShapeGeometry(geom1.VertexPoint, geom1.TriagleIdx);

            //ShapeGeometry shapeGeometry = new ShapeGeometry(geom1.VertexPoint);

            for (int i = 0; i < 15; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1.0f);
                TextureFilename.Add("texture/woodbox.bmp");

                //var objects1 = new ConcaveShape(shapeGeometry, position, 1.0, false);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 1.0));
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(11.0, 4.0, 0.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(5.0, 1.7, 0.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(5.0, 1.7, 3.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(5.0, 1.7, -5.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(5.0, 1.7, 8.0);

            for (int i = 0; i < 5; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }


            position = new Vector3d(8.0, 1.7, -3.0);

            for (int i = 0; i < 10; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(8.0, 1.7, 3.0);

            for (int i = 0; i < 10; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            return(objects);
        }
Exemplo n.º 11
0
 public void Dispose()
 {
     ShapeGeometry?.Dispose();
     DataLabels?.Dispose();
 }
Exemplo n.º 12
0
 public void Dispose()
 {
     ShapeGeometry?.Dispose();
     TextGeometry?.Dispose();
 }
Exemplo n.º 13
0
		/// <summary>
		/// Paint the background and outline of a <see cref="IGeometryHost"/> using
		/// dynamic colors provided by the <see cref="IDynamicColorGeometryHost"/> interface.
		/// This is a helper method designed to be called by an override of the <see cref="NodeShapeGeometry.DoPaintGeometry"/> method.
		/// </summary>
		/// <param name="e">The <see cref="DiagramPaintEventArgs"/> passed to DoPaintGeometry</param>
		/// <param name="geometryHost">The <see cref="IGeometryHost"/> passed to DoPaintGeometry</param>
		/// <param name="dynamicColors">The <see cref="IDynamicColorGeometryHost"/> retrieved from the <paramref name="geometryHost"/></param>
		/// <param name="shapeGeometry">The <see cref="ShapeGeometry"/> this is a helper for.</param>
		/// <param name="hasFilledBackground">The result of the <see cref="ShapeGeometry.HasFilledBackground"/> method</param>
		/// <param name="hasOutline">The result of the <see cref="ShapeGeometry.HasOutline"/> method</param>
		/// <remarks>
		/// The DoPaintGeometry override should look similar to
		/// <code>
		/// protected override void DoPaintGeometry(DiagramPaintEventArgs e, IGeometryHost geometryHost)
		/// {
		///     IDynamicColorGeometryHost dynamicColors = geometryHost as IDynamicColorGeometryHost;
		///     if (dynamicColors != null)
		///     {
		///         GeometryUtility.PaintDynamicColorGeometry(e, geometryHost, dynamicColors, this, this.HasFilledBackground(geometryHost), this.HasOutline(geometryHost));
		///     }
		///     else
		///     {
		///         base.DoPaintGeometry(e, geometryHost);
		///     }
		/// }
		/// </code>
		/// </remarks>
		public static void PaintDynamicColorGeometry(DiagramPaintEventArgs e, IGeometryHost geometryHost, IDynamicColorGeometryHost dynamicColors, ShapeGeometry shapeGeometry, bool hasFilledBackground, bool hasOutline)
		{
			if (hasFilledBackground || hasOutline)
			{
				StyleSet geometryStyleSet = geometryHost.GeometryStyleSet;
				GraphicsPath path;
				StyleSetResourceId penId = null;
				Pen pen = null;
				StyleSetResourceId brushId = null;
				Brush brush = null;
				if (null != (path = shapeGeometry.GetPath(geometryHost)) &&
					(!hasFilledBackground || null != (brush = geometryStyleSet.GetBrush(brushId = shapeGeometry.GetBackgroundBrushId(geometryHost)))) &&
					(!hasOutline || null != (pen = geometryStyleSet.GetPen(penId = shapeGeometry.GetOutlinePenId(geometryHost)))))
				{
					Graphics g = e.Graphics;
					DiagramClientView clientView = e.View;
					Color restoreColor;
					if (brush != null)
					{
						restoreColor = Color.Empty;
						if (dynamicColors == null ||
							(restoreColor = dynamicColors.UpdateDynamicColor(brushId, brush)).IsEmpty)
						{
							if (clientView != null)
							{
								restoreColor = geometryHost.UpdateGeometryLuminosity(clientView, brush);
							}
						}
						else if (clientView != null)
						{
							geometryHost.UpdateGeometryLuminosity(clientView, brush);
						}
						g.FillPath(brush, path);
						SolidBrush solidBrush = brush as SolidBrush;
						if (!restoreColor.IsEmpty &&
							null != (solidBrush = brush as SolidBrush))
						{
							solidBrush.Color = restoreColor;
						}
					}
					if (pen != null)
					{
						restoreColor = Color.Empty;
						if (dynamicColors == null ||
							(restoreColor = dynamicColors.UpdateDynamicColor(penId, pen)).IsEmpty)
						{
							if (clientView != null)
							{
								restoreColor = geometryHost.UpdateGeometryLuminosity(clientView, pen);
							}
						}
						else if (clientView != null)
						{
							geometryHost.UpdateGeometryLuminosity(clientView, pen);
						}
						SafeDrawPath(g, pen, path);
						if (!restoreColor.IsEmpty)
						{
							pen.Color = restoreColor;
						}
					}
				}
			}
		}
Exemplo n.º 14
0
        private List <ICollisionShape> GetSimulationObjects()
        {
            List <ICollisionShape> objects = new List <ICollisionShape>();

            #region Terrain Base

            ShapeFilename.Add("cube1.obj");
            ShapeScale.Add(60);
            TextureFilename.Add("texture/woodbox.bmp");

            GeometryProperties geom0 = GetObjectGeometry(ShapeFilename[0], ShapeScale[0], 0.0);
            var objects0             = new ConvexShape(geom0.VertexPoint, geom0.TriagleIdx, new Vector3d(0.0, -2.0, 0.0), 0.0, true);
            objects0.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 1.0));
            objects0.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
            objects0.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
            objects0.SetRestitutionCoeff(0.1);
            objects0.SetDynamicFrictionCoeff(1.0);
            objects0.SetStaticFrictionCoeff(1.0);
            objects0.ExcludeFromCollisionDetection(false);
            objects0.SetErrorReductionParam(0.3);

            objects.Add(objects0);

            #endregion

            #region Dynamic Objects

            Vector3d shift = new Vector3d(0.0, 2.3, 0.0);

            Vector3d position = new Vector3d(0.0, 4.0, 0.0);
            string   objName  = "cube.obj";

            double[] mass = new double[] { 50, 20, 8, 3, 1 };

            GeometryProperties geom1 = GetObjectGeometry(objName, 1.0f, 0.0);

            ShapeGeometry shapeGeometry = new ShapeGeometry(geom1.VertexPoint, geom1.TriagleIdx);
            //ShapeGeometry shapeGeometry = new ShapeGeometry(geom1.VertexPoint);

            for (int i = 0; i < 15; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1.0f);
                TextureFilename.Add("texture/woodbox.bmp");

                //var objects1 = new ConcaveShape(shapeGeometry, position, 1.0, false);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 1.0));
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(3.0, 4.0, 0.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(-3.0, 1.7, 0.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(-3.0, 1.7, 3.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(-3.0, 1.7, -5.0);

            for (int i = 0; i < 4; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(-3.0, 1.7, 8.0);

            for (int i = 0; i < 5; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }


            position = new Vector3d(0.0, 1.7, -3.0);

            for (int i = 0; i < 10; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }

            position = new Vector3d(0.0, 1.7, 3.0);

            for (int i = 0; i < 10; i++)
            {
                ShapeFilename.Add(objName);
                ShapeScale.Add(1);
                TextureFilename.Add("texture/woodbox.bmp");


                //GeometryProperties geom1 = GetObjectGeometry(objName, 1, 0.0);
                //var objects1 = new ConvexShape(geom1.VertexPoint, geom1.TriagleIdx, position, 1.0);
                var objects1 = new ConvexShape(shapeGeometry, position, 1.0, false);
                objects1.SetRotationStatus(new Quaternion(new Vector3d(0.0, 0.0, 0.0), 0.0));
                //objects1.SetGeometry(geom1.VertexPoint, geom1.TriagleIdx);
                objects1.SetLinearVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetAngularVelocity(new Vector3d(0.0, 0.0, 0.0));
                objects1.SetRestitutionCoeff(0.1);
                objects1.SetDynamicFrictionCoeff(0.3);
                objects1.SetStaticFrictionCoeff(0.9);
                objects1.ExcludeFromCollisionDetection(false);
                objects1.SetErrorReductionParam(0.3);
                position = position + shift;

                objects.Add(objects1);
            }


            //TextureFilename[3] = new string[1] { "texture/woodbox.bmp" };
            //TODO rimuovere
            //<ShapeFilename[3] = new string[1] { "torus.obj" };
            //ShapeScale[3] = new float[1] { 1 };

            //var objects3 = BuildSoftBody("torus.obj", 1, new Vector3(0.0, -1.5, 0.0));
            //         objects3.SetStaticFrictionCoeff(0.5);
            //         objects3.SetDynamicFrictionCoeff(0.5);
            //         objects3.SetRestitutionCoeff(0.5);
            //         objects3.SetRestoreCoeff(60.0);

            //         objects.Add(objects3);

            #endregion

            return(objects);
        }