Exposed vector negative to python
This commit is contained in:
parent
cb789a25d8
commit
a81c16c391
|
@ -32,6 +32,13 @@
|
|||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="negative" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>negative()
|
||||
returns the negative (opposite) of this vector
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="scale">
|
||||
<Documentation>
|
||||
<UserDocu>scale(Float,Float,Float)
|
||||
|
|
|
@ -215,6 +215,16 @@ PyObject* VectorPy::sub(PyObject *args)
|
|||
return new VectorPy(v);
|
||||
}
|
||||
|
||||
PyObject* VectorPy::negative(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
|
||||
VectorPy::PointerType this_ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
|
||||
Base::Vector3d v = -(*this_ptr);
|
||||
return new VectorPy(v);
|
||||
}
|
||||
|
||||
PyObject* VectorPy::richCompare(PyObject *v, PyObject *w, int op)
|
||||
{
|
||||
if (PyObject_TypeCheck(v, &(VectorPy::Type)) &&
|
||||
|
|
Loading…
Reference in New Issue
Block a user