#include <cmath>#include "astro.h"#include "octree.h"Include dependency graph for octree.cpp:

Go to the source code of this file.
Enumerations | |
| enum | { XPos = 1, YPos = 2, ZPos = 4 } |
Functions | |
| static int | childIndex (const Star &star, const Point3f ¢er) |
| bool | starOrbitStraddlesNodes (const Star &star, const Point3f ¢er) |
Variables | |
| static const unsigned int | splitThreshold = 100 |
| static const float | sqrt3 = 1.732050808f |
|
|
Definition at line 33 of file octree.cpp.
|
|
||||||||||||
|
Definition at line 69 of file octree.cpp. References Point3< T >::x, XPos, Point3< T >::y, YPos, Point3< T >::z, and ZPos. 00070 {
00071 Point3f pos = star.getPosition();
00072
00073 int child = 0;
00074 child |= pos.x < center.x ? 0 : XPos;
00075 child |= pos.y < center.y ? 0 : YPos;
00076 child |= pos.z < center.z ? 0 : ZPos;
00077
00078 return child;
00079 }
|
|
||||||||||||
|
Definition at line 83 of file octree.cpp. References abs(), Point3< T >::x, Point3< T >::y, and Point3< T >::z. 00084 {
00085 float orbitalRadius = star.getOrbitalRadius();
00086 if (orbitalRadius == 0.0f)
00087 return false;
00088
00089 Point3f starPos = star.getPosition();
00090 return (abs(starPos.x - center.x) < orbitalRadius ||
00091 abs(starPos.y - center.y) < orbitalRadius ||
00092 abs(starPos.z - center.z) < orbitalRadius);
00093 }
|
|
|
Definition at line 46 of file octree.cpp. |
|
|
Definition at line 48 of file octree.cpp. |
1.4.1