C# Class OpenBveApi.Math.Vector3

Represents a three-dimensional vector.
Afficher le fichier Open project: leezer3/OpenBVE Class Usage Examples

Méthodes publiques

Свойство Type Description
Backward Vector3
Down Vector3
Forward Vector3
Left Vector3
Null Vector3
Right Vector3
Up Vector3
X double
Y double
Z double

Méthodes publiques

Méthode Description
AreColinear ( Vector3 a, Vector3 b, Vector3 c ) : bool

Checks whether three spatial coordinates are colinear.

CosineInterpolate ( Vector3 Vector1, Vector3 Vector2, double mu ) : Vector3

Interpolates between two Vector3 values using a simple Cosine algorithm

CreateNormal ( Vector3 a, Vector3 b, Vector3 c, Vector3 &normal ) : bool

Creates a unit vector perpendicular to the plane described by three spatial coordinates, suitable for being a surface normal.

Cross ( Vector3 a, Vector3 b ) : Vector3

Gives the cross product of two vectors.

Dot ( Vector3 a, Vector3 b ) : double

Gives the dot product of two vectors.

GetVector3 ( Vector2 Vector, double Y ) : Vector3

Returns a normalized vector based on a 2D vector in the XZ plane and an additional Y-coordinate.

IsNullVector ( ) : bool

Checks whether the vector is a null vector.

IsNullVector ( Vector3 vector ) : bool

Checks whether a vector is a null vector.

IsNullVector ( double tolerance ) : bool

Checks whether the vector is considered a null vector.

IsZero ( Vector3 Vector ) : bool

Determines whether this is a zero (0,0,0) vector

LinearInterpolate ( Vector3 Vector1, Vector3 Vector2, double mu ) : Vector3

Linearly interpolates between two vectors

Norm ( ) : double

Gets the euclidean norm.

Norm ( Vector3 vector ) : double

Gets the euclidean norm of the specified vector.

NormSquared ( ) : double

Gets the square of the euclidean norm.

NormSquared ( Vector3 vector ) : double

Gets the square of the euclidean norm of the specified vector.

Normalize ( Vector3 vector ) : Vector3

Normalizes a vector.

Normalize ( ) : void

Normalizes the vector.

Rotate ( Vector3 vector, Orientation3 orientation ) : Vector3

Rotates a vector from the default orientation into a specified orientation.

The default orientation is X = {1, 0, 0), Y = {0, 1, 0} and Z = {0, 0, 1}.

Rotate ( Vector3 vector, Vector3 direction, double cosineOfAngle, double sineOfAngle ) : Vector3

Rotates a vector on the plane perpendicular to a specified direction by a specified angle.

Rotate ( Orientation3 orientation ) : void

Rotates the vector from the default orientation into a specified orientation.

The default orientation is X = {1, 0, 0), Y = {0, 1, 0} and Z = {0, 0, 1}.

Rotate ( Vector3 direction, double cosineOfAngle, double sineOfAngle ) : void

Rotates the vector on the plane perpendicular to a specified direction by a specified angle.

Scale ( Vector3 vector, Vector3 factor ) : Vector3

Scales a vector by a specified factor.

Scale ( Vector3 factor ) : void

Scales the vector by a specified factor.

ToString ( ) : string

Returns the representation of the vector in string format

Translate ( Vector3 vector, Orientation3 orientation, Vector3 offset ) : Vector3

Translates a vector by a specified offset that is measured along a specified orientation.

Translate ( Vector3 vector, Vector3 offset ) : Vector3

Translates a vector by a specified offset.

Translate ( Orientation3 orientation, Vector3 offset ) : void

Translates the vector by a specified offset that is measured in a specified orientation.

Translate ( Vector3 offset ) : void

Translates the vector by a specified offset.

Vector3 ( double x, double y, double z ) : System

Creates a new three-dimensional vector.

operator ( ) : Vector3

Adds two vectors.

operator ( ) : bool

Checks whether the two specified vectors are equal.

Method Details

AreColinear() public static méthode

