Added cone to apply effect
This commit is contained in:
parent
f0178cf558
commit
2a214f5305
|
@ -262,6 +262,7 @@ void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void*
|
||||||
|
|
||||||
Sphere* sphere;
|
Sphere* sphere;
|
||||||
Box* box;
|
Box* box;
|
||||||
|
Cone* cone;
|
||||||
|
|
||||||
switch(collideable->type)
|
switch(collideable->type)
|
||||||
{
|
{
|
||||||
|
@ -293,19 +294,19 @@ void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void*
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case ICollideable::Type::Type_cone:
|
case ICollideable::Type::Type_cone:
|
||||||
//cone = dynamic_cast<Cone*>(collideable);
|
cone = dynamic_cast<Cone*>(collideable);
|
||||||
// Add collision shape
|
// Add collision shape
|
||||||
//shape = new btConeShape();
|
shape = new btConeShape(cone->radius, cone->height.GetLength());
|
||||||
|
|
||||||
// Add motion state
|
// 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
|
// Add rigid body
|
||||||
//btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(0, state, shape);
|
rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo (0, state, shape);
|
||||||
//body = new btRigidBody(rigidBodyCI);
|
body = new btRigidBody(rigidBodyCI);
|
||||||
|
|
||||||
//break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace Oyster
|
||||||
|
|
||||||
Cone & operator = ( const Cone &Cone );
|
Cone & operator = ( const Cone &Cone );
|
||||||
|
|
||||||
private:
|
|
||||||
Oyster::Math::Float3 height;
|
Oyster::Math::Float3 height;
|
||||||
Oyster::Math::Float3 position;
|
Oyster::Math::Float3 position;
|
||||||
Oyster::Math::Float radius;
|
Oyster::Math::Float radius;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "Box.h"
|
#include "Box.h"
|
||||||
#include "Frustrum.h"
|
#include "Frustrum.h"
|
||||||
#include "Line.h"
|
#include "Line.h"
|
||||||
|
#include "Cone.h"
|
||||||
|
|
||||||
namespace Oyster { namespace Collision3D { namespace Utility
|
namespace Oyster { namespace Collision3D { namespace Utility
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue