Table of Contents

Struct Bool4

Namespace
HelixToolkit.Maths
Assembly
HelixToolkit.Maths.dll

Represents a four dimensional mathematical vector of bool (32 bits per bool value).

public struct Bool4 : IEquatable<Bool4>, IFormattable
Implements
Inherited Members
Extension Methods

Constructors

Bool4(bool)

Initializes a new instance of the Bool4 struct.

public Bool4(bool value)

Parameters

value bool

The value that will be assigned to all components.

Bool4(bool, bool, bool, bool)

Initializes a new instance of the Bool4 struct.

public Bool4(bool x, bool y, bool z, bool w)

Parameters

x bool

Initial value for the X component of the vector.

y bool

Initial value for the Y component of the vector.

z bool

Initial value for the Z component of the vector.

w bool

Initial value for the W component of the vector.

Bool4(bool[])

Initializes a new instance of the Bool4 struct.

public Bool4(bool[] values)

Parameters

values bool[]

The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements.

Exceptions

ArgumentNullException

Thrown when values is null.

ArgumentOutOfRangeException

Thrown when values contains more or less than four elements.

Fields

False

A Bool4 with all of its components set to false.

public static readonly Bool4 False

Field Value

Bool4

One

A Bool4 with all of its components set to true.

public static readonly Bool4 One

Field Value

Bool4

SizeInBytes

The size of the Bool4 type, in bytes.

public static readonly int SizeInBytes

Field Value

int

UnitW

The W unit Bool4 (0, 0, 0, true).

public static readonly Bool4 UnitW

Field Value

Bool4

UnitX

The X unit Bool4 (true, 0, 0, 0).

public static readonly Bool4 UnitX

Field Value

Bool4

UnitY

The Y unit Bool4 (0, true, 0, 0).

public static readonly Bool4 UnitY

Field Value

Bool4

UnitZ

The Z unit Bool4 (0, 0, true, 0).

public static readonly Bool4 UnitZ

Field Value

Bool4

Properties

this[int]

Gets or sets the component at the specified index.

public bool this[int index] { readonly get; set; }

Parameters

index int

The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component.

Property Value

bool

The value of the X, Y, Z, or W component, depending on the index.

Exceptions

ArgumentOutOfRangeException

Thrown when the index is out of the range [0, 3].

W

The W component of the vector.

public bool W { readonly get; set; }

Property Value

bool

X

The X component of the vector.

public bool X { readonly get; set; }

Property Value

bool

Y

The Y component of the vector.

public bool Y { readonly get; set; }

Property Value

bool

Z

The Z component of the vector.

public bool Z { readonly get; set; }

Property Value

bool

Methods

Equals(Bool4)

Determines whether the specified Bool4 is equal to this instance.

public readonly bool Equals(Bool4 other)

Parameters

other Bool4

The Bool4 to compare with this instance.

Returns

bool

true if the specified Bool4 is equal to this instance; otherwise, false.

Equals(ref Bool4)

Determines whether the specified Bool4 is equal to this instance.

public readonly bool Equals(ref Bool4 other)

Parameters

other Bool4

The Bool4 to compare with this instance.

Returns

bool

true if the specified Bool4 is equal to this instance; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to this instance.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

GetHashCode()

Returns a hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

ToArray()

Creates an array containing the elements of the vector.

public readonly bool[] ToArray()

Returns

bool[]

A four-element array containing the components of the vector.

ToString()

Returns a string that represents this instance.

public override readonly string ToString()

Returns

string

A string that represents this instance.

ToString(IFormatProvider)

public readonly string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

Returns

string

ToString(string?, IFormatProvider?)

Returns a string that represents this instance.

public readonly string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format.

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

Operators

operator ==(Bool4, Bool4)

Tests for equality between two objects.

public static bool operator ==(Bool4 left, Bool4 right)

Parameters

left Bool4

The first value to compare.

right Bool4

The second value to compare.

Returns

bool

true if left has the same value as right; otherwise, false.

implicit operator bool[](Bool4)

Performs an implicit conversion from Bool4 to int array.

public static implicit operator bool[](Bool4 input)

Parameters

input Bool4

The input.

Returns

bool[]

The result of the conversion.

implicit operator Bool4(bool[])

Performs an implicit conversion from int array to Bool4.

public static implicit operator Bool4(bool[] input)

Parameters

input bool[]

The input.

Returns

Bool4

The result of the conversion.

operator !=(Bool4, Bool4)

Tests for inequality between two objects.

public static bool operator !=(Bool4 left, Bool4 right)

Parameters

left Bool4

The first value to compare.

right Bool4

The second value to compare.

Returns

bool

true if left has a different value than right; otherwise, false.