Checks whether three spatial coordinates are colinear.
public static AreColinear ( Vector3 a, Vector3 b, Vector3 c ) : bool
a Vector3 The first spatial coordinate.
b Vector3 The second spatial coordinate.
c Vector3 The third spatial coordinate.
Résultat bool

CosineInterpolate() public static méthode

Interpolates between two Vector3 values using a simple Cosine algorithm
public static CosineInterpolate ( Vector3 Vector1, Vector3 Vector2, double mu ) : Vector3
Vector1 Vector3 The first vector
Vector2 Vector3 The second vector
mu double The position on the curve of the new vector
Résultat Vector3

CreateNormal() public static méthode

Creates a unit vector perpendicular to the plane described by three spatial coordinates, suitable for being a surface normal.
public static CreateNormal ( Vector3 a, Vector3 b, Vector3 c, Vector3 &normal ) : bool
a Vector3 The first spatial coordinate.
b Vector3 The second spatial coordinate.
c Vector3 The third spatial coordinate.
normal Vector3 On success, receives the vector perpendicular to the described plane. On failure, receives Vector3.Up.
Résultat bool

Cross() public static méthode

Gives the cross product of two vectors.
public static Cross ( Vector3 a, Vector3 b ) : Vector3
a Vector3 The first vector.
b Vector3 The second vector.
Résultat Vector3

Dot() public static méthode

Gives the dot product of two vectors.
public static Dot ( Vector3 a, Vector3 b ) : double
a Vector3 The first vector.
b Vector3 The second vector.
Résultat double

GetVector3() public static méthode

Returns a normalized vector based on a 2D vector in the XZ plane and an additional Y-coordinate.
public static GetVector3 ( Vector2 Vector, double Y ) : Vector3
Vector Vector2 The vector in the XZ-plane. The X and Y components in Vector represent the X- and Z-coordinates, respectively.
Y double The Y-coordinate.
Résultat Vector3

IsNullVector() public méthode

Checks whether the vector is a null vector.
public IsNullVector ( ) : bool
Résultat bool

IsNullVector() public static méthode

Checks whether a vector is a null vector.
public static IsNullVector ( Vector3 vector ) : bool
vector Vector3
Résultat bool

IsNullVector() public méthode

Checks whether the vector is considered a null vector.
public IsNullVector ( double tolerance ) : bool
tolerance double The highest absolute value that each component of the vector may have before the vector is not considered a null vector.
Résultat bool

IsZero() public static méthode

Determines whether this is a zero (0,0,0) vector
public static IsZero ( Vector3 Vector ) : bool
Vector Vector3
Résultat bool

LinearInterpolate() public static méthode

Linearly interpolates between two vectors
public static LinearInterpolate ( Vector3 Vector1, Vector3 Vector2, double mu ) : Vector3
Vector1 Vector3 The first vector
Vector2 Vector3 The second vector
mu double The position on the interpolation curve of the new vector
Résultat Vector3

Norm() public méthode

Gets the euclidean norm.
public Norm ( ) : double
Résultat double

Norm() public static méthode

Gets the euclidean norm of the specified vector.
public static Norm ( Vector3 vector ) : double
vector Vector3 The vector.
Résultat double

NormSquared() public méthode

Gets the square of the euclidean norm.
public NormSquared ( ) : double
Résultat double

NormSquared() public static méthode

Gets the square of the euclidean norm of the specified vector.
public static NormSquared ( Vector3 vector ) : double
vector Vector3 The vector.
Résultat double

Normalize() public static méthode

Normalizes a vector.
Raised when the vector is a null vector.
public static Normalize ( Vector3 vector ) : Vector3
vector Vector3 The vector.
Résultat Vector3

Normalize() public méthode

Normalizes the vector.
Raised when the vector is a null vector.
public Normalize ( ) : void
Résultat void

Rotate() public static méthode

Rotates a vector from the default orientation into a specified orientation.
The default orientation is X = {1, 0, 0), Y = {0, 1, 0} and Z = {0, 0, 1}.
public static Rotate ( Vector3 vector, Orientation3 orientation ) : Vector3
vector Vector3 The vector.
orientation Orientation3 The orientation.
Résultat Vector3

