Drag[en]gine Script Module DragonScript Script API  1.0
DVector Class Reference

Immutable 3-component double precision vector. More...

Inheritance diagram for DVector:

Public Member Functions

Constructors
DVector new ()
 Create vector with all components set to 0. More...
 
DVector new (float x, float y, float z)
 Create vector using the specified components. More...
 
DVector new (DVector v)
 Create copy of a DVector. More...
 
DVector new (Vector v)
 Create DVetor from Vector. More...
 
Management
float getX ()
 X-Component. More...
 
float getY ()
 Y-Component. More...
 
float getZ ()
 Z-Component. More...
 
float get (int component)
 Component (0=X, 1=Y, 2=Z ). More...
 
float getLength ()
 Length. More...
 
float getLengthSquared ()
 Squared length. More...
 
DVector normalize ()
 Vector divided by length(). More...
 
DVector compMultiply (DVector v)
 Component wise multiplication. More...
 
DVector compDivide (DVector v)
 Component wise division. More...
 
DVector compSelect (bool x, bool y, bool z)
 Vector with components set to true copied while all others are set to 0. More...
 
DVector smallest (Vector v)
 Vector with all components set to the smallest value of two vectors. More...
 
DVector largest (Vector v)
 Vector with all components set to the largest value of two vectors. More...
 
DVector clamped (Vector min, Vector max)
 Vector with all components clamped to a range of two vectors. More...
 
Vector toVector ()
 Convert to single precision vector with possible loss of precision. More...
 
bool isEqualTo (DVector v, float delta)
 Two vectors are equal. More...
 
bool isAtLeast (float value)
 All coordinates are at least of a minimal value. More...
 
bool isAtMost (float value)
 All coordinates are at most of a maximal value. More...
 
bool equals (Object other)
 Vector is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
String toString ()
 String representation of vector. More...
 
Operators
DVector operator- ()
 Negated vector. More...
 
DVector operator+ (DVector v)
 Sum of two vectors. More...
 
DVector operator- (DVector v)
 Difference of two vectors. More...
 
DVector operator* (float scalar)
 Vector scaled by scalar. More...
 
DVector operator/ (float scalar)
 Vector with each component divided by a value. More...
 
float operator* (DVector v)
 Dot-Product between two vectors. More...
 
DVector operator% (DVector v)
 Cross-Product between two vectors. More...
 
bool operator< (DVector v)
 Vector is less than another vector in all components. More...
 
bool operator<= (DVector v)
 Vector is less than or equal to another vector in all components. More...
 
bool operator> (DVector v)
 Vector is greater than another vector in all components. More...
 
bool operator>= (DVector v)
 Vector is greater than or equal to another vector in all components. More...
 

File Handling

void writeToFile (FileWriter writer)
 Write vector to a file writer. More...
 
static DVector readFromFile (FileReader reader)
 Read vector from a file reader. More...
 

Detailed Description

Immutable 3-component double precision vector.

This is a native class. It can not be subclassed.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ clamped()

DVector clamped ( Vector  min,
Vector  max 
)

Vector with all components clamped to a range of two vectors.

§ compDivide()

DVector compDivide ( DVector  v)

Component wise division.

§ compMultiply()

DVector compMultiply ( DVector  v)

Component wise multiplication.

§ compSelect()

DVector compSelect ( bool  x,
bool  y,
bool  z 
)

Vector with components set to true copied while all others are set to 0.

§ equals()

bool equals ( Object  other)

Vector is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type DVector and components are equal.

§ get()

float get ( int  component)

Component (0=X, 1=Y, 2=Z ).

§ getLength()

float getLength ( )

Length.

§ getLengthSquared()

float getLengthSquared ( )

Squared length.

§ getX()

float getX ( )

X-Component.

§ getY()

float getY ( )

Y-Component.

§ getZ()

float getZ ( )

Z-Component.

§ hashCode()

int hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

§ isAtLeast()

bool isAtLeast ( float  value)

All coordinates are at least of a minimal value.

§ isAtMost()

bool isAtMost ( float  value)

All coordinates are at most of a maximal value.

§ isEqualTo()

bool isEqualTo ( DVector  v,
float  delta 
)

Two vectors are equal.

§ largest()

DVector largest ( Vector  v)

Vector with all components set to the largest value of two vectors.

§ new() [1/4]

DVector new ( )

Create vector with all components set to 0.

§ new() [2/4]

DVector new ( float  x,
float  y,
float  z 
)

Create vector using the specified components.

§ new() [3/4]

DVector new ( DVector  v)

Create copy of a DVector.

§ new() [4/4]

DVector new ( Vector  v)

Create DVetor from Vector.

§ normalize()

DVector normalize ( )

Vector divided by length().

Exceptions
EDivisionByZeroLength is 0.

§ operator%()

DVector operator% ( DVector  v)

Cross-Product between two vectors.

§ operator*() [1/2]

DVector operator* ( float  scalar)

Vector scaled by scalar.

§ operator*() [2/2]

float operator* ( DVector  v)

Dot-Product between two vectors.

§ operator+()

DVector operator+ ( DVector  v)

Sum of two vectors.

§ operator-() [1/2]

DVector operator- ( )

Negated vector.

§ operator-() [2/2]

DVector operator- ( DVector  v)

Difference of two vectors.

§ operator/()

DVector operator/ ( float  scalar)

Vector with each component divided by a value.

Exceptions
EDivisionByZeroscalar is 0.

§ operator<()

bool operator< ( DVector  v)

Vector is less than another vector in all components.

§ operator<=()

bool operator<= ( DVector  v)

Vector is less than or equal to another vector in all components.

§ operator>()

bool operator> ( DVector  v)

Vector is greater than another vector in all components.

§ operator>=()

bool operator>= ( DVector  v)

Vector is greater than or equal to another vector in all components.

§ readFromFile()

static DVector readFromFile ( FileReader  reader)
static

Read vector from a file reader.

§ smallest()

DVector smallest ( Vector  v)

Vector with all components set to the smallest value of two vectors.

§ toString()

String toString ( )

String representation of vector.

Implements Object.toString()

§ toVector()

Vector toVector ( )

Convert to single precision vector with possible loss of precision.

§ writeToFile()

void writeToFile ( FileWriter  writer)

Write vector to a file writer.


The documentation for this class was generated from the following file: