IgeEntity

Method: aabb

Calculates and returns the current axis-aligned bounding box in world co-ordinates.
aabb (Boolean recalculate)
  • Booleanrecalculate If true this will force the recalculation of the AABB instead of returning a cached value.
Returns IgeRect The axis-aligned bounding box in world co-ordinates.

Get the entity axis-aligned bounding box dimensions

var aabb = entity.aabb();

console.log(aabb.x);
console.log(aabb.y);
console.log(aabb.width);
console.log(aabb.height);

Get the entity axis-aligned bounding box dimensions forcing the engine to update the values first

var aabb = entity.aabb(true); // Call with true to force update

console.log(aabb.x);
console.log(aabb.y);
console.log(aabb.width);
console.log(aabb.height);
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point