Public Member Functions | Static Public Member Functions

FIFE::ObjectVisual Class Reference

#include <visual.h>

Inheritance diagram for FIFE::ObjectVisual:
Inheritance graph
[legend]
Collaboration diagram for FIFE::ObjectVisual:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~ObjectVisual ()
void addStaticImage (unsigned int angle, int image_index)
int getStaticImageIndexByAngle (int angle)
int getClosestMatchingAngle (int angle)
void getStaticImageAngles (std::vector< int > &angles)

Static Public Member Functions

static ObjectVisualcreate (Object *object)

Detailed Description

Object visual contains data that is needed for visualizing objects

Definition at line 85 of file visual.h.


Constructor & Destructor Documentation

FIFE::ObjectVisual::~ObjectVisual (  )  [virtual]

Destructor

Definition at line 62 of file visual.cpp.


Member Function Documentation

void FIFE::ObjectVisual::addStaticImage ( unsigned int  angle,
int  image_index 
)

Adds new static image with given angle (degrees) Static images are used in case there are no actions active in the instance There can be several static images for different angles, that are used in case view / layer is rotated In case there are no exact matches for current view angles, closest one is used

Parameters:
angle angle for image. 0 degrees starts from right and turns counter-clockwise (normal math notation)
image_index index of image to use for given degress

Definition at line 65 of file visual.cpp.

ObjectVisual * FIFE::ObjectVisual::create ( Object object  )  [static]

Constructs and assigns it to the passed item

Definition at line 53 of file visual.cpp.

References FIFE::Object::getVisual().

int FIFE::ObjectVisual::getClosestMatchingAngle ( int  angle  ) 

Returns closest matching image angle for given angle

Returns:
closest matching angle

Definition at line 74 of file visual.cpp.

References FIFE::getIndexByAngle().

void FIFE::ObjectVisual::getStaticImageAngles ( std::vector< int > &  angles  ) 

Returns list of available static image angles for this object

Definition at line 80 of file visual.cpp.

int FIFE::ObjectVisual::getStaticImageIndexByAngle ( int  angle  ) 

Returns closest matching static image for given angle

Returns:
id for static image

Definition at line 69 of file visual.cpp.

References FIFE::getIndexByAngle().


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