Added cone to apply effect

This commit is contained in:
Robin Engman 2014-02-12 10:31:50 +01:00
parent f0178cf558
commit 2a214f5305
3 changed files with 9 additions and 8 deletions

View File

@ -262,6 +262,7 @@ void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void*
Sphere* sphere;
Box* box;
Cone* cone;
switch(collideable->type)
{
@ -293,19 +294,19 @@ void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void*
break;
//case ICollideable::Type::Type_cone:
//cone = dynamic_cast<Cone*>(collideable);
case ICollideable::Type::Type_cone:
cone = dynamic_cast<Cone*>(collideable);
// Add collision shape
//shape = new btConeShape();
shape = new btConeShape(cone->radius, cone->height.GetLength());
// Add motion state
//state = new btDefaultMotionState(btTransform(btQuaternion(),btVector3(cone->center.x, cone->center.y, cone->center.z)));
state = new btDefaultMotionState(btTransform(btQuaternion(btVector3(cone->height.x, cone->height.y, cone->height.z).normalized(), 0.0f),btVector3(cone->position.x, cone->position.y, cone->position.z)));
// Add rigid body
//btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(0, state, shape);
//body = new btRigidBody(rigidBodyCI);
rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo (0, state, shape);
body = new btRigidBody(rigidBodyCI);
//break;
break;
default:
return;
}

View File

@ -25,7 +25,6 @@ namespace Oyster
Cone & operator = ( const Cone &Cone );
private:
Oyster::Math::Float3 height;
Oyster::Math::Float3 position;
Oyster::Math::Float radius;

View File

@ -17,6 +17,7 @@
#include "Box.h"
#include "Frustrum.h"
#include "Line.h"
#include "Cone.h"
namespace Oyster { namespace Collision3D { namespace Utility
{