mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Size looking-at-me eye spheres per avatar model dimensions
This commit is contained in:
parent
bed266dfe9
commit
55683e0cd5
3 changed files with 21 additions and 7 deletions
|
@ -469,18 +469,22 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition, boo
|
||||||
float alpha = 1.0f - ((float)(usecTimestampNow() - getHead()->getIsLookingAtMeStarted()))
|
float alpha = 1.0f - ((float)(usecTimestampNow() - getHead()->getIsLookingAtMeStarted()))
|
||||||
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND);
|
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND);
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
float radius = 0.035f;
|
const float RADIUS_INCREMENT = 0.005f;
|
||||||
Transform transform;
|
Transform transform;
|
||||||
|
|
||||||
glm::vec3 position = getHead()->getLeftEyePosition();
|
glm::vec3 position = getHead()->getLeftEyePosition();
|
||||||
transform.setTranslation(position);
|
transform.setTranslation(position);
|
||||||
batch.setModelTransform(transform);
|
batch.setModelTransform(transform);
|
||||||
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(batch, radius, 15, 15,
|
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(batch,
|
||||||
glm::vec4(LOOKING_AT_ME_COLOR, alpha));
|
getHead()->getFaceModel().getGeometry()->getFBXGeometry().leftEyeSize * _scale / 2.0f + RADIUS_INCREMENT,
|
||||||
|
15, 15, glm::vec4(LOOKING_AT_ME_COLOR, alpha));
|
||||||
|
|
||||||
position = getHead()->getRightEyePosition();
|
position = getHead()->getRightEyePosition();
|
||||||
transform.setTranslation(position);
|
transform.setTranslation(position);
|
||||||
batch.setModelTransform(transform);
|
batch.setModelTransform(transform);
|
||||||
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(batch, radius, 15, 15,
|
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(batch,
|
||||||
glm::vec4(LOOKING_AT_ME_COLOR, alpha));
|
getHead()->getFaceModel().getGeometry()->getFBXGeometry().rightEyeSize * _scale / 2.0f + RADIUS_INCREMENT,
|
||||||
|
15, 15, glm::vec4(LOOKING_AT_ME_COLOR, alpha));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2616,10 +2616,17 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping,
|
||||||
buildModelMesh(extracted);
|
buildModelMesh(extracted);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
if (extracted.mesh.isEye) {
|
||||||
|
if (maxJointIndex == geometry.leftEyeJointIndex) {
|
||||||
|
geometry.leftEyeSize = extracted.mesh.meshExtents.largestDimension() * offsetScale;
|
||||||
|
} else {
|
||||||
|
geometry.rightEyeSize = extracted.mesh.meshExtents.largestDimension() * offsetScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
geometry.meshes.append(extracted.mesh);
|
geometry.meshes.append(extracted.mesh);
|
||||||
int meshIndex = geometry.meshes.size() - 1;
|
int meshIndex = geometry.meshes.size() - 1;
|
||||||
meshIDsToMeshIndices.insert(it.key(), meshIndex);
|
meshIDsToMeshIndices.insert(it.key(), meshIndex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now that all joints have been scanned, compute a collision shape for each joint
|
// now that all joints have been scanned, compute a collision shape for each joint
|
||||||
|
|
|
@ -232,7 +232,10 @@ public:
|
||||||
int rightHandJointIndex = -1;
|
int rightHandJointIndex = -1;
|
||||||
int leftToeJointIndex = -1;
|
int leftToeJointIndex = -1;
|
||||||
int rightToeJointIndex = -1;
|
int rightToeJointIndex = -1;
|
||||||
|
|
||||||
|
float leftEyeSize = 0.0f; // Maximum mesh extents dimension
|
||||||
|
float rightEyeSize = 0.0f;
|
||||||
|
|
||||||
QVector<int> humanIKJointIndices;
|
QVector<int> humanIKJointIndices;
|
||||||
|
|
||||||
glm::vec3 palmDirection;
|
glm::vec3 palmDirection;
|
||||||
|
|
Loading…
Reference in a new issue