2010-08-16 00:22:53 +01:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2010 Alistair Riddoch
|
|
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
|
|
// $Id$
|
|
|
|
|
|
2011-07-08 09:05:21 +01:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-08-16 00:22:53 +01:00
|
|
|
#include "rulesets/BulletDomain.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/TerrainProperty.h"
|
|
|
|
|
|
2011-07-08 09:05:21 +01:00
|
|
|
#ifdef HAVE_BULLET
|
2010-08-25 00:10:57 +01:00
|
|
|
#include "btBulletCollisionCommon.h"
|
2011-07-08 09:05:21 +01:00
|
|
|
#endif // HAVE_BULLET
|
2010-08-25 00:10:57 +01:00
|
|
|
|
2010-08-16 00:22:53 +01:00
|
|
|
#include <cassert>
|
|
|
|
|
|
2010-08-25 00:10:57 +01:00
|
|
|
class TestBulletDomain : public BulletDomain
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
btCollisionWorld * test_getCollisionWorld() const
|
|
|
|
|
{
|
|
|
|
|
return m_collisionWorld;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-16 00:22:53 +01:00
|
|
|
int main()
|
|
|
|
|
{
|
2011-07-08 09:05:21 +01:00
|
|
|
#ifdef HAVE_BULLET
|
2010-08-25 00:10:57 +01:00
|
|
|
{
|
|
|
|
|
BulletDomain * bd = new BulletDomain;
|
|
|
|
|
delete bd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
BulletDomain * bd = new BulletDomain;
|
|
|
|
|
delete bd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
TestBulletDomain * bd = new TestBulletDomain;
|
|
|
|
|
assert(bd->test_getCollisionWorld() != 0);
|
|
|
|
|
|
|
|
|
|
btCollisionObject * obj = new btCollisionObject;
|
|
|
|
|
|
|
|
|
|
btMatrix3x3 basis;
|
|
|
|
|
basis.setIdentity();
|
|
|
|
|
obj->getWorldTransform().setBasis(basis);
|
|
|
|
|
|
|
|
|
|
btBoxShape* box = new btBoxShape(btVector3(1,1,1));
|
|
|
|
|
obj->setCollisionShape(box);
|
|
|
|
|
|
|
|
|
|
bd->test_getCollisionWorld()->addCollisionObject(obj);
|
|
|
|
|
|
|
|
|
|
delete bd;
|
|
|
|
|
}
|
2011-07-08 09:05:21 +01:00
|
|
|
#endif // HAVE_BULLET
|
2010-08-25 00:10:57 +01:00
|
|
|
|
2010-08-16 00:22:53 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// stubs
|
|
|
|
|
|
|
|
|
|
TerrainProperty::TerrainProperty() :
|
|
|
|
|
m_data(*(Mercator::Terrain*)0),
|
|
|
|
|
m_tileShader(*(Mercator::TileShader*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TerrainProperty::~TerrainProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-29 17:36:26 +01:00
|
|
|
int TerrainProperty::get(Atlas::Message::Element & ent) const
|
2010-08-16 00:22:53 +01:00
|
|
|
{
|
2011-09-29 17:36:26 +01:00
|
|
|
return 0;
|
2010-08-16 00:22:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TerrainProperty::set(const Atlas::Message::Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
TerrainProperty * TerrainProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 00:22:53 +01:00
|
|
|
bool TerrainProperty::getHeightAndNormal(float x,
|
|
|
|
|
float y,
|
|
|
|
|
float & height,
|
|
|
|
|
Vector3D & normal) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase::PropertyBase(unsigned int flags) : m_flags(flags)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase::~PropertyBase()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 00:45:36 +00:00
|
|
|
void PropertyBase::install(LocatedEntity *, const std::string & name)
|
2010-08-16 00:22:53 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void PropertyBase::apply(LocatedEntity *)
|
2010-08-16 00:22:53 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PropertyBase::add(const std::string & s,
|
|
|
|
|
Atlas::Message::MapType & ent) const
|
|
|
|
|
{
|
|
|
|
|
get(ent[s]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PropertyBase::add(const std::string & s,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-01-03 23:17:51 +00:00
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
HandlerResult PropertyBase::operation(LocatedEntity *,
|
2013-01-03 23:17:51 +00:00
|
|
|
const Operation &,
|
|
|
|
|
OpVector &)
|
|
|
|
|
{
|
|
|
|
|
return OPERATION_IGNORED;
|
|
|
|
|
}
|