Oriented box coordinates for scene object
Shri

Gio,

 

I was wondering if there is a wade call that returns the world coordiates of the oriented 'box' which is used to check for collisions.

 

In the wade documentation, there are some 'wade.box...'  calls, but I don't see anything under the

scene object or the spirte where I can call sceneObject.getOrientedBox ?

 

I know it can be calculated using position, size and rotation, but I was wondering if there is a call already. You must be doing something like this in the engine for getOverlapping objects.

 

thanks,

Shri

1 Comment
Gio

Hi Shri

 

Sprites have a public property orientedBoundingBox. Note that it's a property of Sprite and not SceneObject. I think that's what you want to use. So for example:

console.log(mySprite.orientedBoundingBox);

I think it may be missing from the documentation, so I'll try to get it added asap.

 

And I'll take this opportunity to mention that you can see the orientedBoundingBox of sprites using a built-in draw function:

sprite.setDrawFunction(wade.drawFunctions.boundingBox_());

You can change colors, but by default this draws the axis-aligned bounding box in red and the oriented bounding box in blue (iirc).

Post a reply
Add Attachment
Submit Reply
Login to Reply