aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 5e5cb38ae..ee1009b6c 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -50,7 +50,7 @@ struct ToolCapabilities;
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
-core::map<u16, ClientActiveObject::Factory> ClientActiveObject::m_types;
+std::map<u16, ClientActiveObject::Factory> ClientActiveObject::m_types;
/*
SmoothTranslator
@@ -174,6 +174,7 @@ public:
void processMessage(const std::string &data);
+ bool getCollisionBox(aabb3f *toset) { return false; }
private:
scene::IMeshSceneNode *m_node;
v3f m_position;
@@ -329,6 +330,7 @@ public:
std::string infoText()
{return m_infotext;}
+ bool getCollisionBox(aabb3f *toset) { return false; }
private:
core::aabbox3d<f32> m_selection_box;
scene::IMeshSceneNode *m_node;
@@ -643,6 +645,22 @@ public:
ClientActiveObject::registerType(getType(), create);
}
+ bool getCollisionBox(aabb3f *toset) {
+ if (m_prop.physical) {
+ aabb3f retval;
+ //update collision box
+ toset->MinEdge = m_prop.collisionbox.MinEdge * BS;
+ toset->MaxEdge = m_prop.collisionbox.MaxEdge * BS;
+
+ toset->MinEdge += m_position;
+ toset->MaxEdge += m_position;
+
+ return true;
+ }
+
+ return false;
+ }
+
void initialize(const std::string &data)
{
infostream<<"GenericCAO: Got init data"<<std::endl;
@@ -1127,8 +1145,7 @@ public:
v3f p_pos = m_position;
v3f p_velocity = m_velocity;
v3f p_acceleration = m_acceleration;
- IGameDef *gamedef = env->getGameDef();
- moveresult = collisionMoveSimple(&env->getMap(), gamedef,
+ moveresult = collisionMoveSimple(env,env->getGameDef(),
pos_max_d, box, stepheight, dtime,
p_pos, p_velocity, p_acceleration);
// Apply results