Open topic with navigation
<node3d>.collideBox
Creates a physics shape around the node
<node3d>.collideBox( |
|
[width,height,depth] |
node = '' |
) |
|
[width,height,depth]
The size of the box
node = ''
Subnode to use for auto-calculating bounding box.
Remarks
Creates a VizPhysicsShape that collides as if there was a bounding box around the node. With default arguments, the bounding box is a close fitting as possible while preserving the box shape. You can encode the dimensions of the box if you fill in the x, y, and z parameters. It also possible to include keyword arguments for the VizPhysicsShape object's material properties: friction, density, hardness, bounce.
Return Value
VizPhysicsShape object
Example
viz.phys.enable()
box = viz.add('box.wrl')
boxCollideShape = box.collideBox()
boxCollideShape.density = .5
#Create a collideBox surrounding a child node
table = viz.add( 'table.wrl' )
table.collideBox( node = 'Top', hardness = .5 )
See also