# Vector2C

# Class hierarchy

Vector2C

# Overview

Vector2C class defines a two dimensional vector class which is used by the Demopaja system. The vector class implements standard set of methods and overdriven opertators for easy use.

This class is implemented by the system.

Header: | Vector2C.h
Library: | core.lib

# Class members

`Vector2C( float32 f32X float32 f32Y );`

#### Parameters

f32X
  The X component of the vector.
f32Y
  The Y component of the vector.

#### Remarks

Creates a new vector with the values as the arguments.

`Vector2C( const Vector2C& rVec );`

#### Parameters

rVec
  Reference to the vector to copy.

#### Remarks

Copy constructor. Creates a new vector with the same values as the argument.

`Vector2C( const float32 f32A[2] );`

#### Parameters

f32A
  Pointer to a array of two floats representing a vector.

#### Remarks

Creates a new vector with the values as the array pointed by the argument.

`float32& operator[]( int32 i );`

`const float32& operator[]( int32 i ) const;`

#### Parameters

i
  Index to the component to get. Should be 0 or 1.

#### Return value

Reference to the component pointed by the index.

#### Remarks

The index values from 0 to 1 corresponds to components X, and Y respectively. There are two versions of this method, the first enables to assign values and the second is for retrieving the values.

`Vector2C operator-() const;`

#### Return value

Negated vector.

`bool operator==( const Vector2C& rVec ) const;`

#### Return value

True if both vectors are equal, else false.

`bool operator!=( const Vector2C& rVec ) const;`

#### Return value

True if both vectors are not equal, else false.

`Vector2C& operator-=( const Vector2C& rVec );`

#### Remarks

Substracts the vector specified by argument from the vector and stores the result.

`Vector2C& operator+=( const Vector2C& rVec );`

#### Remarks

Adds the vector specified by argument from the vector and stores the result.

`Vector2C& operator*=( float32 f32S );`

#### Remarks

Multiplies the vector by a scalar value specified by the argument and stores the result.

`Vector2C& operator/=( float32 f32S );`

#### Remarks

Divides the vector by a scalar value specified by the argument and stores the result.

`Vector2C operator*( float32 f32S ) const;`

#### Remarks

Multiplies the vector by a scalar value specified by the argument and returns the result.

`Vector2C operator/( float32 f32S ) const;`

#### Parameters

szName
  A NULL terminated string containing the new name of the effect.

#### Remarks

Divides the vector by a scalar value specified by the argument and returns the result.

`Vector2C operator-( const Vector2C& rVec ) const;`

#### Remarks

Substracts the vector specified by argument from the vector and returns the result.

`Vector2C operator+( const Vector2C& rVec ) const;`

#### Remarks

Adds the vector specified by argument from the vector and returns the result.

`Vector2C operator*( const Vector2C& rVec ) const;`

#### Remarks

Multiplies the vector specified by argument from the vector and returns the result. The multiplication is done component vise (that is, each corresponding component is multiplied).

`friend Vector2C operator*( float32 f32S const Vector2C& rVec );`

#### Remarks

Multiplies the vector by a scalar value specified by the argument and returns the result.

`Vector2C normalize() const;`

#### Return value

The normalized vector.

#### Remarks

Normalizes the vector to unit size and returns the result.

`float32 length() const;`

#### Return value

Returns the length of the vector

`float32 dot( const Vector2C& rVec ) const;`

#### Remarks

Computes the dot product of the two vectors and returns the result.

Copyright © 2000 Moppi Productions