mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
commit
8a34df380c
7 changed files with 9 additions and 14 deletions
|
@ -3389,14 +3389,10 @@ void Application::renderRearViewMirror(RenderArgs* renderArgs, const QRect& regi
|
||||||
// set the bounds of rear mirror view
|
// set the bounds of rear mirror view
|
||||||
gpu::Vec4i viewport;
|
gpu::Vec4i viewport;
|
||||||
if (billboard) {
|
if (billboard) {
|
||||||
QSize size = DependencyManager::get<FramebufferCache>()->getFrameBufferSize();
|
|
||||||
viewport = gpu::Vec4i(0, 0, region.width(), region.height());
|
viewport = gpu::Vec4i(0, 0, region.width(), region.height());
|
||||||
} else {
|
} else {
|
||||||
// if not rendering the billboard, the region is in device independent coordinates; must convert to device
|
// if not rendering the billboard, the region is in device independent coordinates; must convert to device
|
||||||
QSize size = DependencyManager::get<FramebufferCache>()->getFrameBufferSize();
|
|
||||||
float ratio = (float)QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale();
|
float ratio = (float)QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale();
|
||||||
int x = region.x() * ratio;
|
|
||||||
int y = region.y() * ratio;
|
|
||||||
int width = region.width() * ratio;
|
int width = region.width() * ratio;
|
||||||
int height = region.height() * ratio;
|
int height = region.height() * ratio;
|
||||||
viewport = gpu::Vec4i(0, 0, width, height);
|
viewport = gpu::Vec4i(0, 0, width, height);
|
||||||
|
|
|
@ -462,8 +462,8 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
const float LOOKING_AT_ME_ALPHA_START = 0.8f;
|
const float LOOKING_AT_ME_ALPHA_START = 0.8f;
|
||||||
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
float alpha = LOOKING_AT_ME_ALPHA_START
|
float alpha = LOOKING_AT_ME_ALPHA_START
|
||||||
* (1.0f - ((float)(usecTimestampNow() - getHead()->getLookingAtMeStarted()))
|
* (1.0f - ((float)(now - getHead()->getLookingAtMeStarted()))
|
||||||
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND));
|
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND));
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
QSharedPointer<NetworkGeometry> geometry = getHead()->getFaceModel().getGeometry();
|
QSharedPointer<NetworkGeometry> geometry = getHead()->getFaceModel().getGeometry();
|
||||||
|
|
|
@ -1290,7 +1290,6 @@ bool MyAvatar::shouldRenderHead(const RenderArgs* renderArgs) const {
|
||||||
|
|
||||||
void MyAvatar::updateOrientation(float deltaTime) {
|
void MyAvatar::updateOrientation(float deltaTime) {
|
||||||
// Smoothly rotate body with arrow keys
|
// Smoothly rotate body with arrow keys
|
||||||
float driveLeft = _driveKeys[ROT_LEFT] - _driveKeys[ROT_RIGHT];
|
|
||||||
float targetSpeed = (_driveKeys[ROT_LEFT] - _driveKeys[ROT_RIGHT]) * YAW_SPEED;
|
float targetSpeed = (_driveKeys[ROT_LEFT] - _driveKeys[ROT_RIGHT]) * YAW_SPEED;
|
||||||
if (targetSpeed != 0.0f) {
|
if (targetSpeed != 0.0f) {
|
||||||
const float ROTATION_RAMP_TIMESCALE = 0.1f;
|
const float ROTATION_RAMP_TIMESCALE = 0.1f;
|
||||||
|
|
|
@ -91,13 +91,12 @@ private:
|
||||||
|
|
||||||
int _leftBlinkIndex;
|
int _leftBlinkIndex;
|
||||||
int _rightBlinkIndex;
|
int _rightBlinkIndex;
|
||||||
int _leftEyeOpenIndex;
|
|
||||||
int _rightEyeOpenIndex;
|
|
||||||
|
|
||||||
int _leftEyeDownIndex;
|
int _leftEyeDownIndex;
|
||||||
int _rightEyeDownIndex;
|
int _rightEyeDownIndex;
|
||||||
int _leftEyeInIndex;
|
int _leftEyeInIndex;
|
||||||
int _rightEyeInIndex;
|
int _rightEyeInIndex;
|
||||||
|
int _leftEyeOpenIndex;
|
||||||
|
int _rightEyeOpenIndex;
|
||||||
|
|
||||||
int _browDownLeftIndex;
|
int _browDownLeftIndex;
|
||||||
int _browDownRightIndex;
|
int _browDownRightIndex;
|
||||||
|
|
|
@ -495,7 +495,7 @@ void ApplicationCompositor::renderControllerPointers(gpu::Batch& batch) {
|
||||||
glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection();
|
glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection();
|
||||||
|
|
||||||
// Get the angles, scaled between (-0.5,0.5)
|
// Get the angles, scaled between (-0.5,0.5)
|
||||||
float xAngle = (atan2(direction.z, direction.x) + PI_OVER_TWO);
|
float xAngle = (atan2f(direction.z, direction.x) + PI_OVER_TWO);
|
||||||
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO));
|
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO));
|
||||||
|
|
||||||
// Get the pixel range over which the xAngle and yAngle are scaled
|
// Get the pixel range over which the xAngle and yAngle are scaled
|
||||||
|
|
|
@ -125,8 +125,10 @@ void AudioStatsDialog::renderStats() {
|
||||||
audioInputBufferLatency = (double)_stats->getAudioInputMsecsReadStats().getWindowAverage();
|
audioInputBufferLatency = (double)_stats->getAudioInputMsecsReadStats().getWindowAverage();
|
||||||
inputRingBufferLatency = (double)_stats->getInputRungBufferMsecsAvailableStats().getWindowAverage();
|
inputRingBufferLatency = (double)_stats->getInputRungBufferMsecsAvailableStats().getWindowAverage();
|
||||||
networkRoundtripLatency = (double) audioMixerNodePointer->getPingMs();
|
networkRoundtripLatency = (double) audioMixerNodePointer->getPingMs();
|
||||||
mixerRingBufferLatency = (double)_stats->getMixerAvatarStreamStats()._framesAvailableAverage * AudioConstants::NETWORK_FRAME_MSECS;
|
mixerRingBufferLatency = (double)_stats->getMixerAvatarStreamStats()._framesAvailableAverage *
|
||||||
outputRingBufferLatency = (double)downstreamAudioStreamStats._framesAvailableAverage * AudioConstants::NETWORK_FRAME_MSECS;
|
(double)AudioConstants::NETWORK_FRAME_MSECS;
|
||||||
|
outputRingBufferLatency = (double)downstreamAudioStreamStats._framesAvailableAverage *
|
||||||
|
(double)AudioConstants::NETWORK_FRAME_MSECS;
|
||||||
audioOutputBufferLatency = (double)_stats->getAudioOutputMsecsUnplayedStats().getWindowAverage();
|
audioOutputBufferLatency = (double)_stats->getAudioOutputMsecsUnplayedStats().getWindowAverage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ void Cube3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
||||||
// TODO: handle registration point??
|
// TODO: handle registration point??
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position = getPosition();
|
||||||
glm::vec3 center = getCenter();
|
|
||||||
glm::vec3 dimensions = getDimensions();
|
glm::vec3 dimensions = getDimensions();
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue