odeGeom_ext.I 1007 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file odeGeom_ext.I
  10. * @author rdb
  11. * @date 2013-12-11
  12. */
  13. #include "odeSpace_ext.h"
  14. #include "lpoint3.h"
  15. /**
  16. * A more Pythonic way of calling getAABB()
  17. */
  18. INLINE PyObject *Extension<OdeGeom>::
  19. get_AA_bounds() const {
  20. LPoint3f *min_point = new LPoint3f;
  21. LPoint3f *max_point = new LPoint3f;
  22. _this->get_AABB(*min_point, *max_point);
  23. PyObject *min_inst = DTool_CreatePyInstance(min_point, true);
  24. PyObject *max_inst = DTool_CreatePyInstance(max_point, true);
  25. return Py_BuildValue("NN", min_inst, max_inst);
  26. }
  27. /**
  28. * Equivalent to get_space().convert()
  29. */
  30. INLINE PyObject *Extension<OdeGeom>::
  31. get_converted_space() const {
  32. OdeSpace s = _this->get_space();
  33. return invoke_extension(&s).convert();
  34. }