1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 10:25:21 +02:00

Add an option to disable object <-> object collision for Lua entities

This commit is contained in:
PilzAdam
2013-06-14 12:04:46 +00:00
committed by RealBadAngel
parent 413f0d0353
commit 8cae659786
14 changed files with 50 additions and 5 deletions

View File

@@ -68,6 +68,10 @@ public:
return false;
}
bool collideWithObjects() {
return false;
}
private:
};
@@ -140,6 +144,10 @@ public:
return false;
}
bool collideWithObjects() {
return false;
}
private:
float m_timer1;
float m_age;
@@ -325,6 +333,9 @@ public:
return false;
}
bool collideWithObjects() {
return false;
}
private:
std::string m_itemstring;
@@ -500,7 +511,8 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
v3f p_acceleration = m_acceleration;
moveresult = collisionMoveSimple(m_env,m_env->getGameDef(),
pos_max_d, box, stepheight, dtime,
p_pos, p_velocity, p_acceleration,this);
p_pos, p_velocity, p_acceleration,
this, m_prop.collideWithObjects);
// Apply results
m_base_position = p_pos;
m_velocity = p_velocity;
@@ -905,6 +917,10 @@ bool LuaEntitySAO::getCollisionBox(aabb3f *toset) {
return false;
}
bool LuaEntitySAO::collideWithObjects(){
return m_prop.collideWithObjects;
}
/*
PlayerSAO
*/
@@ -1496,3 +1512,7 @@ bool PlayerSAO::getCollisionBox(aabb3f *toset) {
return true;
}
bool PlayerSAO::collideWithObjects(){
return true;
}