Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
how to change Box3d size

boxbee
Registered User
Quote
2013-01-13 00:21:13

I am testing for a collision between two objects. I can get the collision to work, but the issue is that the size of the BoundingBox seems to be a pinpoint size. Can I change the size of the BoundingBox? I want the objects to collide even if the edges collide...

function collisionTest() {
player.updateAbsolutePosition();
boxnode2.updateAbsolutePosition();

var playerBB = player.getTransformedBoundingBox();
var boxnode2BB = boxnode2.getTransformedBoundingBox();

if (playerBB.intersectsWithBox(boxnode2BB))
alert('collision');
}



boxbee
Registered User
Quote
2013-01-14 20:59:29

I figured it out... I was getting a handle to the Transformed Bounding Box and trying to change the size from that. You need to make sure you get a handle to the Bounding Box.


This is what I did:

yourObject.getBoundingBox(new CL3D.Box3d()).MaxEdge = new CL3D.Vect3d(5,5,5);



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact