• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Inferno
    • CollisionMode
    • DrawMode
    • Game
    • Game.OnResizeEventArgs
    • GameState
    • GameState.StateOnDrawEventArgs
    • GameWindow
    • Instance
    • MathHelper
    • Matrix
    • Point
    • Rectangle
    • Settings
    • SpatialMode
    • UpdateMode
    • Vector2
    • Vector3
    • Vector4
  • Inferno.Audio
    • AudioDevice
    • Sound
  • Inferno.Content
    • ContentLoader
  • Inferno.Formats.Audio
    • WaveFormat
  • Inferno.Formats.Graphics.Text
    • FontFormat
  • Inferno.Graphics
    • Camera
    • Color
    • GraphicsDevice
    • PlatformType
    • Renderable
    • RenderableType
    • Renderer
    • RenderSortMode
    • RenderTarget
    • Shader
    • ShaderLanguage
    • ShaderType
    • Sprite
    • Texture2D
    • Tileset
  • Inferno.Graphics.Text
    • Font
    • FontBuilder
  • Inferno.Input
    • ButtonState
    • Key
    • Keyboard
    • Keyboard.KeyEventArgs
    • KeyboardState
    • KeyState
    • Mouse
    • MouseState
  • Inferno.Tiled
    • RenderOrder
    • TiledLayer
    • TiledLayerChunk
    • TiledLoader
    • TiledMap
    • TiledMapOrientation
    • TiledObject
    • TiledObjectLayer
    • TiledVersion
  • Inferno.UI
    • MessageBox
    • MessageBoxType
    • UserInterface
  • Inferno.UI.Controls
    • Button
    • Control
    • Control.ControlClickedEvent
    • Control.ControlHoveredEvent
    • Control.TextChangedEventArgs
    • ControlState
    • Cursor
    • Label

Struct Vector2

A Vector with two (X and Y) components.

Implements
System.IEquatable<Vector2>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Inferno
Assembly: Inferno.Desktop.dll
Syntax
public struct Vector2 : IEquatable<Vector2>

Constructors

| Improve this Doc View Source

Vector2(Single)

Declaration
public Vector2(float value)
Parameters
Type Name Description
System.Single value
| Improve this Doc View Source

Vector2(Single, Single)

Create a new vector2.

Declaration
public Vector2(float x, float y)
Parameters
Type Name Description
System.Single x

X component

System.Single y

Y component

Fields

| Improve this Doc View Source

UnitX

Declaration
public static Vector2 UnitX
Field Value
Type Description
Vector2
| Improve this Doc View Source

UnitY

Declaration
public static Vector2 UnitY
Field Value
Type Description
Vector2
| Improve this Doc View Source

X

The X component of the vector.

Declaration
public float X
Field Value
Type Description
System.Single
| Improve this Doc View Source

Y

The Y component of the vector

Declaration
public float Y
Field Value
Type Description
System.Single
| Improve this Doc View Source

Zero

Declaration
public static Vector2 Zero
Field Value
Type Description
Vector2

Properties

| Improve this Doc View Source

Magnitude

The magnitude of the vector.

Declaration
public float Magnitude { get; }
Property Value
Type Description
System.Single

Methods

| Improve this Doc View Source

Distance(Vector2)

Declaration
public float Distance(Vector2 to)
Parameters
Type Name Description
Vector2 to
Returns
Type Description
System.Single
| Improve this Doc View Source

Distance(Vector2, Vector2)

