cVector cVector::cross(cVector& in){ sVector input = in.getVectorCoord(); cVector ret = cVector(((m_sVectorData->y * input.z) - (m_sVectorData->z * input.y)), ((m_sVectorData->z * input.x) - (m_sVectorData->x * input.z)), ((m_sVectorData->x * input.y) - (m_sVectorData->y * input.x))); return ret; }
float cVector::dot(cVector& in){ sVector input = in.getVectorCoord(); return (m_sVectorData->x * input.x) + (m_sVectorData->y * input.y) + (m_sVectorData->z*input.z); }
cVector cVector::sub(cVector& in){ sVector a = in.getVectorCoord(); cVector ret = cVector((-a.x) + m_sVectorData->x, (-a.y) + m_sVectorData->y, (-a.z) + m_sVectorData->z); return ret; }
cVector cVector::add(cVector& in){ sVector a = in.getVectorCoord(); cVector ret = cVector(a.x + m_sVectorData->x, a.y + m_sVectorData->y, a.z + m_sVectorData->z); return ret; }
cVector cVector::operator-(cVector& v){ sVector a = v.getVectorCoord(); cVector ret = cVector((-a.x) + m_sVectorData->x, (-a.y) + m_sVectorData->y, (-a.z) + m_sVectorData->z); return ret; }
cVector cVector::operator+(cVector& v){ sVector a = v.getVectorCoord(); cVector ret = cVector(a.x + m_sVectorData->x, a.y + m_sVectorData->y, a.z + m_sVectorData->z); return ret; }