JVector¶
-
struct
JVector
: System.ValueType A vector structure. Member of the math namespace, so every method has it’s ‘by reference’ equivalent to speed up time critical math operations.
-
float
X
The X component of the vector.
-
float
Y
The Y component of the vector.
-
float
Z
The Z component of the vector.
-
JVector
Zero
A vector with components (0,0,0);
-
JVector
Left
A vector with components (1,0,0);
-
JVector
Right
A vector with components (-1,0,0);
-
JVector
Up
A vector with components (0,1,0);
-
JVector
Down
A vector with components (0,-1,0);
-
JVector
Backward
A vector with components (0,0,1);
-
JVector
Forward
A vector with components (0,0,-1);
-
JVector
One
A vector with components (1,1,1);
-
JVector
MinValue
A vector with components (float.MinValue,float.MinValue,float.MinValue);
-
JVector
MaxValue
A vector with components (float.MaxValue,float.MaxValue,float.MaxValue);
-
void
Set
(float x, float y, float z) Sets all vector component to specific values.
Parameters: - x (float) – The X component of the vector.
- y (float) – The Y component of the vector.
- z (float) – The Z component of the vector.
-
string
ToString
() Builds a string from the JVector.
Returns: A string containing all three components.
-
bool
Equals
(System.Object obj) Tests if an object is equal to this vector.
Parameters: - obj (System.Object) – The object to test.
Returns: Returns true if they are euqal, otherwise false.
-
bool
op_Equality
(JVector value1, JVector value2) Tests if two JVector are equal.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first value.
- value2 (Jitter.LinearMath.JVector) – The second value.
Returns: Returns true if both values are equal, otherwise false.
-
bool
op_Inequality
(JVector value1, JVector value2) Tests if two JVector are not equal.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first value.
- value2 (Jitter.LinearMath.JVector) – The second value.
Returns: Returns false if both values are equal, otherwise true.
-
JVector
Min
(JVector value1, JVector value2) Gets a vector with the minimum x,y and z values of both vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first value.
- value2 (Jitter.LinearMath.JVector) – The second value.
Returns: A vector with the minimum x,y and z values of both vectors.
-
void
Min
(ref JVector value1, ref JVector value2, ref JVector result) Parameters: - (ref) value1 (Jitter.LinearMath.JVector) –
- (ref) value2 (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
JVector
Max
(JVector value1, JVector value2) Gets a vector with the maximum x,y and z values of both vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first value.
- value2 (Jitter.LinearMath.JVector) – The second value.
Returns: A vector with the maximum x,y and z values of both vectors.
-
void
Max
(ref JVector value1, ref JVector value2, ref JVector result) Parameters: - (ref) value1 (Jitter.LinearMath.JVector) –
- (ref) value2 (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
void
MakeZero
() Sets the length of the vector to zero.
-
bool
IsZero
() Checks if the length of the vector is zero.
Returns: Returns true if the vector is zero, otherwise false.
-
bool
IsNearlyZero
() Checks if the length of the vector is nearly zero.
Returns: Returns true if the vector is nearly zero, otherwise false.
-
JVector
Transform
(JVector position, JMatrix matrix) Transforms a vector by the given matrix.
Parameters: - position (Jitter.LinearMath.JVector) – The vector to transform.
- matrix (Jitter.LinearMath.JMatrix) – The transform matrix.
Returns: The transformed vector.
-
void
Transform
(ref JVector position, ref JMatrix matrix, ref JVector result) Parameters: - (ref) position (Jitter.LinearMath.JVector) –
- (ref) matrix (Jitter.LinearMath.JMatrix) –
- (ref) result (Jitter.LinearMath.JVector) –
-
void
TransposedTransform
(ref JVector position, ref JMatrix matrix, ref JVector result) Parameters: - (ref) position (Jitter.LinearMath.JVector) –
- (ref) matrix (Jitter.LinearMath.JMatrix) –
- (ref) result (Jitter.LinearMath.JVector) –
-
float
Dot
(JVector vector1, JVector vector2) Calculates the dot product of two vectors.
Parameters: - vector1 (Jitter.LinearMath.JVector) – The first vector.
- vector2 (Jitter.LinearMath.JVector) – The second vector.
Returns: Returns the dot product of both vectors.
-
float
Dot
(ref JVector vector1, ref JVector vector2) Parameters: - (ref) vector1 (Jitter.LinearMath.JVector) –
- (ref) vector2 (Jitter.LinearMath.JVector) –
-
JVector
Add
(JVector value1, JVector value2) Adds two vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first vector.
- value2 (Jitter.LinearMath.JVector) – The second vector.
Returns: The sum of both vectors.
-
void
Add
(ref JVector value1, ref JVector value2, ref JVector result) Parameters: - (ref) value1 (Jitter.LinearMath.JVector) –
- (ref) value2 (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
JVector
Subtract
(JVector value1, JVector value2) Subtracts two vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first vector.
- value2 (Jitter.LinearMath.JVector) – The second vector.
Returns: The difference of both vectors.
-
void
Subtract
(ref JVector value1, ref JVector value2, ref JVector result) Parameters: - (ref) value1 (Jitter.LinearMath.JVector) –
- (ref) value2 (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
JVector
Cross
(JVector vector1, JVector vector2) The cross product of two vectors.
Parameters: - vector1 (Jitter.LinearMath.JVector) – The first vector.
- vector2 (Jitter.LinearMath.JVector) – The second vector.
Returns: The cross product of both vectors.
-
void
Cross
(ref JVector vector1, ref JVector vector2, ref JVector result) Parameters: - (ref) vector1 (Jitter.LinearMath.JVector) –
- (ref) vector2 (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
int
GetHashCode
() Gets the hashcode of the vector.
Returns: Returns the hashcode of the vector.
-
void
Negate
() Inverses the direction of the vector.
-
JVector
Negate
(JVector value) Inverses the direction of a vector.
Parameters: - value (Jitter.LinearMath.JVector) – The vector to inverse.
Returns: The negated vector.
-
void
Negate
(ref JVector value, ref JVector result) Parameters: - (ref) value (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
JVector
Normalize
(JVector value) Normalizes the given vector.
Parameters: - value (Jitter.LinearMath.JVector) – The vector which should be normalized.
Returns: A normalized vector.
-
void
Normalize
() Normalizes this vector.
-
void
Normalize
(ref JVector value, ref JVector result) Parameters: - (ref) value (Jitter.LinearMath.JVector) –
- (ref) result (Jitter.LinearMath.JVector) –
-
float
LengthSquared
() Gets the squared length of the vector.
Returns: Returns the squared length of the vector.
-
float
Length
() Gets the length of the vector.
Returns: Returns the length of the vector.
-
void
Swap
(ref JVector vector1, ref JVector vector2) Parameters: - (ref) vector1 (Jitter.LinearMath.JVector) –
- (ref) vector2 (Jitter.LinearMath.JVector) –
-
JVector
Multiply
(JVector value1, float scaleFactor) Multiply a vector with a factor.
Parameters: - value1 (Jitter.LinearMath.JVector) – The vector to multiply.
- scaleFactor (float) – The scale factor.
Returns: Returns the multiplied vector.
-
void
Multiply
(ref JVector value1, float scaleFactor, ref JVector result) Parameters: - (ref) value1 (Jitter.LinearMath.JVector) –
- scaleFactor (float) –
- (ref) result (Jitter.LinearMath.JVector) –
-
JVector
op_Modulus
(JVector value1, JVector value2) Calculates the cross product of two vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first vector.
- value2 (Jitter.LinearMath.JVector) – The second vector.
Returns: Returns the cross product of both.
-
float
op_Multiply
(JVector value1, JVector value2) Calculates the dot product of two vectors.
Parameters: - value1 (Jitter.LinearMath.JVector) – The first vector.
- value2 (Jitter.LinearMath.JVector) – The second vector.
Returns: Returns the dot product of both.
-
JVector
op_Multiply
(JVector value1, float value2) Multiplies a vector by a scale factor.
Parameters: - value1 (Jitter.LinearMath.JVector) – The vector to scale.
- value2 (float) – The scale factor.
Returns: Returns the scaled vector.
-
JVector
op_Multiply
(float value1, JVector value2) Multiplies a vector by a scale factor.
Parameters: - value1 (float) – The scale factor.
- value2 (Jitter.LinearMath.JVector) – The vector to scale.
Returns: Returns the scaled vector.
-
float