本文整理汇总了C++中LLPanelVolume类的典型用法代码示例。如果您正苦于以下问题:C++ LLPanelVolume类的具体用法?C++ LLPanelVolume怎么用?C++ LLPanelVolume使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLPanelVolume类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCommitFlexible
// static
void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLViewerObject* objectp = self->mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
if (attributes)
{
LLFlexibleObjectData new_attributes;
new_attributes = *attributes;
new_attributes.setSimulateLOD(self->getChild<LLUICtrl>("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get());
new_attributes.setGravity((F32)self->getChild<LLUICtrl>("FlexGravity")->getValue().asReal());
new_attributes.setTension((F32)self->getChild<LLUICtrl>("FlexTension")->getValue().asReal());
new_attributes.setAirFriction((F32)self->getChild<LLUICtrl>("FlexFriction")->getValue().asReal());
new_attributes.setWindSensitivity((F32)self->getChild<LLUICtrl>("FlexWind")->getValue().asReal());
F32 fx = (F32)self->getChild<LLUICtrl>("FlexForceX")->getValue().asReal();
F32 fy = (F32)self->getChild<LLUICtrl>("FlexForceY")->getValue().asReal();
F32 fz = (F32)self->getChild<LLUICtrl>("FlexForceZ")->getValue().asReal();
LLVector3 force(fx,fy,fz);
new_attributes.setUserForce(force);
objectp->setParameterEntry(LLNetworkData::PARAMS_FLEXIBLE, new_attributes, true);
}
// Values may fail validation
self->refresh();
}
示例2: onCommitLight
// static
void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLViewerObject* objectp = self->mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume *volobjp = (LLVOVolume *)objectp;
volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal());
volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal());
volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal());
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LLColor4 clr = LightColorSwatch->get();
volobjp->setLightColor(LLColor3(clr));
}
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
if(LightTextureCtrl)
{
LLUUID id = LightTextureCtrl->getImageAssetID();
if (id.notNull())
{
if (!volobjp->isLightSpotlight())
{ //this commit is making this a spot light, set UI to default params
volobjp->setLightTextureID(id);
LLVector3 spot_params = volobjp->getSpotLightParams();
self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]);
self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]);
self->getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]);
}
else
{ //modifying existing params
LLVector3 spot_params;
spot_params.mV[0] = (F32) self->getChild<LLUICtrl>("Light FOV")->getValue().asReal();
spot_params.mV[1] = (F32) self->getChild<LLUICtrl>("Light Focus")->getValue().asReal();
spot_params.mV[2] = (F32) self->getChild<LLUICtrl>("Light Ambiance")->getValue().asReal();
volobjp->setSpotLightParams(spot_params);
}
}
else if (volobjp->isLightSpotlight())
{ //no longer a spot light
volobjp->setLightTextureID(id);
//self->getChildView("Light FOV")->setEnabled(FALSE);
//self->getChildView("Light Focus")->setEnabled(FALSE);
//self->getChildView("Light Ambiance")->setEnabled(FALSE);
}
}
}
示例3: onCommitLight
// static
void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLViewerObject* objectp = self->mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume *volobjp = (LLVOVolume *)objectp;
volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal());
volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal());
volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal());
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LLColor4 clr = LightColorSwatch->get();
volobjp->setLightColor(LLColor3(clr));
}
}
示例4: onCommitIsLight
// static
void LLPanelVolume::onCommitIsLight( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
self->sendIsLight();
}