mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 02:15:08 +02:00
add and remove some profile data points
This commit is contained in:
parent
42083a1a6d
commit
08bba5f45f
3 changed files with 23 additions and 24 deletions
|
@ -308,6 +308,7 @@ void Avatar::setShouldDie() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::simulate(float deltaTime) {
|
void Avatar::simulate(float deltaTime) {
|
||||||
|
PROFILE_RANGE(simulation, "simulate");
|
||||||
PerformanceTimer perfTimer("simulate");
|
PerformanceTimer perfTimer("simulate");
|
||||||
|
|
||||||
if (!isDead() && !_motionState) {
|
if (!isDead() && !_motionState) {
|
||||||
|
@ -317,8 +318,8 @@ void Avatar::simulate(float deltaTime) {
|
||||||
|
|
||||||
bool avatarInView = false;
|
bool avatarInView = false;
|
||||||
{ // update the shouldAnimate flag to match whether or not we will render the avatar.
|
{ // update the shouldAnimate flag to match whether or not we will render the avatar.
|
||||||
PerformanceTimer perfTimer("cull");
|
|
||||||
{
|
{
|
||||||
|
PROFILE_RANGE(simulation, "cull");
|
||||||
// simple frustum check
|
// simple frustum check
|
||||||
PerformanceTimer perfTimer("inView");
|
PerformanceTimer perfTimer("inView");
|
||||||
ViewFrustum viewFrustum;
|
ViewFrustum viewFrustum;
|
||||||
|
@ -326,7 +327,7 @@ void Avatar::simulate(float deltaTime) {
|
||||||
avatarInView = viewFrustum.sphereIntersectsFrustum(getPosition(), getBoundingRadius())
|
avatarInView = viewFrustum.sphereIntersectsFrustum(getPosition(), getBoundingRadius())
|
||||||
|| viewFrustum.boxIntersectsFrustum(_skeletonModel->getRenderableMeshBound());
|
|| viewFrustum.boxIntersectsFrustum(_skeletonModel->getRenderableMeshBound());
|
||||||
}
|
}
|
||||||
PerformanceTimer lodPerfTimer("LOD");
|
PROFILE_RANGE(simulation, "LOD");
|
||||||
if (avatarInView) {
|
if (avatarInView) {
|
||||||
const float MINIMUM_VISIBILITY_FOR_ON = 0.4f;
|
const float MINIMUM_VISIBILITY_FOR_ON = 0.4f;
|
||||||
const float MAXIMUM_VISIBILITY_FOR_OFF = 0.6f;
|
const float MAXIMUM_VISIBILITY_FOR_OFF = 0.6f;
|
||||||
|
@ -346,19 +347,17 @@ void Avatar::simulate(float deltaTime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t start = usecTimestampNow();
|
{
|
||||||
// CRUFT? _shouldSkipRender is never set 'true'
|
PROFILE_RANGE(simulation, "updateJoints");
|
||||||
if (_shouldAnimate && avatarInView && !_shouldSkipRender) {
|
uint64_t start = usecTimestampNow();
|
||||||
{
|
// CRUFT? _shouldSkipRender is never set 'true'
|
||||||
PerformanceTimer perfTimer("skeleton");
|
if (_shouldAnimate && avatarInView && !_shouldSkipRender) {
|
||||||
_skeletonModel->getRig()->copyJointsFromJointData(_jointData);
|
_skeletonModel->getRig()->copyJointsFromJointData(_jointData);
|
||||||
_skeletonModel->simulate(deltaTime, _hasNewJointRotations || _hasNewJointTranslations);
|
_skeletonModel->simulate(deltaTime, _hasNewJointRotations || _hasNewJointTranslations);
|
||||||
locationChanged(); // joints changed, so if there are any children, update them.
|
locationChanged(); // joints changed, so if there are any children, update them.
|
||||||
_hasNewJointRotations = false;
|
_hasNewJointRotations = false;
|
||||||
_hasNewJointTranslations = false;
|
_hasNewJointTranslations = false;
|
||||||
}
|
|
||||||
{
|
|
||||||
PerformanceTimer perfTimer("head");
|
|
||||||
glm::vec3 headPosition = getPosition();
|
glm::vec3 headPosition = getPosition();
|
||||||
if (!_skeletonModel->getHeadPosition(headPosition)) {
|
if (!_skeletonModel->getHeadPosition(headPosition)) {
|
||||||
headPosition = getPosition();
|
headPosition = getPosition();
|
||||||
|
@ -367,15 +366,14 @@ void Avatar::simulate(float deltaTime) {
|
||||||
head->setPosition(headPosition);
|
head->setPosition(headPosition);
|
||||||
head->setScale(getUniformScale());
|
head->setScale(getUniformScale());
|
||||||
head->simulate(deltaTime, false, !_shouldAnimate);
|
head->simulate(deltaTime, false, !_shouldAnimate);
|
||||||
|
} else {
|
||||||
|
// a non-full update is still required so that the position, rotation, scale and bounds of the skeletonModel are updated.
|
||||||
|
getHead()->setPosition(getPosition());
|
||||||
|
_skeletonModel->simulate(deltaTime, false);
|
||||||
}
|
}
|
||||||
} else {
|
timeProcessingJoints += usecTimestampNow() - start;
|
||||||
// a non-full update is still required so that the position, rotation, scale and bounds of the skeletonModel are updated.
|
numJointsProcessed += _jointData.size();
|
||||||
getHead()->setPosition(getPosition());
|
|
||||||
PerformanceTimer perfTimer("skeleton");
|
|
||||||
_skeletonModel->simulate(deltaTime, false);
|
|
||||||
}
|
}
|
||||||
timeProcessingJoints += usecTimestampNow() - start;
|
|
||||||
numJointsProcessed += _jointData.size();
|
|
||||||
|
|
||||||
// update animation for display name fade in/out
|
// update animation for display name fade in/out
|
||||||
if ( _displayNameTargetAlpha != _displayNameAlpha) {
|
if ( _displayNameTargetAlpha != _displayNameAlpha) {
|
||||||
|
@ -394,11 +392,13 @@ void Avatar::simulate(float deltaTime) {
|
||||||
_displayNameAlpha = abs(_displayNameAlpha - _displayNameTargetAlpha) < 0.01f ? _displayNameTargetAlpha : _displayNameAlpha;
|
_displayNameAlpha = abs(_displayNameAlpha - _displayNameTargetAlpha) < 0.01f ? _displayNameTargetAlpha : _displayNameAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
measureMotionDerivatives(deltaTime);
|
{
|
||||||
|
PROFILE_RANGE(simulation, "misc");
|
||||||
simulateAttachments(deltaTime);
|
measureMotionDerivatives(deltaTime);
|
||||||
updatePalms();
|
simulateAttachments(deltaTime);
|
||||||
updateAvatarEntities();
|
updatePalms();
|
||||||
|
updateAvatarEntities();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Avatar::isLookingAtMe(AvatarSharedPointer avatar) const {
|
bool Avatar::isLookingAtMe(AvatarSharedPointer avatar) const {
|
||||||
|
|
|
@ -1269,6 +1269,7 @@ void Rig::copyJointsIntoJointData(QVector<JointData>& jointDataVec) const {
|
||||||
|
|
||||||
void Rig::copyJointsFromJointData(const QVector<JointData>& jointDataVec) {
|
void Rig::copyJointsFromJointData(const QVector<JointData>& jointDataVec) {
|
||||||
PerformanceTimer perfTimer("copyJoints");
|
PerformanceTimer perfTimer("copyJoints");
|
||||||
|
PROFILE_RANGE(simulation_animation_detail, "copyJoints");
|
||||||
if (_animSkeleton && jointDataVec.size() == (int)_internalPoseSet._relativePoses.size()) {
|
if (_animSkeleton && jointDataVec.size() == (int)_internalPoseSet._relativePoses.size()) {
|
||||||
// make a vector of rotations in absolute-geometry-frame
|
// make a vector of rotations in absolute-geometry-frame
|
||||||
const AnimPoseVec& absoluteDefaultPoses = _animSkeleton->getAbsoluteDefaultPoses();
|
const AnimPoseVec& absoluteDefaultPoses = _animSkeleton->getAbsoluteDefaultPoses();
|
||||||
|
|
|
@ -272,8 +272,6 @@ void Model::reset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Model::updateGeometry() {
|
bool Model::updateGeometry() {
|
||||||
PROFILE_RANGE(render_detail, __FUNCTION__);
|
|
||||||
PerformanceTimer perfTimer("Model::updateGeometry");
|
|
||||||
bool needFullUpdate = false;
|
bool needFullUpdate = false;
|
||||||
|
|
||||||
if (!isLoaded()) {
|
if (!isLoaded()) {
|
||||||
|
|
Loading…
Reference in a new issue