How to get the bounding box coordinates of an object in script?


#1

Hey anybody knows that if there is any method to get the bounding box coordinates of an object (equivalent to “bound_box” in blender python)?

Currently I can only get the Dimensions of an object. Since the object origin is not necessarily the geometry center of the object, there is no simple way to get the bounding box coordinates (I want to use them to do some physics calculation). I have to calculate them with all vertices for now, which obviously is not a good solution.

Also why shape is set to private in armory.trait.physics.bullet.RigidBody?


#2

You can use transform and dim

something like

  var t1 = object.transform;
  var d1 = t1.dim;
  trace(" >>>>>>  dim = "+ d1)