You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.4 KiB

#ifndef __PUNKT3D_h
#define __PUNKT3D_h
#include <iostream>
#include <cmath>
#include "emath.h"
class Punkt3D {
public:
Punkt3D();
Punkt3D(float, float, float);
float x, y, z;
void set(float, float, float);
float abs();
Punkt3D kreuzprodukt(const Punkt3D&);
void normalize();
Punkt3D getNormalized();
bool isNormalized();
float calcAngle(Punkt3D);
Punkt3D getOrtographic();
void print(std::string="");
// Operatoren
Punkt3D operator+(const Punkt3D&);
Punkt3D operator-(const Punkt3D&);
Punkt3D& operator+=(const Punkt3D&);
Punkt3D& operator-=(const Punkt3D&);
Punkt3D operator+(const float&);
Punkt3D operator-(const float&);
Punkt3D operator*(const float&);
Punkt3D operator/(const float&);
Punkt3D& operator+=(const float&);
Punkt3D& operator-=(const float&);
Punkt3D& operator*=(const float&);
Punkt3D& operator/=(const float&);
float operator*(const Punkt3D&);
Punkt3D operator-();
bool operator==(const Punkt3D&);
bool operator!=(const Punkt3D&);
friend Punkt3D operator+(const float&, const Punkt3D&);
friend Punkt3D operator-(const float&, const Punkt3D&);
friend Punkt3D operator*(const float&, const Punkt3D&);
friend Punkt3D operator/(const float&, const Punkt3D&);
};
float abs(Punkt3D);
// OpenGL-Funktionen für Punkt3D
void glVertex3f(Punkt3D);
void glTranslatef(Punkt3D);
void glNormal3f(Punkt3D);
void glRotatef(float, Punkt3D);
#endif