#import <CC3UtilityMeshNodes.h>
Instance Methods | |
(void) | - updateFromParentBoundingBox |
Additional Inherited Members | |
Class Methods inherited from CC3LocalContentNode | |
(ccColor4F) | + localContentWireframeBoxColor |
(void) | + setLocalContentWireframeBoxColor: |
CC3WireframeBoundingBoxNode is a type of CC3LineNode specialized for drawing a wireframe bounding box around another node.
A CC3WireframeBoundingBoxNode is typically added as a child node to the node whose bounding box is to be displayed.
The CC3WireframeBoundingBoxNode node can be set to automatically track the dynamic nature of the boundingBox of the parent node by setting the shouldAlwaysMeasureParentBoundingBox property to YES.
Since we don't want to add descriptor labels or wireframe boxes to wireframe nodes, the shouldDrawDescriptor, shouldDrawWireframeBox, and shouldDrawLocalContentWireframeBox properties are overridden to do nothing when set, and to always return YES.
Similarly, CC3WireframeBoundingBoxNode node does not participate in calculating the bounding box of the node whose bounding box it is drawing, since, as a child of that node, it would interfere with accurate measurement of the bounding box.
The shouldIncludeInDeepCopy property returns NO, so that the CC3WireframeBoundingBoxNode will not be copied when the parent node is copied. A bounding box node for the copy will be created automatically when each of the shouldDrawLocalContentWireframeBox and shouldDrawWireframeBox properties are copied, if they are set to YES on the original node that is copied.
A CC3WireframeBoundingBoxNode will continue to be visible even when its ancestor nodes are invisible, unless the CC3WireframeBoundingBoxNode itself is made invisible.
- (void) updateFromParentBoundingBox |
Updates this wireframe box from the bounding box of the parent node.
The extent of the wireframe box is usually set automatically when first created, and is not automatically updated if the parent bounding box changes. If you want this wireframe to update automatically on each update frame, set the shouldAlwaysMeasureParentBoundingBox property to YES.
However, updating on each frame can be a drag on performance, so if the parent bounding box changes under app control, you can invoke this method whenever the bounding box of the parent node changes to keep the wireframe box synchronized with its parent.
|
readwritenonatomicassign |
Indicates whether the dimensions of this node should automatically be remeasured on each update pass.
If this property is set to YES, the box will automatically be resized to account for movements by any descendant nodes of the parent node. For bounding box nodes that track the overall boundingBox of a parent node, this property should be set to YES.
It is not necessary to set this property to YES to account for changes in the transform properties of the parent node itself, or if this node is tracking the bounding box of local content of the parent node. Generally, changes to that will automatically be handled by the transform updates.
When setting this property, be aware that measuring the bounding box of the parent node can be an expensive operation.
The initial value of this property is NO.