Rotate() public static méthode

Rotates a vector on the plane perpendicular to a specified direction by a specified angle.
public static Rotate ( Vector3 vector, Vector3 direction, double cosineOfAngle, double sineOfAngle ) : Vector3
vector Vector3 The vector.
direction Vector3 The direction perpendicular to the plane on which to rotate.
cosineOfAngle double The cosine of the angle.
sineOfAngle double The sine of the angle.
Résultat Vector3

Rotate() public méthode

Rotates the vector from the default orientation into a specified orientation.
The default orientation is X = {1, 0, 0), Y = {0, 1, 0} and Z = {0, 0, 1}.
public Rotate ( Orientation3 orientation ) : void
orientation Orientation3 The orientation.
Résultat void

Rotate() public méthode

Rotates the vector on the plane perpendicular to a specified direction by a specified angle.
public Rotate ( Vector3 direction, double cosineOfAngle, double sineOfAngle ) : void
direction Vector3 The direction perpendicular to the plane on which to rotate.
cosineOfAngle double The cosine of the angle.
sineOfAngle double The sine of the angle.
Résultat void

Scale() public static méthode

Scales a vector by a specified factor.
public static Scale ( Vector3 vector, Vector3 factor ) : Vector3
vector Vector3 The vector.
factor Vector3 The factor.
Résultat Vector3

Scale() public méthode

Scales the vector by a specified factor.
public Scale ( Vector3 factor ) : void
factor Vector3 The factor.
Résultat void

ToString() public méthode

Returns the representation of the vector in string format
public ToString ( ) : string
Résultat string

Translate() public static méthode

Translates a vector by a specified offset that is measured along a specified orientation.
public static Translate ( Vector3 vector, Orientation3 orientation, Vector3 offset ) : Vector3
vector Vector3 The vector.
orientation Orientation3 The orientation.
offset Vector3 The offset measured in the specified orientation.
Résultat Vector3

Translate() public static méthode

Translates a vector by a specified offset.
public static Translate ( Vector3 vector, Vector3 offset ) : Vector3
vector Vector3 The vector.
offset Vector3 The offset.
Résultat Vector3

Translate() public méthode

Translates the vector by a specified offset that is measured in a specified orientation.
public Translate ( Orientation3 orientation, Vector3 offset ) : void
orientation Orientation3 The orientation.
offset Vector3 The offset measured in the specified orientation.
Résultat void

Translate() public méthode

Translates the vector by a specified offset.
public Translate ( Vector3 offset ) : void
offset Vector3 The offset.
Résultat void

Vector3() public méthode

Creates a new three-dimensional vector.
public Vector3 ( double x, double y, double z ) : System
x double The x-coordinate.
y double The y-coordinate.
z double The z-coordinate.
Résultat System

operator() public static méthode

Adds two vectors.
public static operator ( ) : Vector3
Résultat Vector3

operator() public static méthode

Checks whether the two specified vectors are equal.
public static operator ( ) : bool
Résultat bool

Property Details

Backward public_oe static_oe property

Represents a vector pointing up.
public static Vector3 Backward
Résultat Vector3

Down public_oe static_oe property

Represents a vector pointing down.
public static Vector3 Down
Résultat Vector3

Forward public_oe static_oe property

Represents a vector pointing down.
public static Vector3 Forward
Résultat Vector3

Left public_oe static_oe property

Represents a vector pointing left.
public static Vector3 Left
Résultat Vector3

Null public_oe static_oe property

Represents a null vector.
public static Vector3 Null
Résultat Vector3

Right public_oe static_oe property

Represents a vector pointing right.
public static Vector3 Right
Résultat Vector3

Up public_oe static_oe property

Represents a vector pointing up.
public static Vector3 Up
Résultat Vector3

X public_oe property

The x-coordinate.
public double X
Résultat double

Y public_oe property

The y-coordinate.
public double Y
Résultat double

Z public_oe property

The z-coordinate.
public double Z
Résultat double