if (!mesh)
return ScriptError("Invalid mesh object");
- WallObject *wall = mesh->GetWallByName(tempdata[1]);
+ Wall *wall = mesh->GetWallByName(tempdata[1]);
if (!wall)
return ScriptError("Invalid wall object");
std::vector<std::string> Params;
};
- SBS::WallObject *wall;
+ SBS::Wall *wall;
int startpos;
std::vector<std::string> BuildingData;
std::vector<std::string> BuildingDataOrig;
ray.setDirection(sbs->GetOrientation().Inverse() * ray.getDirection());
MeshObject* mesh = 0;
- WallObject* wall = 0;
+ Wall* wall = 0;
bool hit = sbs->HitBeam(ray, 1000.0f, mesh, wall, HitPosition);
Ogre::Vector3 hit_position;
MeshObject *mesh = 0;
- WallObject *wall = 0;
+ Wall *wall = 0;
bool hit = false;
//do a raycast from the collider's position, in the forward direction
std::string texture = GetTexture(selection_position);
sbs->TexelOverride = true;
- WallObject *wall;
+ Wall *wall;
if (Direction == "front")
{
float x = 0, y = width;
if (Direction == 3 || Direction == 4 || Direction == 7 || Direction == 8)
sbs->GetTextureManager()->SetTextureFlip(1, 0, 0, 0, 0, 0); //flip texture on rear side of door
- WallObject *wall;
+ Wall *wall;
wall = DoorMesh->CreateWallObject(name);
sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height, height, 0, 0, tw, th, false);
sbs->ResetWalls();
return parent->ReportError(message);
}
-WallObject* ElevatorCar::AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
+Wall* ElevatorCar::AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
{
//Adds a wall with the specified dimensions
- WallObject *wall = Mesh->CreateWallObject(name);
+ Wall *wall = Mesh->CreateWallObject(name);
sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height1, height2, voffset1, voffset2, tw, th, true);
return wall;
}
-WallObject* ElevatorCar::AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+Wall* ElevatorCar::AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//Adds a floor with the specified dimensions and vertical offset
- WallObject *wall = Mesh->CreateWallObject(name);
+ Wall *wall = Mesh->CreateWallObject(name);
sbs->AddFloorMain(wall, name, texture, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, tw, th, true, legacy_behavior);
return wall;
}
Elevator* GetElevator();
void Report(const std::string &message);
bool ReportError(const std::string &message);
- WallObject* AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
- WallObject* AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ Wall* AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
+ Wall* AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
FloorIndicator* AddFloorIndicator(const std::string &texture_prefix, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset);
ButtonPanel* CreateButtonPanel(const std::string &texture, int rows, int columns, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, float spacingX, float spacingY, float tw, float th);
void DumpServicedFloors();
//add main walls
sbs->DrawWalls(true, true, false, false, false, false);
- WallObject *wall;
+ Wall *wall;
wall = door->mesh->CreateWallObject(name);
sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height, height, voffset, voffset, tw, th, false);
sbs->ResetWalls();
std::string buffer;
//create wall object
- WallObject *wall = Steps[i]->CreateWallObject(base);
+ Wall *wall = Steps[i]->CreateWallObject(base);
float thickness = 0;
if (i < num_steps - 1)
sbs->RemoveFloor(this);
}
-WallObject* Floor::AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool isexternal, bool legacy_behavior)
+Wall* Floor::AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool isexternal, bool legacy_behavior)
{
//Adds a floor with the specified dimensions and vertical offset
- WallObject *wall;
+ Wall *wall;
if (isexternal == false)
{
return wall;
}
-WallObject* Floor::AddInterfloorFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+Wall* Floor::AddInterfloorFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//Adds an interfloor floor with the specified dimensions and vertical offset
- WallObject *wall = Interfloor->CreateWallObject(name);
+ Wall *wall = Interfloor->CreateWallObject(name);
sbs->AddFloorMain(wall, name, texture, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, tw, th, true, legacy_behavior);
return wall;
}
-WallObject* Floor::AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th, bool isexternal)
+Wall* Floor::AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th, bool isexternal)
{
//Adds a wall with the specified dimensions
- WallObject *wall;
+ Wall *wall;
if (isexternal == false)
{
wall = Level->CreateWallObject(name);
return wall;
}
-WallObject* Floor::AddInterfloorWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th)
+Wall* Floor::AddInterfloorWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th)
{
//Adds an interfloor wall with the specified dimensions
- WallObject *wall = Interfloor->CreateWallObject(name);
+ Wall *wall = Interfloor->CreateWallObject(name);
sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height_in1, height_in2, voffset1, voffset2, tw, th, true);
return wall;
}
IsInterfloorEnabled = value;
}
-WallObject* Floor::ColumnWallBox(const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom)
+Wall* Floor::ColumnWallBox(const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom)
{
//create columnframe wall box
return sbs->CreateWallBox(ColumnFrame, name, texture, x1, x2, z1, z2, height_in, voffset, tw, th, inside, outside, top, bottom, true);
}
-WallObject* Floor::ColumnWallBox2(const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom)
+Wall* Floor::ColumnWallBox2(const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom)
{
//create columnframe wall box from a central location
//functions
Floor(Object *parent, FloorManager *manager, int number);
~Floor();
- WallObject* AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool isexternal, bool legacy_behavior = false);
- WallObject* AddInterfloorFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
- WallObject* AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th, bool isexternal);
- WallObject* AddInterfloorWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th);
+ Wall* AddFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool isexternal, bool legacy_behavior = false);
+ Wall* AddInterfloorFloor(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ Wall* AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th, bool isexternal);
+ Wall* AddInterfloorWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th);
void Enabled(bool value);
float FullHeight();
CallButton* AddCallButtons(std::vector<int> &elevators, const std::string &sound_file, const std::string &BackTexture, const std::string &UpButtonTexture, const std::string &UpButtonTexture_Lit, const std::string &DownButtonTexture, const std::string &DownButtonTexture_Lit, float CenterX, float CenterZ, float voffset, const std::string &direction, float BackWidth, float BackHeight, bool ShowBack, float tw, float th);
bool CalculateAltitude();
void EnableColumnFrame(bool value);
void EnableInterfloor(bool value);
- WallObject* ColumnWallBox(const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
- WallObject* ColumnWallBox2(const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
+ Wall* ColumnWallBox(const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
+ Wall* ColumnWallBox2(const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
FloorIndicator* AddFloorIndicator(int elevator, int car, bool relative, const std::string &texture_prefix, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset);
void UpdateFloorIndicators(int elevator);
void UpdateFloorIndicators();
return Ogre::Vector2(esmall, ebig);
}
-void SBS::Cut(WallObject *wall, Ogre::Vector3 start, Ogre::Vector3 end, bool cutwalls, bool cutfloors, int checkwallnumber, bool reset_check)
+void SBS::Cut(Wall *wall, Ogre::Vector3 start, Ogre::Vector3 end, bool cutwalls, bool cutfloors, int checkwallnumber, bool reset_check)
{
//cuts a rectangular hole in the polygons within the specified range
sbs->camera->ResetCollisions();
}
-WallObject* MeshObject::CreateWallObject(const std::string &name)
+Wall* MeshObject::CreateWallObject(const std::string &name)
{
//create a new wall object in the given array
- WallObject *wall = new WallObject(this);
+ Wall *wall = new Wall(this);
wall->SetParentArray(Walls);
wall->SetValues("Wall", name, false, false);
Walls.push_back(wall);
return wall;
}
-WallObject* MeshObject::GetWallByName(std::string name)
+Wall* MeshObject::GetWallByName(std::string name)
{
//find a wall object by name
return result;
}
-WallObject* MeshObject::FindWallIntersect(const Ogre::Vector3 &start, const Ogre::Vector3 &end, Ogre::Vector3 &isect, float &distance, Ogre::Vector3 &normal, WallObject *wall)
+Wall* MeshObject::FindWallIntersect(const Ogre::Vector3 &start, const Ogre::Vector3 &end, Ogre::Vector3 &isect, float &distance, Ogre::Vector3 &normal, Wall *wall)
{
//find a wall from a 3D point
//positions need to be in remote (Ogre) positioning
for (size_t i = 0; i < Walls.size(); i++)
{
- WallObject *wall = Walls[i];
+ Wall *wall = Walls[i];
if (wall)
{
wall->parent_deleting = true;
for (size_t i = 0; i < Walls.size(); i++)
{
- WallObject *wall = Walls[i];
+ Wall *wall = Walls[i];
if (wall)
{
if (wall->GetParent() == parent)
//do a line intersection with a specified wall associated with this mesh object,
//and return the intersection point
- WallObject *wall = GetWallByName(wallname);
+ Wall *wall = GetWallByName(wallname);
if (wall)
return wall->GetPoint(start, end);
{
//return the X and Z extents of a standard wall (by name) at a specific altitude, by doing a double plane cut
- WallObject *wall = GetWallByName(name);
+ Wall *wall = GetWallByName(name);
if (wall)
return wall->GetWallExtents(altitude, get_max);
return Ogre::Vector2(esmall, ebig);
}
-WallObject* MeshObject::FindPolygon(const std::string &name, int &index)
+Wall* MeshObject::FindPolygon(const std::string &name, int &index)
{
//finds a polygon by name in all associated wall objects
//returns associated wall object and polygon index
void Enable(bool value);
void EnableCollider(bool value);
bool IsEnabled();
- WallObject* CreateWallObject(const std::string &name);
- WallObject* GetWallByName(std::string name);
+ Wall* CreateWallObject(const std::string &name);
+ Wall* GetWallByName(std::string name);
bool ChangeTexture(const std::string &texture, bool matcheck = true, int submesh = 0);
bool ReplaceTexture(const std::string &oldtexture, const std::string &newtexture);
- WallObject* FindWallIntersect(const Ogre::Vector3 &start, const Ogre::Vector3 &end, Ogre::Vector3 &isect, float &distance, Ogre::Vector3 &normal, WallObject *wall = 0);
+ Wall* FindWallIntersect(const Ogre::Vector3 &start, const Ogre::Vector3 &end, Ogre::Vector3 &isect, float &distance, Ogre::Vector3 &normal, Wall *wall = 0);
bool PolyMesh(const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &vertices, float tw, float th, bool autosize, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector, std::vector<Extents> &mesh_indices, std::vector<Triangle> &triangles, std::vector<std::vector<Ogre::Vector3> > &converted_vertices);
bool PolyMesh(const std::string &name, const std::string &material, std::vector<std::vector<Ogre::Vector3> > &vertices, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector, std::vector<Extents> &mesh_indices, std::vector<Triangle> &triangles, std::vector<std::vector<Ogre::Vector3> > &converted_vertices, float tw, float th, bool convert_vertices = true);
Ogre::Vector2* GetTexels(Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector, std::vector<std::vector<Ogre::Vector3> > &vertices, float tw, float th);
Ogre::Vector3 GetPoint(const std::string &wallname, const Ogre::Vector3 &start, const Ogre::Vector3 &end);
Ogre::Vector3 GetWallExtents(const std::string &name, float altitude, bool get_max);
Ogre::Vector2 GetExtents(int coord, bool flip_z = false);
- WallObject* FindPolygon(const std::string &name, int &index);
+ Wall* FindPolygon(const std::string &name, int &index);
void OnMove(bool parent);
void OnRotate(bool parent);
int GetSubmeshCount();
DynamicMesh *MeshWrapper; //dynamic mesh this mesh object uses
std::vector<SubMesh> Submeshes; //submeshes
- std::vector<WallObject*> Walls; //associated wall (polygon container) objects
+ std::vector<Wall*> Walls; //associated wall (polygon container) objects
SceneNode *collider_node; //collider scenenode for box collider offsets
sbs->DrawWalls(true, true, true, true, true, true);
sbs->GetTextureManager()->ResetTextureMapping(true);
- WallObject *wall;
+ Wall *wall;
wall = DoorMesh->CreateWallObject(name);
Segments = segments;
bool SBS::AddWallMain(Object *parent, MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize)
{
- WallObject *object = new WallObject(mesh, parent, true);
+ Wall *object = new Wall(mesh, parent, true);
bool result = AddWallMain(object, name, texture, thickness, x1, z1, x2, z2, height_in1, height_in2, altitude1, altitude2, tw, th, autosize);
delete object;
return result;
}
-bool SBS::AddWallMain(WallObject* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize)
+bool SBS::AddWallMain(Wall* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize)
{
//Adds a wall with the specified dimensions
bool SBS::AddFloorMain(Object *parent, MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior)
{
- WallObject *object = new WallObject(mesh, parent, true);
+ Wall *object = new Wall(mesh, parent, true);
bool result = AddFloorMain(object, name, texture, thickness, x1, z1, x2, z2, altitude1, altitude2, reverse_axis, texture_direction, tw, th, autosize, legacy_behavior);
delete object;
return result;
}
-bool SBS::AddFloorMain(WallObject* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior)
+bool SBS::AddFloorMain(Wall* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior)
{
//Adds a floor with the specified dimensions and vertical offset
return false;
}
-WallObject* SBS::CreateWallBox(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom, bool autosize)
+Wall* SBS::CreateWallBox(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom, bool autosize)
{
//create 4 walls
}
//create wall object
- WallObject *wall = mesh->CreateWallObject(name);
+ Wall *wall = mesh->CreateWallObject(name);
bool x_thickness = false, z_thickness = false;
std::string NewName, texture2 = texture;
return wall;
}
-WallObject* SBS::CreateWallBox2(MeshObject* mesh, const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom, bool autosize)
+Wall* SBS::CreateWallBox2(MeshObject* mesh, const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom, bool autosize)
{
//create 4 walls from a central point
return CreateWallBox(mesh, name, texture, x1, x2, z1, z2, height_in, voffset, tw, th, inside, outside, top, bottom, autosize);
}
-void SBS::AddPolygon(WallObject* wallobject, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th)
+void SBS::AddPolygon(Wall* wallobject, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th)
{
//creates a polygon in the specified wall object
}
}
-WallObject* SBS::AddCustomWall(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th)
+Wall* SBS::AddCustomWall(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th)
{
//Adds a wall from a specified array of 3D vectors
return 0;
//create wall object
- WallObject *wall = mesh->CreateWallObject(name);
+ Wall *wall = mesh->CreateWallObject(name);
//create polygon in wall object
AddPolygon(wall, texture, varray, tw, th);
return wall;
}
-WallObject* SBS::AddCustomFloor(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector2> &varray, float altitude, float tw, float th)
+Wall* SBS::AddCustomFloor(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector2> &varray, float altitude, float tw, float th)
{
//Same as AddCustomWall, with only one altitude value value
std::vector<Ogre::Vector3> varray3;
return AddCustomWall(mesh, name, texture, varray3, tw, th);
}
-WallObject* SBS::AddTriangleWall(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float tw, float th)
+Wall* SBS::AddTriangleWall(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float tw, float th)
{
//Adds a triangular wall with the specified dimensions
std::vector<Ogre::Vector3> varray;
//create a skybox that extends by default 30 miles (30 * 5280 ft) in each direction
float skysize = GetConfigInt("Skyscraper.SBS.HorizonDistance", 30) * 5280.0f;
texturemanager->ResetTextureMapping(true);
- WallObject *wall = new WallObject(SkyBox, SkyBox, true);
+ Wall *wall = new Wall(SkyBox, SkyBox, true);
wall->AddQuad( //front
"SkyFront",
return feet / 3.2808399f;
}
-WallObject* SBS::AddDoorwayWalls(MeshObject* mesh, const std::string &wallname, const std::string &texture, float tw, float th)
+Wall* SBS::AddDoorwayWalls(MeshObject* mesh, const std::string &wallname, const std::string &texture, float tw, float th)
{
//add joining doorway polygons if needed
if (wall1a == true && wall2a == true)
{
- WallObject *wall = mesh->CreateWallObject(wallname);
+ Wall *wall = mesh->CreateWallObject(wallname);
//convert extents to relative positioning
Ogre::Vector2 extents_x = wall_extents_x - wall->GetMesh()->GetPosition().x;
wall_extents_z = 0;
}
-WallObject* SBS::AddWall(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th)
+Wall* SBS::AddWall(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th)
{
//Adds a wall with the specified dimensions, to the specified mesh object
if (!mesh)
return 0;
- WallObject *wall = mesh->CreateWallObject(name);
+ Wall *wall = mesh->CreateWallObject(name);
AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height_in1, height_in2, altitude1, altitude2, tw, th, true);
return wall;
}
-WallObject* SBS::AddFloor(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+Wall* SBS::AddFloor(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//Adds a floor with the specified dimensions and vertical offset, to the specified mesh object
if (!mesh)
return 0;
- WallObject *wall = mesh->CreateWallObject(name);
+ Wall *wall = mesh->CreateWallObject(name);
AddFloorMain(wall, name, texture, thickness, x1, z1, x2, z2, altitude1, altitude2, reverse_axis, texture_direction, tw, th, true, legacy_behavior);
return wall;
}
-WallObject* SBS::AddGround(const std::string &name, const std::string &texture, float x1, float z1, float x2, float z2, float altitude, int tile_x, int tile_z)
+Wall* SBS::AddGround(const std::string &name, const std::string &texture, float x1, float z1, float x2, float z2, float altitude, int tile_x, int tile_z)
{
//Adds ground based on a tiled-floor layout, with the specified dimensions and vertical offset
//this does not support thickness
maxz = z1;
}
- WallObject *wall = Landscape->CreateWallObject(name);
+ Wall *wall = Landscape->CreateWallObject(name);
Report("Creating ground...");
deleted = true;
else if (type == "Wall")
{
- WallObject *obj = static_cast<WallObject*>(object);
+ Wall *obj = static_cast<Wall*>(object);
obj->DeletePolygons(true);
deleted = true;
}
EscalatorCount--;
}
-bool SBS::HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, WallObject *&wall, Ogre::Vector3 &hit_position)
+bool SBS::HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, Wall *&wall, Ogre::Vector3 &hit_position)
{
//use a given ray and distance, and return the nearest hit mesh and if applicable, wall object
//note that the ray's origin and direction need to be in engine-relative values
class RevolvingDoorManager;
class Polygon;
class Model;
- class WallObject;
+ class Wall;
class Door;
class Floor;
class Elevator;
void Initialize();
bool Start(Ogre::Camera *camera = 0);
void CreateSky();
- bool AddWallMain(WallObject* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize);
+ bool AddWallMain(Wall* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize);
bool AddWallMain(Object *parent, MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th, bool autosize);
- bool AddFloorMain(WallObject* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior = false);
+ bool AddFloorMain(Wall* wallobject, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior = false);
bool AddFloorMain(Object *parent, MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool autosize, bool legacy_behavior = false);
void CalculateFrameRate();
void Loop();
- WallObject* CreateWallBox(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside = true, bool outside = true, bool top = true, bool bottom = true, bool autosize = true);
- WallObject* CreateWallBox2(MeshObject* mesh, const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside = true, bool outside = true, bool top = true, bool bottom = true, bool autosize = true);
- WallObject* AddTriangleWall(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float tw, float th);
- WallObject* AddCustomWall(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th);
- WallObject* AddCustomFloor(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector2> &varray, float altitude, float tw, float th);
- void AddPolygon(WallObject* wallobject, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th);
+ Wall* CreateWallBox(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside = true, bool outside = true, bool top = true, bool bottom = true, bool autosize = true);
+ Wall* CreateWallBox2(MeshObject* mesh, const std::string &name, const std::string &texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside = true, bool outside = true, bool top = true, bool bottom = true, bool autosize = true);
+ Wall* AddTriangleWall(MeshObject* mesh, const std::string &name, const std::string &texture, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float tw, float th);
+ Wall* AddCustomWall(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th);
+ Wall* AddCustomFloor(MeshObject* mesh, const std::string &name, const std::string &texture, std::vector<Ogre::Vector2> &varray, float altitude, float tw, float th);
+ void AddPolygon(Wall* wallobject, const std::string &texture, std::vector<Ogre::Vector3> &varray, float tw, float th);
void EnableBuildings(bool value);
void EnableLandscape(bool value);
void EnableExternal(bool value);
int GetDrawWallsCount();
float MetersToFeet(float meters); //converts meters to feet
float FeetToMeters(float feet); //converts feet to meters
- WallObject* AddDoorwayWalls(MeshObject* mesh, const std::string &wallname, const std::string &texture, float tw, float th);
- WallObject* AddWall(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th);
- WallObject* AddFloor(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
- WallObject* AddGround(const std::string &name, const std::string &texture, float x1, float z1, float x2, float z2, float altitude, int tile_x, int tile_z);
+ Wall* AddDoorwayWalls(MeshObject* mesh, const std::string &wallname, const std::string &texture, float tw, float th);
+ Wall* AddWall(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float altitude1, float altitude2, float tw, float th);
+ Wall* AddFloor(MeshObject* mesh, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float altitude1, float altitude2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ Wall* AddGround(const std::string &name, const std::string &texture, float x1, float z1, float x2, float z2, float altitude, int tile_x, int tile_z);
void EnableFloorRange(int floor, int range, bool value, bool enablegroups, int shaftnumber = 0, int stairsnumber = 0);
bool RegisterTimerCallback(TimerObject *timer);
bool UnregisterTimerCallback(TimerObject *timer);
Model* AddModel(const std::string &name, const std::string &filename, bool center, const Ogre::Vector3 &position, const Ogre::Vector3 &rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
void AddModel(Model *model);
Ogre::Vector2 GetExtents(std::vector<Ogre::Vector3> &varray, int coord, bool flip_z = false);
- void Cut(WallObject *wall, Ogre::Vector3 start, Ogre::Vector3 end, bool cutwalls, bool cutfloors, int checkwallnumber = 0, bool reset_check = true);
+ void Cut(Wall *wall, Ogre::Vector3 start, Ogre::Vector3 end, bool cutwalls, bool cutfloors, int checkwallnumber = 0, bool reset_check = true);
Ogre::Vector3 GetPolygonDirection(std::vector<Ogre::Vector3> &polygon);
int GetConfigInt(const std::string &key, int default_value);
std::string GetConfigString(const std::string &key, const std::string &default_value);
int GetEscalatorCount();
void IncrementEscalatorCount();
void DecrementEscalatorCount();
- bool HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, WallObject *&wall, Ogre::Vector3 &hit_position);
+ bool HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, Wall *&wall, Ogre::Vector3 &hit_position);
void EnableRandomActivity(bool value);
SoundSystem* GetSoundSystem();
bool IsObjectValid(Object* object, std::string type = "");
sbs->RemoveShaft(this);
}
-WallObject* Shaft::AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
+Wall* Shaft::AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return 0;
}
- WallObject *wall = GetMeshObject(floor)->CreateWallObject(name);
+ Wall *wall = GetMeshObject(floor)->CreateWallObject(name);
AddWall(wall, floor, name, texture, thickness, x1, z1, x2, z2, height1, height2, voffset1, voffset2, tw, th);
return wall;
}
-bool Shaft::AddWall(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
+bool Shaft::AddWall(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height1, height2, voffset1, voffset2, tw, th, true);
}
-WallObject* Shaft::AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+Wall* Shaft::AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return 0;
}
- WallObject *wall = GetMeshObject(floor)->CreateWallObject(name);
+ Wall *wall = GetMeshObject(floor)->CreateWallObject(name);
AddFloor(wall, floor, name, texture, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, tw, th, legacy_behavior);
return wall;
}
-bool Shaft::AddFloor(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+bool Shaft::AddFloor(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
Shaft(Object *parent, int number, float CenterX, float CenterZ, int startfloor, int endfloor);
~Shaft();
- WallObject* AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
- bool AddWall(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
- WallObject* AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
- bool AddFloor(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ Wall* AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
+ bool AddWall(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
+ Wall* AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ bool AddFloor(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
void Enabled(int floor, bool value, bool EnableShaftDoors);
void EnableWholeShaft(bool value, bool EnableShaftDoors, bool force = false);
bool IsInShaft(const Ogre::Vector3 &position);
sbs->RemoveStairs(this);
}
-WallObject* Stairs::AddStairs(int floor, const std::string &name, const std::string &texture, const std::string &direction, float CenterX, float CenterZ, float width, float risersize, float treadsize, int num_stairs, float voffset, float tw, float th)
+Wall* Stairs::AddStairs(int floor, const std::string &name, const std::string &texture, const std::string &direction, float CenterX, float CenterZ, float width, float risersize, float treadsize, int num_stairs, float voffset, float tw, float th)
{
//num_stairs is subtracted by 1 since it includes the floor platform above, but not below
//direction is where the stair base is - front, back, left, or right.
}
//create wall object
- WallObject *wall = GetMeshObject(floor)->CreateWallObject(name);
+ Wall *wall = GetMeshObject(floor)->CreateWallObject(name);
std::string Name = name;
TrimString(Name);
return wall;
}
-WallObject* Stairs::AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
+Wall* Stairs::AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return 0;
}
- WallObject *wall = GetMeshObject(floor)->CreateWallObject(name);
+ Wall *wall = GetMeshObject(floor)->CreateWallObject(name);
AddWall(wall, floor, name, texture, thickness, x1, z1, x2, z2, height1, height2, voffset1, voffset2, tw, th);
return wall;
}
-bool Stairs::AddWall(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
+bool Stairs::AddWall(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return sbs->AddWallMain(wall, name, texture, thickness, x1, z1, x2, z2, height1, height2, voffset1, voffset2, tw, th, true);
}
-WallObject* Stairs::AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+Wall* Stairs::AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
return 0;
}
- WallObject *wall = GetMeshObject(floor)->CreateWallObject(name);
+ Wall *wall = GetMeshObject(floor)->CreateWallObject(name);
AddFloor(wall, floor, name, texture, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, tw, th, legacy_behavior);
return wall;
}
-bool Stairs::AddFloor(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
+bool Stairs::AddFloor(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior)
{
//exit with an error if floor is invalid
if (IsValidFloor(floor) == false)
Stairs(Object *parent, int number, float CenterX, float CenterZ, int startfloor, int endfloor);
~Stairs();
- WallObject* AddStairs(int floor, const std::string &name, const std::string &texture, const std::string &direction, float CenterX, float CenterZ, float width, float risersize, float treadsize, int num_stairs, float voffset, float tw, float th);
- WallObject* AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
- bool AddWall(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
- WallObject* AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
- bool AddFloor(WallObject *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ Wall* AddStairs(int floor, const std::string &name, const std::string &texture, const std::string &direction, float CenterX, float CenterZ, float width, float risersize, float treadsize, int num_stairs, float voffset, float tw, float th);
+ Wall* AddWall(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
+ bool AddWall(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
+ Wall* AddFloor(int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
+ bool AddFloor(Wall *wall, int floor, const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, bool reverse_axis, bool texture_direction, float tw, float th, bool legacy_behavior = false);
void Enabled(int floor, bool value);
void EnableWholeStairwell(bool value, bool force = false);
bool IsInStairwell(const Ogre::Vector3 &position);
namespace SBS {
-WallObject::WallObject(MeshObject* wrapper, Object *proxy, bool temporary) : Object(wrapper, temporary)
+Wall::Wall(MeshObject* wrapper, Object *proxy, bool temporary) : Object(wrapper, temporary)
{
//wall object constructor
meshwrapper = wrapper;
sbs->WallCount++;
}
-WallObject::~WallObject()
+Wall::~Wall()
{
//wall object destructor
polygons.clear();
}
-Polygon* WallObject::AddQuad(const std::string &name, const std::string &texture, const Ogre::Vector3 &v1, const Ogre::Vector3 &v2, const Ogre::Vector3 &v3, const Ogre::Vector3 &v4, float tw, float th, bool autosize)
+Polygon* Wall::AddQuad(const std::string &name, const std::string &texture, const Ogre::Vector3 &v1, const Ogre::Vector3 &v2, const Ogre::Vector3 &v3, const Ogre::Vector3 &v4, float tw, float th, bool autosize)
{
//add a quad
return AddPolygon(name, texture, vertices, tw, th, autosize);
}
-Polygon* WallObject::AddPolygon(const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &vertices, float tw, float th, bool autosize)
+Polygon* Wall::AddPolygon(const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &vertices, float tw, float th, bool autosize)
{
//create a generic polygon
Ogre::Matrix3 tm;
return &polygons[index];
}
-Polygon* WallObject::AddPolygon(const std::string &name, const std::string &material, std::vector<std::vector<Ogre::Vector3> > &vertices, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector)
+Polygon* Wall::AddPolygon(const std::string &name, const std::string &material, std::vector<std::vector<Ogre::Vector3> > &vertices, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector)
{
//add a set of polygons, providing the original material and texture mapping
std::vector<Extents> index_extents;
return &polygons[index];
}
-int WallObject::CreatePolygon(std::vector<Triangle> &triangles, std::vector<Extents> &index_extents, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector, const std::string &material, const std::string &name, Ogre::Plane &plane)
+int Wall::CreatePolygon(std::vector<Triangle> &triangles, std::vector<Extents> &index_extents, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector, const std::string &material, const std::string &name, Ogre::Plane &plane)
{
//create a polygon handle
return (int)polygons.size() - 1;
}
-void WallObject::DeletePolygons(bool recreate_collider)
+void Wall::DeletePolygons(bool recreate_collider)
{
//delete polygons
}
}
-void WallObject::DeletePolygon(int index, bool recreate_colliders)
+void Wall::DeletePolygon(int index, bool recreate_colliders)
{
//delete a single polygon
}
}
-int WallObject::GetPolygonCount()
+int Wall::GetPolygonCount()
{
return (int)polygons.size();
}
-Polygon* WallObject::GetPolygon(int index)
+Polygon* Wall::GetPolygon(int index)
{
if (index > -1 && index < (int)polygons.size())
return &polygons[index];
return 0;
}
-int WallObject::FindPolygon(const std::string &name)
+int Wall::FindPolygon(const std::string &name)
{
//find a polygon object by name
- SBS_PROFILE("WallObject::FindPolygon");
+ SBS_PROFILE("Wall::FindPolygon");
for (size_t i = 0; i < polygons.size(); i++)
{
return -1;
}
-void WallObject::GetGeometry(int index, std::vector<std::vector<Ogre::Vector3> > &vertices, bool firstonly, bool convert, bool rescale, bool relative, bool reverse)
+void Wall::GetGeometry(int index, std::vector<std::vector<Ogre::Vector3> > &vertices, bool firstonly, bool convert, bool rescale, bool relative, bool reverse)
{
//gets vertex geometry using mesh's vertex extent arrays; returns vertices in 'vertices'
polygons[index].GetGeometry(vertices, firstonly, convert, rescale, relative, reverse);
}
-bool WallObject::IntersectsWall(Ogre::Vector3 start, Ogre::Vector3 end, Ogre::Vector3 &isect, bool convert)
+bool Wall::IntersectsWall(Ogre::Vector3 start, Ogre::Vector3 end, Ogre::Vector3 &isect, bool convert)
{
//check through polygons to see if the specified line intersects with this wall object
- SBS_PROFILE("WallObject::IntersectsWall");
+ SBS_PROFILE("Wall::IntersectsWall");
float pr, best_pr = 2000000000.;
int best_i = -1;
Ogre::Vector3 cur_isect, normal;
return false;
}
-void WallObject::Move(const Ogre::Vector3 &position, float speed)
+void Wall::Move(const Ogre::Vector3 &position, float speed)
{
//move a wall object
meshwrapper->CreateCollider();
}
-MeshObject* WallObject::GetMesh()
+MeshObject* Wall::GetMesh()
{
return meshwrapper;
}
-void WallObject::SetParentArray(std::vector<WallObject*> &array)
+void Wall::SetParentArray(std::vector<Wall*> &array)
{
parent_array = &array;
}
-Ogre::Vector3 WallObject::GetPoint(const Ogre::Vector3 &start, const Ogre::Vector3 &end)
+Ogre::Vector3 Wall::GetPoint(const Ogre::Vector3 &start, const Ogre::Vector3 &end)
{
//do a line intersection with this wall, and return the intersection point
float distance = 2000000000.;
Ogre::Vector3 normal = Ogre::Vector3::ZERO;
- WallObject *result = meshwrapper->FindWallIntersect(sbs->ToRemote(start), sbs->ToRemote(end), isect, distance, normal, this);
+ Wall *result = meshwrapper->FindWallIntersect(sbs->ToRemote(start), sbs->ToRemote(end), isect, distance, normal, this);
if (result)
return sbs->ToLocal(isect);
return Ogre::Vector3(0, 0, 0);
}
-Ogre::Vector3 WallObject::GetWallExtents(float altitude, bool get_max)
+Ogre::Vector3 Wall::GetWallExtents(float altitude, bool get_max)
{
//return the X and Z extents of this wall object at a specific altitude, by doing a double plane cut
namespace SBS {
-class SBSIMPEXP WallObject : public Object
+class SBSIMPEXP Wall : public Object
{
public:
//functions
- WallObject(MeshObject* wrapper, Object *proxy = 0, bool temporary = false);
- ~WallObject();
+ Wall(MeshObject* wrapper, Object *proxy = 0, bool temporary = false);
+ ~Wall();
Polygon* AddQuad(const std::string &name, const std::string &texture, const Ogre::Vector3 &v1, const Ogre::Vector3 &v2, const Ogre::Vector3 &v3, const Ogre::Vector3 &v4, float tw, float th, bool autosize);
Polygon* AddPolygon(const std::string &name, const std::string &texture, std::vector<Ogre::Vector3> &vertices, float tw, float th, bool autosize);
Polygon* AddPolygon(const std::string &name, const std::string &material, std::vector<std::vector<Ogre::Vector3> > &vertices, Ogre::Matrix3 &tex_matrix, Ogre::Vector3 &tex_vector);
bool IntersectsWall(Ogre::Vector3 start, Ogre::Vector3 end, Ogre::Vector3 &isect, bool convert = true);
void Move(const Ogre::Vector3 &position, float speed = 1.0f);
MeshObject* GetMesh();
- void SetParentArray(std::vector<WallObject*> &array);
+ void SetParentArray(std::vector<Wall*> &array);
Ogre::Vector3 GetPoint(const Ogre::Vector3 &start, const Ogre::Vector3 &end);
Ogre::Vector3 GetWallExtents(float altitude, bool get_max);
std::vector<Polygon> polygons;
//pointer to parent array
- std::vector<WallObject*> *parent_array;
+ std::vector<Wall*> *parent_array;
};
}