PixelVector Struct Reference

#include <PixelVector.h>

Inheritance diagram for PixelVector:
Object

# Static Public Member Functions

static PixelVector zero ()
static PixelVector get (PixelVector from, PixelVector to)
static PixelVector sum (PixelVector a, PixelVector b)
static PixelVector sub (PixelVector a, PixelVector b)
static PixelVector intermediate (PixelVector a, PixelVector b)
static PixelVector getFromScreenPixelVector (ScreenPixelVector screenPixelVector, int16 parallax)
static PixelVector getFromVector2D (Vector2D vector2D, int16 parallax)
static PixelVector getFromVector3D (Vector3D vector3D, int16 parallax)
static PixelVector getRelativeToCamera (PixelVector vector)
static PixelVector projectVector3D (Vector3D vector3D, int16 parallax)
static PixelVector transformVector3D (Vector3D vector)
static fixed_t length (PixelVector vector)
static uint32 squareLength (PixelVector vector)
static bool isVisible (PixelVector vector, PixelRightBox pixelRightBox, int16 padding)
static bool isVector3DVisible (Vector3D vector, PixelRightBox pixelRightBox, int16 padding)
static void print (PixelVector vector, int32 x, int32 y)

# Public Attributes

int16 x
int16 y
int16 z
int16 parallax

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Detailed Description

Class PixelVector

Inherits from Object

Implements methods to operate on PixelVector structs.

Definition at line 30 of file PixelVector.h.

# Member Function Documentation

# get()

static PixelVector PixelVector::get ( PixelVector from,
PixelVector to )
inlinestatic

Get the difference vector between two provided vectors.

Parameters
fromStart vector
toEnd vector
Returns
Difference vector between the provided vectors

Definition at line 140 of file PixelVector.h.

# getFromScreenPixelVector()

static PixelVector PixelVector::getFromScreenPixelVector ( ScreenPixelVector screenPixelVector,
int16 parallax )
inlinestatic

Transform the provided vector in screen coordinates into a normal pixel vector.

Parameters
screenPixelVectorVector to transform
parallaxParallax component for the resulting vector
Returns
Vector in pixel units

Definition at line 174 of file PixelVector.h.

# getFromVector2D()

static PixelVector PixelVector::getFromVector2D ( Vector2D vector2D,
int16 parallax )
inlinestatic

Transform the provided 2D vector in meter coordinates into a normal pixel vector.

Parameters
vector2D2D vector to transform
parallaxParallax component for the resulting vector
Returns
Vector in pixel units

Definition at line 187 of file PixelVector.h.

# getFromVector3D()

static PixelVector PixelVector::getFromVector3D ( Vector3D vector3D,
int16 parallax )
inlinestatic

Transform the provided 2D vector in meter coordinates into a normal pixel vector.

Parameters
vector3D3D vector to transform
parallaxParallax component for the resulting vector
Returns
Vector in pixel units

Definition at line 200 of file PixelVector.h.

# getRelativeToCamera()

static PixelVector PixelVector::getRelativeToCamera ( PixelVector vector)
inlinestatic

Compute the vector relative to the camera's position.

Parameters
vectorVector to compute the relative vector of
Returns
Vector relative to the camera's position

Definition at line 213 of file PixelVector.h.

# intermediate()

static PixelVector PixelVector::intermediate ( PixelVector a,
PixelVector b )
inlinestatic

Compute the intermediate vector between two provided vectors.

Parameters
aFirst vector
bSecond vector
Returns
Intermediate vector between the provided vectors

Definition at line 161 of file PixelVector.h.

# isVector3DVisible()

static bool PixelVector::isVector3DVisible ( Vector3D vector,
PixelRightBox pixelRightBox,
int16 padding )
inlinestatic

Test if the provided 3D vector is within the provided right box

Parameters
vector3D vector to test
pixelRightBoxBounding box
paddingPadding to be added to the bounding box
Returns
True if the part of the vector is inside the bounding box; false otherwise

Definition at line 341 of file PixelVector.h.

# isVisible()

static bool PixelVector::isVisible ( PixelVector vector,
PixelRightBox pixelRightBox,
int16 padding )
inlinestatic

Test if the provided vector is within the provided right box

Parameters
vectorVector to test
pixelRightBoxBounding box
paddingPadding to be added to the bounding box
Returns
True if the part of the vector is inside the bounding box; false otherwise

Definition at line 311 of file PixelVector.h.

# length()

static fixed_t PixelVector::length ( PixelVector vector)
inlinestatic

Compute the length of the provided vector.

Parameters
vectorVector to compute the length of
Returns
Length of the provided vector

Definition at line 297 of file PixelVector.h.

# print()

static void PixelVector::print ( PixelVector vector,
int32 x,
int32 y )
inlinestatic

Print the vector's components.

Parameters
vectorVector to print
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 25 of file PixelVector.c.

# projectVector3D()

static PixelVector PixelVector::projectVector3D ( Vector3D vector3D,
int16 parallax )
inlinestatic

Project the 3D vector to a vector in pixel units.

Parameters
vector3D3D vector to project
parallaxParallax component for the resulting vector
Returns
Projected vector in pixel units

Definition at line 226 of file PixelVector.h.

# squareLength()

static uint32 PixelVector::squareLength ( PixelVector vector)
inlinestatic

Compute the squared length of the provided vector.

Parameters
vectorVector to compute the square length of
Returns
Square length of the provided vector

Definition at line 304 of file PixelVector.h.

# sub()

static PixelVector PixelVector::sub ( PixelVector a,
PixelVector b )
inlinestatic

Compute the difference vector between two provided vectors.

Parameters
aEnd vector
bStart vector
Returns
Difference vector between the provided vectors

Definition at line 154 of file PixelVector.h.

# sum()

static PixelVector PixelVector::sum ( PixelVector a,
PixelVector b )
inlinestatic

Compute the addition vector between other two provided vectors.

Parameters
aFirst vector
bSecond vector
Returns
Addition vector between the provided vectors

Definition at line 147 of file PixelVector.h.

# transformVector3D()

static PixelVector PixelVector::transformVector3D ( Vector3D vector)
inlinestatic

Transform to camera space and project the 3D vector to a vector in pixel units.

Parameters
vector3D vector to transform
Returns
Projected vector in pixel units

Definition at line 288 of file PixelVector.h.

# zero()

static PixelVector PixelVector::zero ( )
inlinestatic

Get a vector with all its members initialized to zero.

Returns
Pixel vector with all its members initialized to zero

# Member Data Documentation

# parallax

int16 PixelVector::parallax

Definition at line 120 of file Types.h.

# x

int16 PixelVector::x

Definition at line 117 of file Types.h.

# y

int16 PixelVector::y

Definition at line 118 of file Types.h.

# z

int16 PixelVector::z

Definition at line 119 of file Types.h.


The documentation for this struct was generated from the following files: