Skyscraper 2.0
|
#include <polygon.h>
Classes | |
struct | Geometry |
Public Types | |
typedef std::vector< std::vector< Geometry > > | GeometrySet |
Public Member Functions | |
Polygon (Object *parent, const std::string &name, MeshObject *meshwrapper, GeometrySet &geometry, std::vector< Triangle > &triangles, Matrix3 &tex_matrix, Vector3 &tex_vector, const std::string &material, Plane &plane) | |
~Polygon () | |
void | GetTextureMapping (Matrix3 &t_matrix, Vector3 &t_vector) |
bool | IntersectSegment (const Vector3 &start, const Vector3 &end, Vector3 &isect, Real *pr, Vector3 &normal) |
bool | IntersectRay (const Vector3 &start, const Vector3 &end) |
bool | IntersectSegmentPlane (const Vector3 &start, const Vector3 &end, Vector3 &isect, Real *pr, Vector3 &normal) |
void | Move (const Vector3 &vector, Real speed=1.0) |
Plane | GetAbsolutePlane () |
Vector2 | GetExtents (int coord) |
void | ChangeHeight (Real newheight) |
bool | ReplaceTexture (const std::string &oldtexture, const std::string &newtexture) |
bool | ChangeTexture (const std::string &texture, bool matcheck=true) |
Vector3 | GetVertex (int index) |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
virtual void | Report (const std::string &message) |
virtual bool | ReportError (const std::string &message) |
Public Attributes | |
MeshObject * | mesh |
GeometrySet | geometry |
int | vertex_count |
std::vector< Triangle > | triangles |
Plane | plane |
Matrix3 | t_matrix |
Vector3 | t_vector |
std::string | material |
size_t | size |
Additional Inherited Members | |
![]() | |
SBS * | sbs |
typedef std::vector<std::vector<Geometry> > SBS::Polygon::GeometrySet |
SBS::Polygon::Polygon | ( | Object * | parent, |
const std::string & | name, | ||
MeshObject * | meshwrapper, | ||
GeometrySet & | geometry, | ||
std::vector< Triangle > & | triangles, | ||
Matrix3 & | tex_matrix, | ||
Vector3 & | tex_vector, | ||
const std::string & | material, | ||
Plane & | plane ) |
Definition at line 36 of file polygon.cpp.
References geometry, SBS::SBS::GetTextureManager(), SBS::TextureManager::IncrementTextureUsage(), material, mesh, plane, SBS::SBS::PolygonCount, SBS::MeshObject::ResetPrepare(), SBS::ObjectBase::sbs, SBS::ObjectBase::SetName(), size, t_matrix, t_vector, triangles, and vertex_count.
SBS::Polygon::~Polygon | ( | ) |
Definition at line 64 of file polygon.cpp.
References SBS::TextureManager::DecrementTextureUsage(), SBS::SBS::FastDelete, SBS::SBS::GetTextureManager(), material, mesh, SBS::SBS::PolygonCount, SBS::MeshObject::ResetPrepare(), and SBS::ObjectBase::sbs.
void SBS::Polygon::ChangeHeight | ( | Real | newheight | ) |
Definition at line 130 of file polygon.cpp.
References geometry, GetExtents(), material, mesh, SBS::MeshObject::MeshWrapper, SBS::ObjectBase::sbs, SBS::SBS::ToRemote(), SBS::DynamicMesh::UpdateVertices(), SBS::MeshObject::UsingDynamicBuffers(), and SBS::Polygon::Geometry::vertex.
bool SBS::Polygon::ChangeTexture | ( | const std::string & | texture, |
bool | matcheck = true ) |
Definition at line 178 of file polygon.cpp.
References SBS::DynamicMesh::ChangeTexture(), SBS::TextureManager::DecrementTextureUsage(), SBS::MeshObject::GetDynamicMesh(), SBS::SBS::GetTextureManager(), SBS::TextureManager::IncrementTextureUsage(), material, mesh, and SBS::ObjectBase::sbs.
Referenced by SBS::Wall::ChangeTexture().
Plane SBS::Polygon::GetAbsolutePlane | ( | ) |
Definition at line 99 of file polygon.cpp.
References SBS::Object::GetPosition(), mesh, plane, SBS::ObjectBase::sbs, and SBS::SBS::ToRemote().
Referenced by IntersectRay(), and IntersectSegmentPlane().
Vector2 SBS::Polygon::GetExtents | ( | int | coord | ) |
Definition at line 106 of file polygon.cpp.
References geometry, SBS::Utility::GetExtents(), SBS::SBS::GetUtility(), and SBS::ObjectBase::sbs.
Referenced by ChangeHeight().
Definition at line 74 of file polygon.cpp.
References t_matrix, and t_vector.
Referenced by SBS::Utility::Cut().
Vector3 SBS::Polygon::GetVertex | ( | int | index | ) |
Definition at line 205 of file polygon.cpp.
References geometry.
Referenced by SBS::MeshObject::HitBeam().
Intersect object-space ray with this polygon. This function is similar to IntersectSegment except that it doesn't keep the length of the ray in account. It just tests if the ray intersects with the interior of the polygon. Note that this function also does back-face culling.
Definition at line 385 of file texmap.cpp.
References geometry, GetAbsolutePlane(), SBS::Object::GetPosition(), mesh, plane, SBS::ObjectBase::sbs, SMALL_EPSILON, SBS::SBS::ToLocal(), and SBS::SBS::ToRemote().
Referenced by IntersectSegment().
bool SBS::Polygon::IntersectSegment | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
Vector3 & | isect, | ||
Real * | pr, | ||
Vector3 & | normal ) |
Intersect object-space segment with this polygon. Return true if it intersects and the intersection point in world coordinates.
Definition at line 440 of file texmap.cpp.
References IntersectRay(), and IntersectSegmentPlane().
Referenced by SBS::PolyMesh::FindWallIntersect().
bool SBS::Polygon::IntersectSegmentPlane | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
Vector3 & | isect, | ||
Real * | pr, | ||
Vector3 & | normal ) |
Intersect object-space segment with the plane of this polygon. Return true if it intersects and the intersection point in world coordinates.
Definition at line 457 of file texmap.cpp.
References GetAbsolutePlane(), plane, and SMALL_EPSILON.
Referenced by IntersectSegment().
Definition at line 81 of file polygon.cpp.
References geometry, material, mesh, SBS::MeshObject::MeshWrapper, SBS::ObjectBase::sbs, SBS::SBS::ToRemote(), SBS::DynamicMesh::UpdateVertices(), SBS::MeshObject::UsingDynamicBuffers(), and SBS::Polygon::Geometry::vertex.
bool SBS::Polygon::ReplaceTexture | ( | const std::string & | oldtexture, |
const std::string & | newtexture ) |
Definition at line 151 of file polygon.cpp.
References SBS::DynamicMesh::ChangeTexture(), SBS::TextureManager::DecrementTextureUsage(), SBS::MeshObject::GetDynamicMesh(), SBS::SBS::GetTextureManager(), SBS::TextureManager::IncrementTextureUsage(), material, mesh, and SBS::ObjectBase::sbs.
Referenced by SBS::Wall::ReplaceTexture().
GeometrySet SBS::Polygon::geometry |
Definition at line 47 of file polygon.h.
Referenced by ChangeHeight(), SBS::MeshObject::CreateCollider(), SBS::Utility::Cut(), SBS::MeshObject::GetExtents(), GetExtents(), SBS::MeshObject::GetHeight(), GetVertex(), SBS::DynamicMesh::GetVertexCount(), IntersectRay(), Move(), Polygon(), SBS::DynamicMesh::Mesh::Prepare(), SBS::MeshObject::Prepare(), and SBS::DynamicMesh::Mesh::UpdateVertices().
std::string SBS::Polygon::material |
Definition at line 56 of file polygon.h.
Referenced by ChangeHeight(), ChangeTexture(), SBS::Utility::Cut(), SBS::DynamicMesh::Mesh::DeleteSubMesh(), SBS::MeshObject::GetTriangleCount(), SBS::DynamicMesh::GetVertexCount(), Move(), Polygon(), SBS::DynamicMesh::Mesh::Prepare(), ReplaceTexture(), SBS::DynamicMesh::Mesh::UpdateVertices(), and ~Polygon().
MeshObject* SBS::Polygon::mesh |
Definition at line 46 of file polygon.h.
Referenced by ChangeHeight(), ChangeTexture(), GetAbsolutePlane(), IntersectRay(), Move(), Polygon(), ReplaceTexture(), and ~Polygon().
Plane SBS::Polygon::plane |
Definition at line 50 of file polygon.h.
Referenced by GetAbsolutePlane(), IntersectRay(), IntersectSegmentPlane(), and Polygon().
size_t SBS::Polygon::size |
Definition at line 58 of file polygon.h.
Referenced by SBS::MeshObject::GetSize(), and Polygon().
Matrix3 SBS::Polygon::t_matrix |
Definition at line 53 of file polygon.h.
Referenced by GetTextureMapping(), and Polygon().
Vector3 SBS::Polygon::t_vector |
Definition at line 54 of file polygon.h.
Referenced by GetTextureMapping(), and Polygon().
std::vector<Triangle> SBS::Polygon::triangles |
Definition at line 49 of file polygon.h.
Referenced by SBS::MeshObject::CreateCollider(), SBS::MeshObject::GetTriangleCount(), SBS::MeshObject::HitBeam(), Polygon(), and SBS::DynamicMesh::Mesh::Prepare().
int SBS::Polygon::vertex_count |
Definition at line 48 of file polygon.h.
Referenced by Polygon(), and SBS::DynamicMesh::Mesh::Prepare().