void FSLSLBridge::setupBridgePrim(LLViewerObject* object) { lldebugs << "Entering bridge container setup..." << llendl; LLProfileParams profParams(LL_PCODE_PROFILE_CIRCLE, F32(0.230), F32(0.250), F32(0.95)); LLPathParams pathParams(LL_PCODE_PATH_CIRCLE, F32(0.2), F32(0.22), F32(0.0), F32(350.0), //scale F32(0.0), F32(0.0), //shear F32(0), F32(0), //twist F32(0), //offset F32(0), F32(0.0), //taper F32(0.05), F32(0.05)); //revolutions, skew pathParams.setRevolutions(F32(1.0)); object->setVolume(LLVolumeParams(profParams, pathParams), 0); object->setScale(LLVector3(10.0f, 10.0f, 10.0f), TRUE); for (int i = 0; i < object->getNumTEs(); i++) { LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE ); object->setTEImage(i, image); //transparent texture } object->setChanged(LLXform::MOVED | LLXform::SILHOUETTE | LLXform::TEXTURE); //object->setTETexture(0, LLUUID("29de489d-0491-fb00-7dab-f9e686d31e83")); //another test texture object->sendShapeUpdate(); object->markForUpdate(TRUE); //object->setFlags(FLAGS_TEMPORARY_ON_REZ, true); object->addFlags(FLAGS_TEMPORARY_ON_REZ); object->updateFlags(); lldebugs << "End bridge container setup." << llendl; }
void FSLSLBridge :: setupBridge(LLViewerObject *object) { llinfos << "enter rock change" << llendl; mpBridge->setDescription(mCurrentFullName); LLProfileParams profParams(LL_PCODE_PROFILE_CIRCLE, F32(0.230), F32(0.250), F32(0.95)); LLPathParams pathParams(LL_PCODE_PATH_CIRCLE, F32(0), F32(0.2), F32(0.01), F32(0.01), F32(0.00), F32(0.0), F32(0), F32(0), F32(0), F32(0), F32(0), F32(0.01), 0); object->setVolume(LLVolumeParams(profParams, pathParams), 0); for (int i = 0; i < object->getNumTEs(); i++) { object->setTETexture(i, LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")); //transparent texture } //object->setTETexture(0, LLUUID("29de489d-0491-fb00-7dab-f9e686d31e83")); //another test texture object->setScale(LLVector3(F32(0.01), F32(0.01), F32(0.01))); object->sendShapeUpdate(); object->markForUpdate(TRUE); //object->setFlags(FLAGS_TEMPORARY_ON_REZ, true); object->addFlags(FLAGS_TEMPORARY_ON_REZ); object->updateFlags(); gInventory.updateItem(mpBridge); gInventory.notifyObservers(); llinfos << "end rock change, start script creation" << llendl; //add bridge script to object if (object) { create_script_inner(object); } }
bool Setup() { axis = new Axis(Device); accessSqlite(); //LLProfileParams profileParams = LLProfileParams( // LL_PCODE_PROFILE_SQUARE, //Curve // 0.f, //Begin // 1.0f, //End // 0.0f); //Hollow //LLPathParams pathParams = LLPathParams( // LL_PCODE_PATH_LINE, //curve // 0.f, //begin // 1.0f, //end // 1.f, //scaleX // 1.f, //scaleY // 0.f, //shearX // 0.f, //shearY // 0.f, //twistEnd // 0.f, //twistBegin // 0.f, //radiusOffset // 0.f, //taperX // 0.f, //taperY // 1.f, //revolutions // 0.f); //skew for(int i=0; i<profileParams.size(); i++) { LLVolumeParams volumeParams = LLVolumeParams( profileParams[ i ], pathParams[ i ], 0, //LLUUID LL_SCULPT_TYPE_NONE); LLVolume* volume = new LLVolume( volumeParams, 4.f, //detail false, //generate_single_face FALSE); //is_unique S32 numFaces = volume->getNumFaces(); for(S32 j=0; j<numFaces; j++) { LLVolumeFace volumeFace = volume->getVolumeFace(j); obj.push_back( Object(Device, &volumeFace, positions[i], rotations[i], scales[i])); } } //创建纹理 D3DXCreateTextureFromFile( Device, "testTex.jpg", &Tex); //HRESULT D3DXCreateFont( // Device, //LPDIRECT3DDEVICE9 pDevice, // 50, //INT Height, // 20, //UINT Width, // 500, //UINT Weight, // 0, //UINT MipLevels, // false, //BOOL Italic, // DEFAULT_CHARSET, //DWORD CharSet, // 0, //DWORD OutputPrecision, // 0, //DWORD Quality, // 0, //DWORD PitchAndFamily, // "Arial", //LPCTSTR pFacename, // &font //LPD3DXFONT * ppFont //); //RECT rect = {-1, 0, Width, Height}; /* Set projection matrix */ D3DXMATRIX proj; //正射投影 //D3DXMatrixOrthoLH(&proj, // 5, //width of the view volume // 5, //height of the view volume // 1.0f, //z-near // 1000.f); //z-far //透视投影 D3DXMatrixPerspectiveFovLH( &proj, D3DX_PI * 0.25, (float)Width/(float)Height, 1.0f, 1000.0f); Device->SetTransform(D3DTS_PROJECTION, &proj); return true; }