示例#1
0
Octree* Octree::get(float x, float y, float z) {
    OcPoint p = OcPoint(x,y,z);
    if ( ! p.inBox(center, size) ) {
        return parent == 0 ? 0 : parent->get(x,y,z);
    }

    if (size > resolution) {
        int o = getOctant(p);
        if (children[o] == 0) return this;
        return children[o]->get(x,y,z);
    }

    return this;
}
示例#2
0
OcPoint OcPoint::sub(OcPoint p) {
    return OcPoint(x - p.x, y - p.y, z - p.z);
}
示例#3
0
OcPoint OcPoint::add(OcPoint p) {
    return OcPoint(x + p.x, y + p.y, z + p.z);
}
示例#4
0
OcPoint OcPoint::mult(float a) {
    return OcPoint(x*a, y*a, z*a);
}
示例#5
0
vector<void*> Octree::radiusSearch(float x, float y, float z, float r) {
    return radiusSearch(OcPoint(x,y,z), r);
}
示例#6
0
void Octree::add(float x, float y, float z, void* data, int maxjump) {
    add(OcPoint(x,y,z), data, maxjump);
}
示例#7
0
文件: env.cpp 项目: bcace/ochre
void OcEnv::SetCursorRay(double *r) {
	env.mouseRay = OcBox(OcPoint(r[0], r[1], r[2]), OcPoint(r[3], r[4], r[5]));
}