a few small formatting and glitch fixes

This commit is contained in:
Jeffrey Ventrella 2013-05-06 11:29:18 -07:00
parent f8762c5e37
commit 5c7fd0fe7d
2 changed files with 18 additions and 37 deletions

View file

@ -75,8 +75,8 @@ Avatar::Avatar(bool isMine) {
_orientation.setToIdentity(); _orientation.setToIdentity();
_velocity = glm::vec3( 0.0, 0.0, 0.0 ); _velocity = glm::vec3(0.0f, 0.0f, 0.0f);
_thrust = glm::vec3( 0.0, 0.0, 0.0 ); _thrust = glm::vec3(0.0f, 0.0f, 0.0f);
_rotation = glm::quat(0.0f, 0.0f, 0.0f, 0.0f); _rotation = glm::quat(0.0f, 0.0f, 0.0f, 0.0f);
_bodyYaw = -90.0; _bodyYaw = -90.0;
_bodyPitch = 0.0; _bodyPitch = 0.0;
@ -137,13 +137,13 @@ Avatar::Avatar(bool isMine) {
_head.browAudioLift = 0.0; _head.browAudioLift = 0.0;
_head.noise = 0; _head.noise = 0;
_head.returnSpringScale = 1.0; _head.returnSpringScale = 1.0;
_movedHandOffset = glm::vec3( 0.0, 0.0, 0.0 ); _movedHandOffset = glm::vec3(0.0f, 0.0f, 0.0f);
_usingBodySprings = true; _usingBodySprings = true;
_renderYaw = 0.0; _renderYaw = 0.0;
_renderPitch = 0.0; _renderPitch = 0.0;
_sphere = NULL; _sphere = NULL;
_interactingOther = NULL; _interactingOther = NULL;
_handHoldingPosition = glm::vec3( 0.0, 0.0, 0.0 ); _handHoldingPosition = glm::vec3(0.0f, 0.0f, 0.0f);
_distanceToNearestAvatar = std::numeric_limits<float>::max(); _distanceToNearestAvatar = std::numeric_limits<float>::max();
initializeSkeleton(); initializeSkeleton();
@ -344,7 +344,7 @@ void Avatar::simulate(float deltaTime) {
// apply gravity and collision wiht the ground/floor // apply gravity and collision wiht the ground/floor
if (AVATAR_GRAVITY) { if (AVATAR_GRAVITY) {
if ( _position.y > _pelvisStandingHeight + 0.01 ) { if ( _position.y > _pelvisStandingHeight + 0.01f) {
_velocity += glm::dvec3(getGravity(getPosition())) * (6.0 * deltaTime ); _velocity += glm::dvec3(getGravity(getPosition())) * (6.0 * deltaTime );
} else if (_position.y < _pelvisStandingHeight) { } else if (_position.y < _pelvisStandingHeight) {
_position.y = _pelvisStandingHeight; _position.y = _pelvisStandingHeight;
@ -363,7 +363,7 @@ void Avatar::simulate(float deltaTime) {
// driving the avatar around should only apply if this is my avatar (as opposed to an avatar being driven remotely) // driving the avatar around should only apply if this is my avatar (as opposed to an avatar being driven remotely)
if (_isMine) { if (_isMine) {
_thrust = glm::vec3( 0.0, 0.0, 0.0 ); _thrust = glm::vec3(0.0f, 0.0f, 0.0f);
if (_driveKeys[FWD ]) {_thrust += THRUST_MAG * deltaTime * _orientation.getFront();} if (_driveKeys[FWD ]) {_thrust += THRUST_MAG * deltaTime * _orientation.getFront();}
if (_driveKeys[BACK ]) {_thrust -= THRUST_MAG * deltaTime * _orientation.getFront();} if (_driveKeys[BACK ]) {_thrust -= THRUST_MAG * deltaTime * _orientation.getFront();}
@ -766,19 +766,6 @@ static TextRenderer* textRenderer() {
} }
struct TriangleArray
{
float v0x,v0y,v0z; // x,y,z coordinate of vertex 0
float r0,g0,b0,a0; // r,g,b color of vertex 0
float v1x,v1y,v1z; // x,y,z coordinate of vertex 1
float r1,g1,b1,a1; // r,g,b color of vertex 1
float v2x,v2y,v2z; // x,y,z coordinate of vertex 2
float r2,g2,b2,a2; // r,g,b color of vertex 2
};
void Avatar::render(bool lookingInMirror) { void Avatar::render(bool lookingInMirror) {
// render a simple round on the ground projected down from the avatar's position // render a simple round on the ground projected down from the avatar's position

View file

@ -69,7 +69,6 @@
#include "Camera.h" #include "Camera.h"
#include "Avatar.h" #include "Avatar.h"
#include "AvatarRenderer.h"
#include "Texture.h" #include "Texture.h"
#include <AgentList.h> #include <AgentList.h>
#include <AgentTypes.h> #include <AgentTypes.h>
@ -120,9 +119,6 @@ Avatar myAvatar(true); // The rendered avatar of oneself
Camera myCamera; // My view onto the world (sometimes on myself :) Camera myCamera; // My view onto the world (sometimes on myself :)
Camera viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode Camera viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
AvatarRenderer avatarRenderer;
// Starfield information // Starfield information
char starFile[] = "https://s3-us-west-1.amazonaws.com/highfidelity/stars.txt"; char starFile[] = "https://s3-us-west-1.amazonaws.com/highfidelity/stars.txt";
char starCacheFile[] = "cachedStars.txt"; char starCacheFile[] = "cachedStars.txt";
@ -720,7 +716,6 @@ void displaySide(Camera& whichCamera) {
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) { if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
Avatar *avatar = (Avatar *)agent->getLinkedData(); Avatar *avatar = (Avatar *)agent->getLinkedData();
avatar->render(0); avatar->render(0);
avatarRenderer.render(avatar, 0); // this will replace the above call
} }
} }
agentList->unlock(); agentList->unlock();
@ -733,7 +728,6 @@ void displaySide(Camera& whichCamera) {
//Render my own avatar //Render my own avatar
myAvatar.render(::lookingInMirror); myAvatar.render(::lookingInMirror);
avatarRenderer.render(&myAvatar, lookingInMirror); // this will replace the above call
glPopMatrix(); glPopMatrix();
} }