Guest User

Untitled

a guest
Jul 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. template <class U>
  2. dimension2d<T>& operator=(const dimension2d<U>& other)
  3. {
  4. Width = (T) other.Width;
  5. Height = (T) other.Height;
  6. return *this;
  7. }
  8.  
  9. r = engine->RegisterObjectMethod("dimension2f", "bool opEquals(const dimension2f &in) const", asFUNCTIONPR(operator==, (dimension2df&), bool),asCALL_CDECL_OBJFIRST); assert(r >= 0);
  10.  
  11. E:pbmain.cpp|295|error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(irr::core::dimension2df&)'|
  12.  
  13. struct Vector3
  14. {
  15. Vector3();
  16. Vector3(const Vector3 &other);
  17. Vector3(float x, float y, float z);
  18.  
  19. Vector3 &operator=(const Vector3 &other);
  20. Vector3 &operator+=(const Vector3 &other);
  21. Vector3 &operator-=(const Vector3 &other);
  22. Vector3 &operator*=(float scalar);
  23. Vector3 &operator/=(float scalar);
  24.  
  25. friend bool operator==(const Vector3 &a, const Vector3 &b);
  26. friend bool operator!=(const Vector3 &a, const Vector3 &b);
  27. friend Vector3 operator+(const Vector3 &a, const Vector3 &b);
  28. friend Vector3 operator-(const Vector3 &a, const Vector3 &b);
  29. friend Vector3 operator*(float s, const Vector3 &v);
  30. friend Vector3 operator*(const Vector3 &v, float s);
  31. friend Vector3 operator/(const Vector3 &v, float s);
  32.  
  33. float x;
  34. float y;
  35. float z;
  36. };
  37.  
  38. r = engine->RegisterObjectMethod("vector3", "bool opEquals(const vector3 &in) const", asFUNCTIONPR(operator==, (const Vector3&, const Vector3&), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );
  39.  
  40. r = engine->RegisterObjectMethod("dimension2f", "bool opEquals(const dimension2f &in) const", asMETHODPR(dimension2df, operator==, (const dimension2df&) const, bool),asCALL_THISCALL); assert(r >= 0);
Add Comment
Please, Sign In to add comment