use OtherAvatar instead of Avatar in AvatarMotionState

This commit is contained in:
Andrew Meadows 2018-08-15 12:48:53 -07:00
parent 3c01433e12
commit 598a227f1a
2 changed files with 7 additions and 7 deletions

View file

@ -16,7 +16,7 @@
#include <PhysicsHelpers.h>
AvatarMotionState::AvatarMotionState(AvatarSharedPointer avatar, const btCollisionShape* shape) : ObjectMotionState(shape), _avatar(avatar) {
AvatarMotionState::AvatarMotionState(OtherAvatarPointer avatar, const btCollisionShape* shape) : ObjectMotionState(shape), _avatar(avatar) {
assert(_avatar);
_type = MOTIONSTATE_TYPE_AVATAR;
cacheShapeDiameter();
@ -57,7 +57,7 @@ PhysicsMotionType AvatarMotionState::computePhysicsMotionType() const {
// virtual and protected
const btCollisionShape* AvatarMotionState::computeNewShape() {
ShapeInfo shapeInfo;
std::static_pointer_cast<Avatar>(_avatar)->computeShapeInfo(shapeInfo);
_avatar->computeShapeInfo(shapeInfo);
return getShapeManager()->getShape(shapeInfo);
}
@ -151,7 +151,7 @@ glm::vec3 AvatarMotionState::getObjectAngularVelocity() const {
// virtual
glm::vec3 AvatarMotionState::getObjectGravity() const {
return std::static_pointer_cast<Avatar>(_avatar)->getAcceleration();
return _avatar->getAcceleration();
}
// virtual
@ -176,7 +176,7 @@ void AvatarMotionState::computeCollisionGroupAndMask(int32_t& group, int32_t& ma
// virtual
float AvatarMotionState::getMass() const {
return std::static_pointer_cast<Avatar>(_avatar)->computeMass();
return _avatar->computeMass();
}
void AvatarMotionState::cacheShapeDiameter() {

View file

@ -14,14 +14,14 @@
#include <QSet>
#include <avatars-renderer/Avatar.h>
#include <ObjectMotionState.h>
#include <BulletUtil.h>
#include "OtherAvatar.h"
class AvatarMotionState : public ObjectMotionState {
public:
AvatarMotionState(AvatarSharedPointer avatar, const btCollisionShape* shape);
AvatarMotionState(OtherAvatarPointer avatar, const btCollisionShape* shape);
virtual void handleEasyChanges(uint32_t& flags) override;
virtual bool handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine* engine) override;
@ -85,7 +85,7 @@ protected:
virtual bool isReadyToComputeShape() const override { return true; }
virtual const btCollisionShape* computeNewShape() override;
AvatarSharedPointer _avatar;
OtherAvatarPointer _avatar;
float _diameter { 0.0f };
uint32_t _dirtyFlags;