コード例 #1
0
GLC_RepFlyMover::GLC_RepFlyMover(GLC_Viewport* pViewport)
: GLC_RepMover(pViewport)
, m_Radius(0.06)
, m_CenterCircle()
, m_Plane()
, m_Hud()
, m_HudOffset(m_Radius * 5.0, m_Radius * 5.3)
{

	createRepresentation();
}
コード例 #2
0
ファイル: mesh_navmesh.c プロジェクト: BHCLL/blendocv
static int create_navmesh_exec(bContext *C, wmOperator *op)
{
	Scene* scene= CTX_data_scene(C);
	LinkNode* obs= NULL;
	Base* navmeshBase= NULL;

	CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
		if (base->object->type == OB_MESH) {
			if (base->object->body_type==OB_BODY_TYPE_NAVMESH) {
				if (!navmeshBase || base == scene->basact) {
					navmeshBase= base;
				}
			}
			else {
				BLI_linklist_append(&obs, (void*)base->object);
			}
		}
	}
	CTX_DATA_END;

	if (obs) {
		struct recast_polyMesh *pmesh= NULL;
		struct recast_polyMeshDetail *dmesh= NULL;

		int nverts= 0, ntris= 0;
		int *tris= 0;
		float *verts= NULL;

		createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris);
		BLI_linklist_free(obs, NULL);
		buildNavMesh(&scene->gm.recastData, nverts, verts, ntris, tris, &pmesh, &dmesh);
		createRepresentation(C, pmesh, dmesh, navmeshBase);

		MEM_freeN(verts);
		MEM_freeN(tris);

		return OPERATOR_FINISHED;
	}
	else {
		BKE_report(op->reports, RPT_ERROR, "No mesh objects found");

		return OPERATOR_CANCELLED;
	}
}