#include "coordinates.h" void Coordinate::setCoord (Coord coord, COORD_TYPE cType) { setPosition (coord.position, cType); setRotation (coord.rotation, cType); } void Coordinate::setPosition (Vector position, COORD_TYPE cType) { if (cType == WORLD) worldCoord.position = position; else if (cType == TRACK) worldCoord.position = position; // set it like (position + world::get_instance->track->getPosition(WORLD)); else if (cType == LOCAL) worldCoord.position = Vector (0,0,0); // have to think about this one.... if it makes sense at all. } void Coordinate::setRotation (Quaternion rotation, COORD_TYPE cType) { if (cType == WORLD) worldCoord.rotation = rotation; else if (cType == TRACK) worldCoord.rotation = rotation; // it like (rotation * world::get_instance->track->getRotation(WORLD)); else if (cType == LOCAL) worldCoord.rotation = Quaternion(); } Coord Coordinate::getCoord (COORD_TYPE cType) const { Coord tmpCoord; tmpCoord.position = getPosition (cType); tmpCoord.rotation = getRotation (cType); } Vector Coordinate::getPosition (COORD_TYPE cType) const { if (cType == WORLD) return worldCoord.position; else if (cType == TRACK) return worldCoord.position; // should be like (WorldCoord - world::get_instance->track->getPosition(WORLD)); else if (cType == LOCAL) return Vector (0,0,0); } Quaternion Coordinate::getRotation (COORD_TYPE cType) const { if (cType == WORLD) return worldCoord.rotation; else if (cType == TRACK) return worldCoord.rotation; // should be like (WorldCoord - world::get_instance->track->getRotation(WORLD)); else if (cType == LOCAL) return Quaternion (); }