From 8df6a7e05666b026efd29a2215e338a39ce42359 Mon Sep 17 00:00:00 2001 From: Jeffrey Ventrella Date: Tue, 23 Apr 2013 11:12:38 -0700 Subject: [PATCH] added collision code for avatar (not operational yet). and some cleanup. --- interface/src/Head.cpp | 121 ++++++++++++++++------------------------- interface/src/Head.h | 29 ++++++++-- interface/src/main.cpp | 3 + 3 files changed, 73 insertions(+), 80 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index d1bbf5e65b..28cc3f8ddc 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -120,7 +120,13 @@ Head::Head(bool isMine) { _renderPitch = 0.0; _sphere = NULL; - + + _collisionElipsoid.colliding = false; + _collisionElipsoid.position = glm::vec3( 0.0, 0.0, 0.0 ); + _collisionElipsoid.upVector = glm::vec3( 0.0, 0.0, 0.0 ); + _collisionElipsoid.girth = 0.0; + _collisionElipsoid.height = 0.0; + if (iris_texture.size() == 0) { switchToResourcesParentIfRequired(); unsigned error = lodepng::decode(iris_texture, iris_texture_width, iris_texture_height, iris_texture_file); @@ -129,16 +135,12 @@ Head::Head(bool isMine) { } } - //-------------------------------------------------- - // test... just slam them into random positions... - //-------------------------------------------------- - _otherAvatarHandPosition[ 0 ] = glm::vec3( 0.0f, 0.3f, 2.0f ); - _otherAvatarHandPosition[ 1 ] = glm::vec3( 4.0f, 0.3f, 2.0f ); - _otherAvatarHandPosition[ 2 ] = glm::vec3( 2.0f, 0.3f, 2.0f ); - _otherAvatarHandPosition[ 3 ] = glm::vec3( 1.0f, 0.3f, -4.0f ); - _otherAvatarHandPosition[ 4 ] = glm::vec3( -2.0f, 0.3f, -2.0f ); + for (int o=0; ogetLinkedData(); avatar->simulate(deltaTime); + + //not ready yet... + //myAvatar.testForCollision( avatar->getBodyPosition(), avatar->getGirth(), avatar->getHeight(), avatar->getBodyUpDirection() ); } }