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.

ugeentityaxes.cpp 946B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "ugeentityaxes.h"
  2. UGEEntityAxes::UGEEntityAxes(UGameEngine *engine, QObject *parent) :
  3. UGEEntity(engine, parent)
  4. {
  5. init();
  6. }
  7. UGEEntityAxes::UGEEntityAxes(UGameEngine *engine) :
  8. UGEEntity(engine)
  9. {
  10. init();
  11. }
  12. void UGEEntityAxes::onDraw(AbstractRenderDevice *device)
  13. {
  14. drawLine(device, ColorVector3D(Qt::red, 0.0, 0.0, 0.0), ColorVector3D(Qt::red, _size, 0.0, 0.0), 2.5);
  15. drawLine(device, ColorVector3D(Qt::green, 0.0, 0.0, 0.0), ColorVector3D(Qt::green, 0.0, _size, 0.0), 2.5);
  16. drawLine(device, ColorVector3D(Qt::blue, 0.0, 0.0, 0.0), ColorVector3D(Qt::blue, 0.0, 0.0, _size), 2.5);
  17. }
  18. Vector3D UGEEntityAxes::getVectorNearestIntesection(const Vector3D &vector, const Vector3D &pos, bool *ok)
  19. {
  20. *ok = false;
  21. return Vector3D();
  22. }
  23. double UGEEntityAxes::size() const
  24. {
  25. return _size;
  26. }
  27. void UGEEntityAxes::setSize(double size)
  28. {
  29. _size = size;
  30. }
  31. void UGEEntityAxes::init()
  32. {
  33. _size = 1.0;
  34. }