1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2011 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
30 #ifndef _OSGINTERSECTKDTREENODE_H_
31 #define _OSGINTERSECTKDTREENODE_H_
33 #include "OSGConfig.h"
34 #include "OSGDrawableDef.h"
35 #include "OSGBaseTypes.h"
39 class OSG_DRAWABLE_DLLMAPPING IntersectKDTreeNode
50 void setLeaf (UInt32 triCount
, UInt32 triOffset
);
51 void setInterior(FlagsE axis
, UInt32 childOffset
, Real32 split
);
53 bool isLeaf (void) const;
55 UInt32
getChildOffset(void) const;
56 UInt32
getSplitAxis (void) const;
57 Real32
getSplit (void) const;
59 UInt32
getTriCount (void) const;
60 UInt32
getTriOffset (void) const;
64 UInt32 _flags
: 2; // both
65 UInt32 _count
: 30; // child offset / tri count
69 UInt32 _triOffset
; // leaf, triangle indices start
70 Real32 _split
; // interior, split position
74 OSG_DRAWABLE_DLLMAPPING
bool
75 operator==(const IntersectKDTreeNode
&lhs
, const IntersectKDTreeNode
&rhs
);
79 #include "OSGIntersectKDTreeNode.inl"
81 #endif /* _OSGINTERSECTKDTREENODE_H_ */