| 277 | } |
| 278 | |
| 279 | PyObject* VectorPy::add(PyObject* args) const |
| 280 | { |
| 281 | PyObject* obj = nullptr; |
| 282 | if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) { |
| 283 | return nullptr; |
| 284 | } |
| 285 | |
| 286 | VectorPy* vec = static_cast<VectorPy*>(obj); |
| 287 | |
| 288 | VectorPy::PointerType this_ptr = getVectorPtr(); |
| 289 | VectorPy::PointerType vect_ptr = vec->getVectorPtr(); |
| 290 | |
| 291 | Vector3d v = (*this_ptr) + (*vect_ptr); |
| 292 | return new VectorPy(v); |
| 293 | } |
| 294 | |
| 295 | PyObject* VectorPy::sub(PyObject* args) const |
| 296 | { |