From 821570fa76184ec61b157aa03a9074e4b3cfa35b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 15 Sep 2016 09:32:03 -0700 Subject: [PATCH] fix Windows build and minor format/namechange --- interface/src/avatar/MyAvatar.cpp | 2 ++ libraries/physics/src/CharacterController.cpp | 2 +- libraries/physics/src/CharacterGhostObject.cpp | 5 +++-- libraries/physics/src/CharacterGhostObject.h | 4 +++- libraries/physics/src/CharacterRayResult.cpp | 2 ++ libraries/physics/src/CharacterSweepResult.cpp | 2 ++ 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 8d5ec30424..1822e5e9aa 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1328,6 +1328,8 @@ void MyAvatar::prepareForPhysicsSimulation() { } void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) { + // ANDREW TODO -- measure maxHipOffsetRadius here and transmit that to Rig + glm::vec3 position = getPosition(); glm::quat orientation = getOrientation(); if (_characterController.isEnabledAndReady()) { diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 16f447f790..d3a38ed533 100644 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -125,7 +125,7 @@ void CharacterController::setDynamicsWorld(btDynamicsWorld* world) { _rigidBody->setGravity(oldGravity); btCollisionShape* shape = _rigidBody->getCollisionShape(); assert(shape && shape->getShapeType() == CAPSULE_SHAPE_PROXYTYPE); - _ghost.setCharacterShape(static_cast(shape)); // KINEMATIC_CONTROLLER_HACK + _ghost.setCharacterCapsule(static_cast(shape)); // KINEMATIC_CONTROLLER_HACK } // KINEMATIC_CONTROLLER_HACK _ghost.setCollisionGroupAndMask(_collisionGroup, BULLET_COLLISION_MASK_MY_AVATAR & (~ _collisionGroup)); diff --git a/libraries/physics/src/CharacterGhostObject.cpp b/libraries/physics/src/CharacterGhostObject.cpp index 250ff39e98..c503f8a927 100644 --- a/libraries/physics/src/CharacterGhostObject.cpp +++ b/libraries/physics/src/CharacterGhostObject.cpp @@ -11,6 +11,7 @@ #include "CharacterGhostObject.h" +#include #include #include "CharacterGhostShape.h" @@ -55,7 +56,7 @@ void CharacterGhostObject::setMotorVelocity(const btVector3& velocity) { } // override of btCollisionObject::setCollisionShape() -void CharacterGhostObject::setCharacterShape(btCapsuleShape* capsule) { +void CharacterGhostObject::setCharacterCapsule(btCapsuleShape* capsule) { assert(capsule); // we create our own CharacterGhostShape which has a larger Aabb for more reliable sweep tests if (_ghostShape) { @@ -240,7 +241,7 @@ bool CharacterGhostObject::rayTest(const btVector3& start, CharacterRayResult& result) const { if (_world && _inWorld) { _world->rayTest(start, end, result); - } + } return result.hasHit(); } diff --git a/libraries/physics/src/CharacterGhostObject.h b/libraries/physics/src/CharacterGhostObject.h index be8a68594e..8faf429542 100644 --- a/libraries/physics/src/CharacterGhostObject.h +++ b/libraries/physics/src/CharacterGhostObject.h @@ -12,6 +12,8 @@ #ifndef hifi_CharacterGhostObject_h #define hifi_CharacterGhostObject_h +#include + #include #include @@ -37,7 +39,7 @@ public: const btVector3& getLinearVelocity() const { return _linearVelocity; } - void setCharacterShape(btCapsuleShape* capsule); + void setCharacterCapsule(btCapsuleShape* capsule); void setCollisionWorld(btCollisionWorld* world); diff --git a/libraries/physics/src/CharacterRayResult.cpp b/libraries/physics/src/CharacterRayResult.cpp index 45a84a8274..e0d5212e52 100644 --- a/libraries/physics/src/CharacterRayResult.cpp +++ b/libraries/physics/src/CharacterRayResult.cpp @@ -11,6 +11,8 @@ #include "CharacterRayResult.h" +#include + #include "CharacterGhostObject.h" CharacterRayResult::CharacterRayResult (const CharacterGhostObject* character) : diff --git a/libraries/physics/src/CharacterSweepResult.cpp b/libraries/physics/src/CharacterSweepResult.cpp index 86c9871e87..13937354ae 100644 --- a/libraries/physics/src/CharacterSweepResult.cpp +++ b/libraries/physics/src/CharacterSweepResult.cpp @@ -11,6 +11,8 @@ #include "CharacterSweepResult.h" +#include + #include "CharacterGhostObject.h" CharacterSweepResult::CharacterSweepResult(const CharacterGhostObject* character)