32
32
META_Node(osg, ProxyNode);
34
typedef osg::BoundingSphere::vec_type vec_type;
35
typedef osg::BoundingSphere::value_type value_type;
34
37
virtual void traverse(NodeVisitor& nv);
36
39
virtual bool addChild(Node *child);
62
65
/** Get how the center of object should be determined when computed which child is active.*/
63
66
CenterMode getCenterMode() const { return _centerMode; }
68
/** Modes which control how the proxynode external reference are loaded.*/
69
enum LoadingExternalReferenceMode
72
DEFER_LOADING_TO_DATABASE_PAGER,
76
/** Set how the child loading is done.*/
77
void setLoadingExternalReferenceMode(LoadingExternalReferenceMode mode) { _loadingExtReference=mode; }
79
/** Get the setted mode of loading.*/
80
LoadingExternalReferenceMode getLoadingExternalReferenceMode() const { return _loadingExtReference; }
65
82
/** Sets the object-space point which defines the center of the osg::ProxyNode.
66
83
center is affected by any transforms in the hierarchy above the osg::ProxyNode.*/
67
84
inline void setCenter(const Vec3& center) { _centerMode=USER_DEFINED_CENTER; _userDefinedCenter = center; }
69
86
/** return the ProxyNode center point. */
70
inline const Vec3& getCenter() const { if (_centerMode==USER_DEFINED_CENTER) return _userDefinedCenter; else return getBound().center(); }
87
inline const vec_type& getCenter() const { if (_centerMode==USER_DEFINED_CENTER) return _userDefinedCenter; else return getBound().center(); }
73
90
/** Set the object-space reference radius of the volume enclosed by the ProxyNode.
74
* Used to detmine the bounding sphere of the ProxyNode in the absense of any children.*/
75
inline void setRadius(float radius) { _radius = radius; }
91
* Used to determine the bounding sphere of the ProxyNode in the absence of any children.*/
92
inline void setRadius(value_type radius) { _radius = radius; }
77
94
/** Get the object-space radius of the volume enclosed by the ProxyNode.*/
78
inline float getRadius() const { return _radius; }
95
inline value_type getRadius() const { return _radius; }
80
97
virtual BoundingSphere computeBound() const;