//------------------------------------------------------------------------------ void ShadowVolumeBSP::buildPolyVolume(SVPoly * poly, LightInfo * light) { if(light->getType() != LightInfo::Vector) return; // build the poly Point3F pointOffset = light->getDirection() * 10.f; // create the shadow volume mShadowVolumes.increment(); SVNode ** traverse = &mShadowVolumes.last(); U32 shadowVolumeIndex = mShadowVolumes.size() - 1; for(U32 i = 0; i < poly->mWindingCount; i++) { U32 j = (i + 1) % poly->mWindingCount; if(poly->mWinding[i] == poly->mWinding[j]) continue; (*traverse) = createNode(); Point3F & a = poly->mWinding[i]; Point3F & b = poly->mWinding[j]; Point3F c = b + pointOffset; (*traverse)->mPlaneIndex = insertPlane(PlaneF(a,b,c)); (*traverse)->mShadowVolume = shadowVolumeIndex; traverse = &(*traverse)->mFront; } // do the poly node (*traverse) = createNode(); (*traverse)->mPlaneIndex = insertPlane(poly->mPlane); (*traverse)->mShadowVolume = poly->mShadowVolume = shadowVolumeIndex; }
bool CObjTreePlugin::srvInsertPlane(srs_env_model::InsertPlane::Request &req, srs_env_model::InsertPlane::Response &res) { res.object_id = insertPlane(req.plane, INSERT); showObject(res.object_id); return true; }
bool CObjTreePlugin::srvInsertPlaneByPosition(srs_env_model::InsertPlane::Request &req, srs_env_model::InsertPlane::Response &res) { if(m_octree.removeObject(req.plane.id)) removePrimitiveMarker(req.plane.id); res.object_id = insertPlane(req.plane, UPDATE); if((unsigned int)req.plane.id != res.object_id) removePrimitiveMarker(res.object_id); showObject(res.object_id); return true; }
bool CObjTreePlugin::srvInsertPlanes(srs_env_model::InsertPlanes::Request &req, srs_env_model::InsertPlanes::Response &res) { std::vector<srs_env_model_msgs::PlaneDesc>::iterator i; std::vector<srs_env_model_msgs::PlaneDesc> &planes(req.plane_array.planes); for(i = planes.begin(); i != planes.end(); i++) { unsigned int id = insertPlane(*i, INSERT); res.object_ids.push_back(id); showObject(id); } return true; }
bool CObjTreePlugin::srvGetSimilarPlane(srs_env_model::InsertPlane::Request &req, srs_env_model::InsertPlane::Response &res) { res.object_id = insertPlane(req.plane, GET_SIMILAR); return true; }
U32 OptimizedPolyList::addPlane(const PlaneF& plane) { return insertPlane(plane); }