mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
Merge pull request #439 from birarda/mouth-render
move _audioLoudness to HeadData
This commit is contained in:
commit
ccc04688d2
8 changed files with 9 additions and 16 deletions
|
@ -1317,7 +1317,7 @@ void Application::updateAvatar(float deltaTime) {
|
|||
|
||||
// Get audio loudness data from audio input device
|
||||
#ifndef _WIN32
|
||||
_myAvatar.setLoudness(_audio.getLastInputLoudness());
|
||||
_myAvatar.getHead().setAudioLoudness(_audio.getLastInputLoudness());
|
||||
#endif
|
||||
|
||||
// Update Avatar with latest camera and view frustum data...
|
||||
|
|
|
@ -434,7 +434,6 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
_head.setBodyRotation (glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||
_head.setPosition(_joint[ AVATAR_JOINT_HEAD_BASE ].springyPosition);
|
||||
_head.setScale (_joint[ AVATAR_JOINT_HEAD_BASE ].radius);
|
||||
_head.setAudioLoudness(_audioLoudness);
|
||||
_head.setSkinColor(glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]));
|
||||
_head.simulate(deltaTime, !_owningAgent);
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ Head::Head(Avatar* owningAvatar) :
|
|||
HeadData((AvatarData*)owningAvatar),
|
||||
yawRate(0.0f),
|
||||
_returnHeadToCenter(false),
|
||||
_audioLoudness(0.0f),
|
||||
_skinColor(0.0f, 0.0f, 0.0f),
|
||||
_position(0.0f, 0.0f, 0.0f),
|
||||
_rotation(0.0f, 0.0f, 0.0f),
|
||||
|
|
|
@ -44,7 +44,6 @@ public:
|
|||
void setSkinColor (glm::vec3 skinColor ) { _skinColor = skinColor; }
|
||||
void setSpringScale (float returnSpringScale ) { _returnSpringScale = returnSpringScale; }
|
||||
void setAverageLoudness(float averageLoudness ) { _averageLoudness = averageLoudness; }
|
||||
void setAudioLoudness (float audioLoudness ) { _audioLoudness = audioLoudness; }
|
||||
void setReturnToCenter (bool returnHeadToCenter) { _returnHeadToCenter = returnHeadToCenter; }
|
||||
void setRenderLookatVectors(bool onOff ) { _renderLookatVectors = onOff; }
|
||||
|
||||
|
@ -73,7 +72,6 @@ private:
|
|||
};
|
||||
|
||||
bool _returnHeadToCenter;
|
||||
float _audioLoudness;
|
||||
glm::vec3 _skinColor;
|
||||
glm::vec3 _position;
|
||||
glm::vec3 _rotation;
|
||||
|
|
|
@ -37,7 +37,6 @@ AvatarData::AvatarData(Agent* owningAgent) :
|
|||
_bodyYaw(-90.0),
|
||||
_bodyPitch(0.0),
|
||||
_bodyRoll(0.0),
|
||||
_audioLoudness(0),
|
||||
_handState(0),
|
||||
_cameraPosition(0,0,0),
|
||||
_cameraDirection(0,0,0),
|
||||
|
@ -53,6 +52,7 @@ AvatarData::AvatarData(Agent* owningAgent) :
|
|||
_wantDelta(false),
|
||||
_headData(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AvatarData::~AvatarData() {
|
||||
|
@ -104,7 +104,7 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
|||
destinationBuffer += sizeof(char);
|
||||
|
||||
// Instantaneous audio loudness (used to drive facial animation)
|
||||
memcpy(destinationBuffer, &_audioLoudness, sizeof(float));
|
||||
memcpy(destinationBuffer, &_headData->_audioLoudness, sizeof(float));
|
||||
destinationBuffer += sizeof(float);
|
||||
|
||||
// camera details
|
||||
|
@ -198,7 +198,7 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
|||
sourceBuffer += sizeof(char);
|
||||
|
||||
// Instantaneous audio loudness (used to drive facial animation)
|
||||
memcpy(&_audioLoudness, sourceBuffer, sizeof(float));
|
||||
memcpy(&_headData->_audioLoudness, sourceBuffer, sizeof(float));
|
||||
sourceBuffer += sizeof(float);
|
||||
|
||||
// camera details
|
||||
|
|
|
@ -51,11 +51,7 @@ public:
|
|||
// Hand State
|
||||
void setHandState(char s) { _handState = s; };
|
||||
char getHandState() const {return _handState; };
|
||||
|
||||
// Instantaneous audio loudness to drive mouth/facial animation
|
||||
void setLoudness(float l) { _audioLoudness = l; };
|
||||
float getLoudness() const {return _audioLoudness; };
|
||||
|
||||
|
||||
// getters for camera details
|
||||
const glm::vec3& getCameraPosition() const { return _cameraPosition; };
|
||||
const glm::vec3& getCameraDirection() const { return _cameraDirection; }
|
||||
|
@ -103,9 +99,6 @@ protected:
|
|||
float _bodyPitch;
|
||||
float _bodyRoll;
|
||||
|
||||
// Audio loudness (used to drive facial animation)
|
||||
float _audioLoudness;
|
||||
|
||||
// Hand state (are we grabbing something or not)
|
||||
char _handState;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ HeadData::HeadData(AvatarData* owningAvatar) :
|
|||
_lookAtPosition(0.0f, 0.0f, 0.0f),
|
||||
_leanSideways(0.0f),
|
||||
_leanForward(0.0f),
|
||||
_audioLoudness(0.0f),
|
||||
_owningAvatar(owningAvatar)
|
||||
{
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
float getRoll() const { return _roll; }
|
||||
void setRoll(float roll) { _roll = glm::clamp(roll, MIN_HEAD_ROLL, MAX_HEAD_ROLL); }
|
||||
|
||||
void setAudioLoudness(float audioLoudness) { _audioLoudness = audioLoudness; }
|
||||
|
||||
void addYaw(float yaw);
|
||||
void addPitch(float pitch);
|
||||
void addRoll(float roll);
|
||||
|
@ -57,6 +59,7 @@ protected:
|
|||
glm::vec3 _lookAtPosition;
|
||||
float _leanSideways;
|
||||
float _leanForward;
|
||||
float _audioLoudness;
|
||||
AvatarData* _owningAvatar;
|
||||
private:
|
||||
// privatize copy ctor and assignment operator so copies of this object cannot be made
|
||||
|
|
Loading…
Reference in a new issue