remove sleep calls, change some for loops to list comp, move isPointOnLine to base vector
This commit is contained in:
@@ -435,6 +435,32 @@ PyObject* VectorPy::cross(PyObject *args)
|
||||
return new VectorPy(v);
|
||||
}
|
||||
|
||||
PyObject* VectorPy::isOnLine(PyObject *args)
|
||||
{
|
||||
PyObject *start, *end;
|
||||
if (!PyArg_ParseTuple(args, "OO",&start, &end))
|
||||
return 0;
|
||||
if (!PyObject_TypeCheck(start, &(VectorPy::Type))) {
|
||||
PyErr_SetString(PyExc_TypeError, "First arg must be Vector");
|
||||
return 0;
|
||||
}
|
||||
if (!PyObject_TypeCheck(end, &(VectorPy::Type))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Second arg must be Vector");
|
||||
return 0;
|
||||
}
|
||||
|
||||
VectorPy* start_vec = static_cast<VectorPy*>(start);
|
||||
VectorPy* end_vec = static_cast<VectorPy*>(end);
|
||||
|
||||
VectorPy::PointerType this_ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
|
||||
VectorPy::PointerType start_ptr = reinterpret_cast<VectorPy::PointerType>(start_vec->_pcTwinPointer);
|
||||
VectorPy::PointerType end_ptr = reinterpret_cast<VectorPy::PointerType>(end_vec->_pcTwinPointer);
|
||||
|
||||
Py::Boolean result = this_ptr->IsOnLine(*start_ptr, *end_ptr);
|
||||
|
||||
return Py::new_reference_to(result);
|
||||
}
|
||||
|
||||
PyObject* VectorPy::getAngle(PyObject *args)
|
||||
{
|
||||
PyObject *obj;
|
||||
|
||||
Reference in New Issue
Block a user