Exemple #1
0
 public Rotation2(Rotation2 arg) : this(kdlPINVOKE.new_Rotation2__SWIG_3(Rotation2.getCPtr(arg)), true)
 {
     if (kdlPINVOKE.SWIGPendingException.Pending)
     {
         throw kdlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #2
0
    public static Rotation2 operator +(Rotation2 r1, Rotation2 r2)
    {
        Rotation2 result = new Rotation2(r1);

        result.LeftBy(r2);
        return(result);
    }
Exemple #3
0
    void Start()
    {
        mainCamera = GameObject.Find(CAMERA_NAME).GetComponent <Camera>();

        inputFlags    = new bool[INPUT_DICT.Count];
        mousePosition = new Vector2();
        mouseRotation = new Rotation2();
    }
Exemple #4
0
        public static void Draw(Texture2D texture, Rectangle rectPosition, Rotation2 rotation)
        {
            Resources.Put(texture.GetHashCode().ToString(), texture);
            var ScaledRect = ScaleRectangle(rectPosition);

            _spriteBatch.Draw(texture, null, ScaledRect, null, new Vector2(ScaledRect.Width / 2, ScaledRect.Height / 2),
                              rotation.Value * .017453292519f, new Vector2(1, 1));
        }
Exemple #5
0
    public Representable(string prefabName, Vector2 defaultPosition)
    {
        this.defaultPosition = new Vector2(defaultPosition.x, defaultPosition.y);

        SetRepresentationPrefab(prefabName);
        SetRepresentationSprite(null);
        position = new Vector2(this.defaultPosition.x, this.defaultPosition.y);
        rotation = new Rotation2();
    }
Exemple #6
0
        public Rotation2 Inverse()
        {
            Rotation2 ret = new Rotation2(kdlPINVOKE.Rotation2_Inverse__SWIG_0(swigCPtr), true);

            if (kdlPINVOKE.SWIGPendingException.Pending)
            {
                throw kdlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #7
0
        public static Rotation2 Identity()
        {
            Rotation2 ret = new Rotation2(kdlPINVOKE.Rotation2_Identity(), true);

            if (kdlPINVOKE.SWIGPendingException.Pending)
            {
                throw kdlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #8
0
        public static Rotation2 Rot(double angle)
        {
            Rotation2 ret = new Rotation2(kdlPINVOKE.Rotation2_Rot(angle), true);

            if (kdlPINVOKE.SWIGPendingException.Pending)
            {
                throw kdlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public OverlapBox(Vec2 pos, Vec2 size, float rot, bool centerAtTheBottom)
        {
            CenterAtTheBottom = centerAtTheBottom;
            Size = size;
            var hSize   = size / 2;
            var polygon = false ?
                          new Polygon2(new[] { new Vector2(-hSize.X, 0), new Vector2(hSize.X, 0), new Vector2(hSize.X, size.Y), new Vector2(-hSize.X, size.Y) }, new Vector2(0, 0))
                :
                          new Polygon2(new[] { new Vector2(-hSize.X, -hSize.Y), new Vector2(hSize.X, -hSize.Y), new Vector2(hSize.X, hSize.Y), new Vector2(-hSize.X, hSize.Y) });

            var rotation = new Rotation2((float)(Math.PI * (rot / 180)));
            var position = new Vector2(pos.X, pos.Y);

            Poly      = polygon;
            Rot       = rotation;
            Pos       = position;
            RotAngles = rot;
        }
 public Projection(Vector2 coordinates, float scale, Rotation2 rotation)
 {
     _coordinates = coordinates;
     _scale       = scale;
     _rotation    = rotation;
 }
 public RotoTranslation2(Rotation2 rotation) : this(rotation, Vector2.Zero)
 {
 }
 public RotoTranslation2(Rotation2 rotation, Vector2 translation)
 {
     _rotation    = rotation;
     _translation = translation;
 }
Exemple #13
0
 public void RightBy(Rotation2 rotation)
 {
     valueInRads -= rotation.valueInRads;
     Clamp();
 }
Exemple #14
0
 public void Set(Rotation2 rotation)
 {
     valueInRads = rotation.valueInRads;
 }
 public Transform(Rotation2 rot, Vector2 trans)
 {
     T = trans; R = rot;
 }
Exemple #16
0
 public void SetRotation(Rotation2 rotation)
 {
     this.rotation = rotation;
 }
Exemple #17
0
 public void AdjustRotation(Rotation2 delta)
 {
     rotation += delta;
 }
Exemple #18
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation2 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Exemple #19
0
 public RectangleCollisionShape2(Vector2 position, Rotation2 rotation) : base(Shape.RECT, position, rotation)
 {
 }
 public ColoredCone()
 {
     color     = Color.Orange;
     transform = new Transform2(new Size2(400, 400));
     angle     = new Rotation2(90);
 }
Exemple #21
0
 public Rotation2(Rotation2 rotation)
 {
     Set(rotation);
 }
Exemple #22
0
 public static RotoTranslation2 ComputeRotationAboutPoint(Rotation2 rotation, Vector2 point)
 {
     return(new RotoTranslation2(rotation, point - rotation.Apply(point)));
 }
Exemple #23
0
 public void LeftBy(Rotation2 rotation)
 {
     valueInRads += rotation.valueInRads;
     Clamp();
 }
Exemple #24
0
 public void SetRepresentationRotation(Rotation2 rotation)
 {
     this.rotation = rotation;
 }
 public ConeTexture(int range, Rotation2 angle, Color color)
 {
     _range = range;
     _color = color;
     _angle = angle;
 }
Exemple #26
0
 public Entity(string prefabName) : base(prefabName)
 {
     position = new Vector2();
     rotation = new Rotation2();
 }
Exemple #27
0
 public CollisionShape2(Shape shape, Vector2 pos, Rotation2 rot)
 {
     this.shape = shape;
     this.pos   = new Vector2(position.X, position.Y);
     this.rot   = new Rotation2(rot);
 }
Exemple #28
0
 public static void DrawCenteredWithOffset(string imageName, Vector2 widthHeight, Vector2 offSet, Rotation2 rotation)
 {
     _spriteBatch.Draw(Resources.Load <Texture2D>(imageName), null,
                       new Rectangle(ScalePoint(_display.GameWidth / 2 / _display.Scale - widthHeight.X / 2 + offSet.X,
                                                _display.GameHeight / 2 / _display.Scale - widthHeight.Y / 2 + offSet.Y),
                                     ScalePoint(widthHeight.X, widthHeight.Y)),
                       null, null, rotation.Value * .017453292519f, new Vector2(1, 1));
 }