本文整理汇总了C++中Avatar类的典型用法代码示例。如果您正苦于以下问题:C++ Avatar类的具体用法?C++ Avatar怎么用?C++ Avatar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Avatar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: warn
void AvatarManager::updateOtherAvatars(float deltaTime) {
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
PerformanceWarning warn(showWarnings, "Application::updateAvatars()");
Application* applicationInstance = Application::getInstance();
glm::vec3 mouseOrigin = applicationInstance->getMouseRayOrigin();
glm::vec3 mouseDirection = applicationInstance->getMouseRayDirection();
// simulate avatars
AvatarHash::iterator avatarIterator = _avatarHash.begin();
while (avatarIterator != _avatarHash.end()) {
Avatar* avatar = static_cast<Avatar*>(avatarIterator.value().data());
if (avatar == static_cast<Avatar*>(_myAvatar.data())) {
// DO NOT update _myAvatar! Its update has already been done earlier in the main loop.
//updateMyAvatar(deltaTime);
++avatarIterator;
continue;
}
if (avatar->getOwningAvatarMixer()) {
// this avatar's mixer is still around, go ahead and simulate it
avatar->simulate(deltaTime);
avatar->setMouseRay(mouseOrigin, mouseDirection);
++avatarIterator;
} else {
// the mixer that owned this avatar is gone, give it to the vector of fades and kill it
avatarIterator = erase(avatarIterator);
}
}
// simulate avatar fades
simulateAvatarFades(deltaTime);
}
示例2: warn
void AvatarManager::updateOtherAvatars(float deltaTime) {
if (_avatarHash.size() < 2 && _avatarFades.isEmpty()) {
return;
}
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
PerformanceWarning warn(showWarnings, "Application::updateAvatars()");
PerformanceTimer perfTimer("otherAvatars");
// simulate avatars
AvatarHash::iterator avatarIterator = _avatarHash.begin();
while (avatarIterator != _avatarHash.end()) {
AvatarSharedPointer sharedAvatar = avatarIterator.value();
Avatar* avatar = reinterpret_cast<Avatar*>(sharedAvatar.data());
if (sharedAvatar == _myAvatar || !avatar->isInitialized()) {
// DO NOT update _myAvatar! Its update has already been done earlier in the main loop.
// DO NOT update uninitialized Avatars
++avatarIterator;
continue;
}
if (!shouldKillAvatar(sharedAvatar)) {
// this avatar's mixer is still around, go ahead and simulate it
avatar->simulate(deltaTime);
++avatarIterator;
} else {
// the mixer that owned this avatar is gone, give it to the vector of fades and kill it
avatarIterator = erase(avatarIterator);
}
}
// simulate avatar fades
simulateAvatarFades(deltaTime);
}
示例3: OLD_SKELETON_MODEL_TRANSLATION
void FaceModel::simulate(float deltaTime) {
if (!isActive()) {
return;
}
Avatar* owningAvatar = static_cast<Avatar*>(_owningHead->_owningAvatar);
glm::vec3 neckPosition;
glm::vec3 modelTranslation;
if (!owningAvatar->getSkeletonModel().getNeckPosition(neckPosition)) {
neckPosition = owningAvatar->getSkeleton().joint[AVATAR_JOINT_NECK_BASE].position;
const glm::vec3 OLD_SKELETON_MODEL_TRANSLATION(0.0f, -60.0f, 40.0f);
modelTranslation = OLD_SKELETON_MODEL_TRANSLATION;
}
setTranslation(neckPosition);
glm::quat neckRotation;
if (!owningAvatar->getSkeletonModel().getNeckRotation(neckRotation)) {
neckRotation = owningAvatar->getSkeleton().joint[AVATAR_JOINT_NECK_BASE].absoluteRotation *
glm::angleAxis(180.0f, 0.0f, 1.0f, 0.0f);
}
setRotation(neckRotation);
const float MODEL_SCALE = 0.0006f;
setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningHead->getScale() * MODEL_SCALE);
setOffset(modelTranslation - _geometry->getFBXGeometry().neckPivot);
setPupilDilation(_owningHead->getPupilDilation());
setBlendshapeCoefficients(_owningHead->getBlendshapeCoefficients());
Model::simulate(deltaTime);
}
示例4: Avatar_SetName_String
static duk_ret_t Avatar_SetName_String(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
String name = duk_require_string(ctx, 0);
thisObj->SetName(name);
return 0;
}
示例5: Avatar_SetTemporary_bool
static duk_ret_t Avatar_SetTemporary_bool(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
bool enable = duk_require_boolean(ctx, 0);
thisObj->SetTemporary(enable);
return 0;
}
示例6: Avatar_Id
static duk_ret_t Avatar_Id(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
component_id_t ret = thisObj->Id();
duk_push_number(ctx, ret);
return 1;
}
示例7: Avatar_SetUpdateMode_AttributeChange__Type
static duk_ret_t Avatar_SetUpdateMode_AttributeChange__Type(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
AttributeChange::Type defaultmode = (AttributeChange::Type)(int)duk_require_number(ctx, 0);
thisObj->SetUpdateMode(defaultmode);
return 0;
}
示例8: Avatar_UpdateMode
static duk_ret_t Avatar_UpdateMode(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
AttributeChange::Type ret = thisObj->UpdateMode();
duk_push_number(ctx, ret);
return 1;
}
示例9: Avatar_NumStaticAttributes
static duk_ret_t Avatar_NumStaticAttributes(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
int ret = thisObj->NumStaticAttributes();
duk_push_number(ctx, ret);
return 1;
}
示例10: Avatar_IsUnacked
static duk_ret_t Avatar_IsUnacked(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
bool ret = thisObj->IsUnacked();
duk_push_boolean(ctx, ret);
return 1;
}
示例11: Avatar_SetParentEntity_Entity
static duk_ret_t Avatar_SetParentEntity_Entity(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
Entity* entity = GetWeakObject<Entity>(ctx, 0);
thisObj->SetParentEntity(entity);
return 0;
}
示例12: updateGeometry
void FaceModel::simulate(float deltaTime, bool fullUpdate) {
updateGeometry();
Avatar* owningAvatar = static_cast<Avatar*>(_owningHead->_owningAvatar);
glm::vec3 neckPosition;
if (!owningAvatar->getSkeletonModel().getNeckPosition(neckPosition)) {
neckPosition = owningAvatar->getPosition();
}
setTranslation(neckPosition);
glm::quat neckParentRotation;
if (!owningAvatar->getSkeletonModel().getNeckParentRotationFromDefaultOrientation(neckParentRotation)) {
neckParentRotation = owningAvatar->getOrientation();
}
setRotation(neckParentRotation);
setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningHead->getScale());
setPupilDilation(_owningHead->getPupilDilation());
setBlendshapeCoefficients(_owningHead->getBlendshapeCoefficients());
// FIXME - this is very expensive, we shouldn't do it if we don't have to
//invalidCalculatedMeshBoxes();
if (isActive()) {
setOffset(-_geometry->getFBXGeometry().neckPivot);
Model::simulateInternal(deltaTime);
}
}
示例13: Avatar_Name
static duk_ret_t Avatar_Name(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
const String & ret = thisObj->Name();
duk_push_string(ctx, ret.CString());
return 1;
}
示例14: Avatar_ComponentChanged_AttributeChange__Type
static duk_ret_t Avatar_ComponentChanged_AttributeChange__Type(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
AttributeChange::Type change = (AttributeChange::Type)(int)duk_require_number(ctx, 0);
thisObj->ComponentChanged(change);
return 0;
}
示例15: Avatar_AvatarDesc
static duk_ret_t Avatar_AvatarDesc(duk_context* ctx)
{
Avatar* thisObj = GetThisWeakObject<Avatar>(ctx);
AvatarDescAssetPtr ret = thisObj->AvatarDesc();
PushWeakObject(ctx, ret.Get());
return 1;
}