Declaration
public static float Distance(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
System.Single
| Improve this Doc View Source

Dot(Vector2)

Declaration
public float Dot(Vector2 b)
Parameters
Type Name Description
Vector2 b
Returns
Type Description
System.Single
| Improve this Doc View Source

Dot(Vector2, Vector2)

Get the dot product of 2 vectors.

Declaration
public static float Dot(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
System.Single
| Improve this Doc View Source

Equals(Vector2)

Declaration
public bool Equals(Vector2 other)
Parameters
Type Name Description
Vector2 other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

Length()

Declaration
public float Length()
Returns
Type Description
System.Single
| Improve this Doc View Source

Length(Vector2)

Declaration
public static float Length(Vector2 vector)
Parameters
Type Name Description
Vector2 vector
Returns
Type Description
System.Single
| Improve this Doc View Source

LengthSquared()

Declaration
public float LengthSquared()
Returns
Type Description
System.Single
| Improve this Doc View Source

LengthSquared(Vector2)

Declaration
public static float LengthSquared(Vector2 vector)
Parameters
Type Name Description
Vector2 vector
Returns
Type Description
System.Single
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()
| Improve this Doc View Source

Transform(Vector2, Matrix)

Declaration
public static Vector2 Transform(Vector2 position, Matrix matrix)
Parameters
Type Name Description
Vector2 position
Matrix matrix
Returns
Type Description
Vector2

Operators

| Improve this Doc View Source

Addition(Vector2, Vector2)

Declaration
public static Vector2 operator +(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Addition(Vector2, Int32)

Declaration
public static Vector2 operator +(Vector2 a, int b)
Parameters
Type Name Description
Vector2 a
System.Int32 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Addition(Vector2, Single)

Declaration
public static Vector2 operator +(Vector2 a, float b)
Parameters
Type Name Description
Vector2 a
System.Single b
Returns
Type Description
Vector2
| Improve this Doc View Source

Addition(Int32, Vector2)

Declaration
public static Vector2 operator +(int b, Vector2 a)
Parameters
Type Name Description
System.Int32 b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Addition(Single, Vector2)

Declaration
public static Vector2 operator +(float b, Vector2 a)
Parameters
Type Name Description
System.Single b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Division(Vector2, Vector2)

Declaration
public static Vector2 operator /(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Division(Vector2, Int32)

Declaration
public static Vector2 operator /(Vector2 a, int b)
Parameters
Type Name Description
Vector2 a
System.Int32 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Division(Vector2, Single)

Declaration
public static Vector2 operator /(Vector2 a, float b)
Parameters
Type Name Description
Vector2 a
System.Single b
Returns
Type Description
Vector2
| Improve this Doc View Source

Division(Int32, Vector2)

Declaration
public static Vector2 operator /(int b, Vector2 a)
Parameters
Type Name Description
System.Int32 b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Division(Single, Vector2)

Declaration
public static Vector2 operator /(float b, Vector2 a)
Parameters
Type Name Description
System.Single b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Equality(Vector2, Vector2)

Declaration
public static bool operator ==(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Inequality(Vector2, Vector2)

Declaration
public static bool operator !=(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Multiply(Vector2, Vector2)

Declaration
public static Vector2 operator *(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Multiply(Vector2, Int32)

Declaration
public static Vector2 operator *(Vector2 a, int b)
Parameters
Type Name Description
Vector2 a
System.Int32 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Multiply(Vector2, Single)

Declaration
public static Vector2 operator *(Vector2 a, float b)
Parameters
Type Name Description
Vector2 a
System.Single b
Returns
Type Description
Vector2
| Improve this Doc View Source

Multiply(Int32, Vector2)

Declaration
public static Vector2 operator *(int b, Vector2 a)
Parameters
Type Name Description
System.Int32 b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Multiply(Single, Vector2)

Declaration
public static Vector2 operator *(float b, Vector2 a)
Parameters
Type Name Description
System.Single b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Subtraction(Vector2, Vector2)

Declaration
public static Vector2 operator -(Vector2 a, Vector2 b)
Parameters
Type Name Description
Vector2 a
Vector2 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Subtraction(Vector2, Int32)

Declaration
public static Vector2 operator -(Vector2 a, int b)
Parameters
Type Name Description
Vector2 a
System.Int32 b
Returns
Type Description
Vector2
| Improve this Doc View Source

Subtraction(Vector2, Single)

Declaration
public static Vector2 operator -(Vector2 a, float b)
Parameters
Type Name Description
Vector2 a
System.Single b
Returns
Type Description
Vector2
| Improve this Doc View Source

Subtraction(Int32, Vector2)

Declaration
public static Vector2 operator -(int b, Vector2 a)
Parameters
Type Name Description
System.Int32 b
Vector2 a
Returns
Type Description
Vector2
| Improve this Doc View Source

Subtraction(Single, Vector2)

Declaration
public static Vector2 operator -(float b, Vector2 a)
Parameters
Type Name Description
System.Single b
Vector2 a
Returns
Type Description
Vector2

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX