source: 2014/24/EemeliK/Zombieland/Jypeli/Physics2DDotNet/Shapes/Shape.cs @ 5974

Revision 5974, 3.0 KB checked in by empaheik, 4 years ago (diff)
Line 
1#region MIT License
2/*
3 * Copyright (c) 2005-2008 Jonathan Mark Porter. http://physics2d.googlepages.com/
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22#endregion
23
24
25
26
27#if UseDouble
28using Scalar = System.Double;
29#else
30using Scalar = System.Single;
31#endif
32using System;
33using AdvanceMath;
34using AdvanceMath.Geometry2D;
35
36using System.Xml.Serialization;
37
38namespace Physics2DDotNet.Shapes
39{
40    public interface IShape
41    {
42        object Tag { get;set;}
43        Vector2D[] Vertexes { get;}
44        /// <summary>
45        /// These are the normals for the original vertexes.
46        /// </summary>
47        Vector2D[] VertexNormals { get;}
48        Scalar Inertia { get;}
49        bool CanGetIntersection { get;}
50        bool CanGetCustomIntersection { get;}
51
52        void CalcBoundingRectangle(ref Matrix2x3 matrix, out BoundingRectangle rectangle);
53        bool TryGetIntersection(Vector2D point, out IntersectionInfo info);
54        bool TryGetCustomIntersection(Body self, Body other, out object customIntersectionInfo);
55    }
56    public interface IRaySegmentsCollidable : IShape
57    {
58        bool TryGetRayCollision(Body thisBody, Body raysBody, RaySegmentsShape raySegments, out RaySegmentIntersectionInfo info);
59    }
60    public interface IHasArea : IShape
61    {
62        Scalar Area { get;}
63        Vector2D Centroid { get;}
64        void GetDistance(ref Vector2D point, out Scalar result);
65    }
66    public interface IGlobalFluidAffectable : IHasArea
67    {
68        DragInfo GetFluidInfo(Vector2D tangent);
69    }
70    public delegate Vector2D GetTangentCallback(Vector2D centroid);
71    public interface ILineFluidAffectable : IGlobalFluidAffectable
72    {
73        FluidInfo GetFluidInfo(GetTangentCallback callback, Line line);
74    }
75    public interface IExplosionAffectable : IGlobalFluidAffectable
76    {
77        DragInfo GetExplosionInfo(Matrix2x3 matrix, Scalar radius, GetTangentCallback callback);
78    }
79}
Note: See TracBrowser for help on using the repository browser.