本文整理汇总了C++中LLJoint::getWorldPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LLJoint::getWorldPosition方法的具体用法?C++ LLJoint::getWorldPosition怎么用?C++ LLJoint::getWorldPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLJoint
的用法示例。
在下文中一共展示了LLJoint::getWorldPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void lljoint_object::test<6>()
{
LLJoint lljoint;
LLVector3 vec3(2.3f,30.f,10.f);
lljoint.setWorldPosition(vec3);
LLVector3 pos = lljoint.getWorldPosition();
ensure("1:setWorldPosition()/getWorldPosition() failed ", (vec3 == pos));
LLVector3 lastPos = lljoint.getLastWorldPosition();
ensure("2:getLastWorldPosition failed ", (vec3 == lastPos));
}
示例2: calculateVelocity_local
F32 LLPhysicsMotion::calculateVelocity_local()
{
const F32 world_to_model_scale = 100.0f;
LLJoint *joint = mJointState->getJoint();
const LLVector3 position_world = joint->getWorldPosition();
const LLVector3 last_position_world = mPosition_world;
const LLVector3 positionchange_world = (position_world-last_position_world) * world_to_model_scale;
const LLVector3 velocity_world = positionchange_world;
const F32 velocity_local = toLocal(velocity_world);
return velocity_local;
}
示例3: onUpdate
//.........这里部分代码省略.........
const F32 position_new_local_clamped = llclamp(position_new_local,
0.0f,
1.0f);
LLDriverParam *driver_param = dynamic_cast<LLDriverParam *>(mParamDriver);
llassert_always(driver_param);
if (driver_param)
{
// If this is one of our "hidden" driver params, then make sure it's
// the default value.
if ((driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
(driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT))
{
mCharacter->setVisualParamWeight(driver_param,
0,
FALSE);
}
for (LLDriverParam::entry_list_t::iterator iter = driver_param->mDriven.begin();
iter != driver_param->mDriven.end();
++iter)
{
LLDrivenEntry &entry = (*iter);
LLViewerVisualParam *driven_param = entry.mParam;
setParamValue(driven_param,position_new_local_clamped, behavior_maxeffect);
}
}
//
// End calculate new params
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Conditionally update the visual params
//
// Updating the visual params (i.e. what the user sees) is fairly expensive.
// So only update if the params have changed enough, and also take into account
// the graphics LOD settings.
// For non-self, if the avatar is small enough visually, then don't update.
const F32 area_for_max_settings = 0.0;
const F32 area_for_min_settings = 1400.0;
const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor);
const F32 pixel_area = (F32)sqrt(mCharacter->getPixelArea());
const BOOL is_self = (dynamic_cast<LLVOAvatar *>(mCharacter) != NULL && ((LLVOAvatar*)mCharacter)->isSelf());
if ((pixel_area > area_for_this_setting) || is_self)
{
const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped);
const F32 min_delta = (1.0001f-lod_factor)*0.4f;
if (llabs(position_diff_local) > min_delta)
{
update_visuals = TRUE;
mPositionLastUpdate_local = position_new_local;
}
}
//
// End update visual params
////////////////////////////////////////////////////////////////////////////////
mVelocity_local = velocity_new_local;
mAccelerationJoint_local = acceleration_joint_local;
mPosition_local = position_new_local;
}
mLastTime = time;
mPosition_world = joint->getWorldPosition();
mVelocityJoint_local = velocity_joint_local;
/*
// Write out debugging info into a spreadsheet.
if (mFileWrite != NULL && is_self)
{
fprintf(mFileWrite,"%f\t%f\t%f \t\t%f \t\t%f\t%f\t%f\t \t\t%f\t%f\t%f\t%f\t%f \t\t%f\t%f\t%f\n",
position_new_local,
velocity_new_local,
acceleration_new_local,
time_delta,
mPosition_world[0],
mPosition_world[1],
mPosition_world[2],
force_net,
force_spring,
force_accel,
force_damping,
force_drag,
spring_length,
velocity_joint_local,
acceleration_joint_local
);
}
*/
return update_visuals;
}